Boson is a blazing-fast, modern web framework for C++17. Build scalable APIs and web applications with the raw power of C++, a clean developer experience, and zero runtime bloat.
Think Express.js, but C++ fast.
- 🔋 Built for Speed – Zero-overhead routing, optimized HTTP handling.
- 💡 Intuitive API – Inspired by modern frameworks like Express and FastAPI.
- 🧠 Modern C++17 Design – Clean, safe, and familiar to experienced C++ devs.
- 📦 Lightweight & Flexible – Perfect for microservices or monoliths.
- 🔧 Developer Ergonomics – Clean interfaces that make web development in C++ accessible.
- 🔒 Memory Safety – Smart design patterns that help prevent common memory errors.
- ⚡ Fast HTTP Server – Built from scratch for performance
- 🔀 Expressive Routing – Define endpoints effortlessly with parameter capture
- 🧩 Middleware Support – Compose your request pipeline with global and route-specific middleware
- 📦 JSON Support – Parse and return JSON with ease using the integrated libraries
- 🧭 MVC-style Controllers – Keep code organized with controller architecture
- 🛠️ Robust Error Handling – Built-in exception handling and custom error responses
- ⚙️ CLI Tooling – Scaffold projects, controllers, and more
- Devs needing high-performance web backends
- C++ teams building modern web APIs
- Systems where low latency matters (finance, games, IoT, etc.)
- Projects with resource constraints where memory efficiency is critical
- Developers who want predictable performance without garbage collection pauses
#include <boson/boson.hpp>
int main() {
boson::initialize();
boson::Server app;
app.get("/", [](const boson::Request& req, boson::Response& res) {
res.send("Hello, Boson!");
});
// JSON response
app.get("/api/user", [](const boson::Request& req, boson::Response& res) {
res.jsonObject({
{"id", 1},
{"name", "John Doe"},
{"email", "john@example.com"}
});
});
app.configure(3000, "127.0.0.1");
return app.listen();
}✅ Use Boson CLI, run, and visit http://localhost:3000.
Boson is built on a clean, modular architecture that prioritizes performance and flexibility:
- Core Foundation Layer – Memory management, event loops, threading
- HTTP Layer – Connection handling, HTTP parsing, protocol implementation
- Server Layer – Request lifecycle, connection pooling, timeout management
- Middleware Layer – Request processing pipeline
- Routing Layer – URL pattern matching and dispatching
- Controller Layer – Resource organization and response generation
- Application Layer – Configuration, authentication, authorization
- C++ Compiler with C++17 support (GCC 7.3+, Clang 6.0+, or MSVC 2017+)
- CMake 3.14 or higher
- OpenSSL 1.1.1 or higher (for HTTPS support)
curl -sSL https://raw.githubusercontent.com/S1D007/boson/main/install.sh | bashiwr -useb https://raw.githubusercontent.com/S1D007/boson/main/install.ps1 | iexboson new my-project
cd my-projectcd my-project
mkdir build && cd build
cmake ..
make
./my-projectRead the Full Installation Guide
Boson delivers exceptional performance compared to other web frameworks:
- 5-20x higher request throughput than Ruby/Python frameworks
- 2-5x higher throughput than Node.js/Java/Go/Rust frameworks
- Significantly lower latency and smaller memory footprint
Detailed benchmarks coming soon: Boson vs Go-Gin vs Node.js vs Drogon
- Basic API - Simple API demonstrating core concepts
- JSON Example - Working with JSON data
- Library Management App - Complete CRUD application
Comprehensive documentation is available at bosonframework.vercel.app/docs
We welcome contributions from the community! If you'd like to help make Boson better:
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
C++ Web Framework · High Performance · Express-style · Modern C++ · REST API · Fast HTTP Server · Embedded Web · Low Latency · Microservices · JSON API