vix.cpp/core — The foundational module of the Vix.cpp framework.
Provides the high-performance HTTP server, router, middleware system, and base runtime.
Every other Vix module builds on top of this layer.
- ⚡ High-Performance HTTP Server — Async I/O using Boost.Asio & Beast
- 🧭 Router System — Supports
/users/{id}syntax & HTTP method matching - 🧩 Middleware Pipeline — Extend with logging, auth, rate limiting, etc.
- 📦 JSON Utilities — Built-in nlohmann/json (optional & pluggable)
- 🧵 Thread-Safe Lifecycle — Graceful shutdown via signal handlers
- 🧠 Optimized Runtime — Low allocations,
std::string_viewrouting, fast parameter parsing
+----------------------+
| App |
| - Manages routes |
| - Runs HTTP server |
+----------+-----------+
|
v
+---------------------- +
| Router |
| - Matches paths |
| - Resolves params |
+----------+-----------+
|
v
+---------------------- +
| RequestHandler<T> |
| - Executes handler |
| - Builds response |
+----------+-----------+
|
v
+---------------------- +
| ResponseWrapper |
| - JSON / Text |
| - Status helpers |
+----------------------+
git clone https://github.com/vixcpp/core.git
cd core
cmake -B build -DCMAKE_BUILD_TYPE=Release
cmake --build build -j$(nproc)Requirements
- C++20 compiler
- CMake ≥ 3.20
- Boost ≥ 1.78 (
filesystem,system) - Optional: OpenSSL, nlohmann/json
#include <vix/core.h>
int main() {
vix::App app;
app.get("/hello", [](auto&, auto& res) {
res.json({{"message", "Hello, World!"}});
});
app.get("/users/{id}", [](auto&, auto& res, auto& params) {
res.json({{"user_id", params["id"]}});
});
app.run(8080);
}✅ Supports GET, POST, PUT, DELETE
✅ Automatic path parameter extraction
✅ Helper methods: res.json(), res.text(), res.status()
Command
wrk -t8 -c200 -d30s --latency http://localhost:8080/Results
Requests/sec: 80,083.48
Latency: p50=2.21ms, p99=3.27ms
Transfer/sec: 18.25MB
Benchmark Environment
- 8 threads · 200 connections · 30 seconds
- C++20 (GCC 13 / Clang 17) · Boost 1.84
- Ubuntu 24.04 x64
- Build type: Release (LTO enabled)
🧠 Optimized for cache locality, async I/O, and minimal overhead.
| Option | Default | Description |
|---|---|---|
VIX_CORE_WITH_OPENSSL |
ON | Enable HTTPS/TLS support |
VIX_CORE_WITH_MYSQL |
OFF | Link MySQL C++ Connector |
VIX_CORE_WITH_JSON |
AUTO | AUTO / ON / OFF |
VIX_CORE_FETCH_UTILS |
ON | Auto-fetch vix::utils if missing |
- Fork this repo
- Create a new branch
feature/... - Commit and open a PR
- Follow the Vix coding style
MIT License © Gaspard Kirira
See LICENSE for details.