Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,36 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## v1.17.0

### Added

- `vix install` command to install/setup a Vix project or `.vixpkg` artifact.
- Middleware integrated into the default Vix runtime (works out-of-the-box).
- A full set of middleware-focused examples:
- Auth (API key, JWT, RBAC)
- CORS (basic/strict)
- CSRF (strict + demos)
- Rate limiting (servers + pipeline demos)
- IP filtering (servers + pipeline demos)
- Body limit
- Compression
- HTTP cache
- ETag
- Security headers
- Static files
- JSON/form/multipart parsing
- Group builder examples

### Changed

- Updated CMake configuration and `VixConfig.cmake` to expose the middleware stack correctly for downstream projects.
- Updated README/docs to reflect the new install workflow and middleware usage.

### Notes

- No breaking changes expected.

## v1.16.1 — REPL Isolation & Stability

### ✨ Improvements
Expand Down
5 changes: 2 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ cmake_minimum_required(VERSION 3.20)
# cmake --build build -j
# ====================================================================

project(vix VERSION 1.16.1 LANGUAGES CXX)
project(vix VERSION 1.17.1 LANGUAGES CXX)

# Make find_package honor *_ROOT hints (e.g. MYSQLCPPCONN_ROOT)
if (POLICY CMP0144)
Expand Down Expand Up @@ -654,8 +654,7 @@ if (VIX_ENABLE_INSTALL)
COMPATIBILITY SameMajorVersion
)

# Export flags for consumers (substituted into VixConfig.cmake)
set(VIX_HAS_ORM ${VIX_HAS_ORM}) # already computed
set(VIX_HAS_ORM ${VIX_HAS_ORM})
set(VIX_ORM_WITH_MYSQL OFF)
if (VIX_HAS_ORM AND VIX_ORM_USE_MYSQL)
set(VIX_ORM_WITH_MYSQL ON)
Expand Down
129 changes: 55 additions & 74 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -159,61 +159,6 @@ vix>

---

## 🧮 Math Expressions

You can type expressions directly:

```text
1 + 2
10 * (3 + 4)
```

## 🧩 JSON Support

The REPL supports **strict JSON** using `nlohmann::json`.

### Objects

```text
user = {"name":"Gaspard","age":10}
user
```

### Arrays

```text
nums = [1,2,3,4]
nums
```

## 🖨️ print / println

### Basic output

```text
print("Hello")
println("Hello world")
```

### Mix strings and expressions

```text
x = 3
println("x =", x)
println("x+1 =", x+1)
```

## ⚙️ Built-in Vix API

The REPL exposes a built-in `Vix` object.

### Working directory

```text
cwd()
Vix.cwd()
```

### Minimal HTTP + WebSocket Server

This example shows the **smallest fully working HTTP + WS hybrid server**.
Expand All @@ -228,31 +173,29 @@ This example shows the **smallest fully working HTTP + WS hybrid server**.

```cpp
#include <vix.hpp>
#include <vix/websocket/AttachedRuntime.hpp>
#include <vix/websocket/Runtime.hpp>

using namespace vix;

int main()
{
auto bundle = vix::make_http_and_ws("config/config.json");
auto &[app, ws] = bundle;
vix::serve_http_and_ws([](auto &app, auto &ws){

// HTTP
app.get("/", [](auto&, auto& res)
{
res.send("HTTP + WebSocket");
});

// WebSocket
ws.on_typed_message([&ws](auto&,
const std::string& type,
const vix::json::kvs& payload){
if (type == "ping")
ws.broadcast_json("pong", payload);
});

app.get("/", [](const Request &, Response &res)
{ res.json({"framework", "Vix.cpp",
"message", "HTTP + WebSocket example (basic) 🚀"}); });

ws.on_open([&ws](auto &session)
{
(void)session;

ws.broadcast_json("chat.system", {
"user", "server",
"text", "Welcome to Vix WebSocket! 👋"
}); });

vix::run_http_and_ws(app, ws, 8080);

return 0;
});
}
```

Expand Down Expand Up @@ -315,11 +258,49 @@ C++20 + Asio + zero-overhead abstractions.

To build **Vix.cpp** from source:

## 🐧 Linux / Ubuntu

### Prerequisites

```bash
sudo apt update
sudo apt install -y \
g++-12 cmake make git \ # Build tools
libboost-all-dev \ # Boost (asio, beast)
nlohmann-json3-dev \ # JSON (nlohmann/json)
libspdlog-dev \ # Logging (spdlog)
zlib1g-dev \ # gzip / ZLIB
libmysqlcppconn-dev # Optional: MySQL Connector/C++ for ORM
```

Optional dependencies:

```bash
sudo apt install -y libmysqlcppconn-dev libsqlite3-dev
```

---

## 🍎 macOS

### Prerequisites

Install Homebrew first, then:

```bash
brew install cmake ninja llvm boost nlohmann-json spdlog fmt mysql sqlite3 zlib
export ZLIB_ROOT="$(brew --prefix zlib)"
```

### Build

```bash
git clone https://github.com/vixcpp/vix.git
cd vix
git submodule update --init --recursive
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release
cmake --build build -j
sudo cmake --install build --prefix /usr/local
```

> This builds the Vix runtime and CLI.
Expand Down
2 changes: 1 addition & 1 deletion modules/cli
Submodule cli updated 1 files
+54 −27 CHANGELOG.md
Loading