This is a minimalistic but highly extensible HTTP-based Todo management server written in modern C++20, emphasizing simplicity, testability, and performance.
It follows a practical Hexagonal Architecture without relying on verbose virtual interface hierarchies — making it ideal for both education and small-scale system design.
This project uses the following external dependencies:
- Boost – Boost 1.88 (
json,system,asio,beast) - jh-toolkit – POD types and memory-safe wrappers (
Apache 2.0)
All are statically linked, and no runtime dependencies are required.
- ✅ RESTful API with more than 10 routes
- ✅ Dual-indexed in-memory repository (name & timestamp)
- ✅ CSV import/export (bulk insertion & backup)
- ✅ Modern build system with CMake + Ninja + Clang + libc++
- ✅ Docker multi-arch support (amd64/arm64)
mkdir -p build && cd build
cmake .. -DCMAKE_BUILD_TYPE=Release
cmake --build .
./TodoAPP✅ Clang + libc++ only tested (fully supported on macOS and most Linux distributions)
⚠️ GCC is not tested, and may fail due to header lookup or ABI quirks ❌ Windows is unsupported due to POSIX usage (sigaction,timegm, etc.)
docker buildx build --platform linux/amd64 -t todo-app:amd64 --load .
docker run -p 8080:8080 todo-app:amd64See build.md for complete Dockerfile and buildx instructions.
See urls.md for full list of routes and example curl usage.
- Custom router built over Boost.Beast
- Routes self-register via
REGISTER_VIEW(...)macros - Handlers are regular C++ functions — readable and testable
- No virtual interfaces or DI frameworks
- Application logic is separate from I/O (e.g., CSV / HTTP / persistence)
- Can be extended to SQLite or external databases easily
-
jh::pod::array<char, 64>used as hashmap key — stack-allocated, transparent lookup -
Memory-local and avoids dynamic allocation like
std::string -
Dual index:
by_name_: O(1) lookup by nameby_time_: log(N) range-scan by timestamp
To shut down the server:
curl -X POST http://localhost:8080/shutdown_server
⚠️ Do not force-close (docker stop) — the server handles cleanup only via this route.