High-performance C++ backend for the VIP real estate platform, built with Drogon, Glaze, PostgreSQL, and libsodium.
VIP Backend is a layered C++ web service focused on fast request handling, async database access, and predictable domain boundaries. The codebase follows a Controller -> Service -> Repository -> Domain -> DTO structure and uses Drogon coroutines for non-blocking workflows.
The project uses Pixi as the main development package manager. Pixi provides the compiler/tooling environment, while CMake and vcpkg resolve and build the C++ dependencies declared in vcpkg.json.
| Tool or library | Purpose |
|---|---|
| Pixi | Development environment and task runner |
| CMake Presets | Reproducible configure/build profiles |
| Ninja | Fast build backend |
| vcpkg | C++ dependency resolution through manifest mode |
| Clang >= 21 | Primary C++ compiler |
| Drogon | HTTP framework and ORM |
| Glaze | High-performance JSON serialization |
| yaml-cpp | YAML configuration support |
| libsodium | Password hashing and security primitives |
| PostgreSQL | Primary relational database |
| Docker Compose | Containerized database and backend runtime |
- Pixi
- Docker and Docker Compose
- Clang >= 21, provided by Pixi for local builds
- On Linux with Clang + libstdc++, libstdc++ >= 15
Install Pixi from the official installer if it is not already available:
curl -fsSL https://pixi.sh/install.sh | shInstall the Pixi environment:
pixi installStart PostgreSQL with Docker Compose:
docker compose up -d dbBuild and run the debug binary:
pixi run runThe backend listens on:
http://localhost:5555
API documentation is served from:
http://localhost:5555/docs/index.html
| Command | Description |
|---|---|
pixi run ensure-vcpkg |
Prepare the local .vcpkg checkout used by CMake presets |
pixi run build |
Configure and build the default debug preset |
pixi run run |
Build and run the debug binary |
pixi run build-debug |
Explicit debug build |
pixi run run-debug |
Explicit debug run |
pixi run build-release |
Configure and build the local release preset |
pixi run run-release |
Build and run the local release binary |
pixi run configure |
Fresh configure for the debug preset |
pixi run configure-release |
Fresh configure for the release preset |
pixi run clean |
Remove local debug and release build directories |
pixi run fmt |
Format C++ sources with clang-format |
pixi run run-docker |
Build and run the full Docker Compose stack |
Local debug artifacts are written to cmake-build-debug/.
Local release artifacts are written to cmake-build-release/.
Run the full stack with Pixi:
pixi run run-dockerThis runs:
docker compose up --buildThe Compose stack starts:
vip-postgreson port5432vip-backendon port5555
Stop the stack with:
docker compose downThe Dockerfile uses a multi-stage build. Pixi is used only in the builder stage to install the build environment and run the CMake/vcpkg build. The final runtime image contains only the runtime dependencies, configuration, static files, and compiled vip binary.
The application loads configuration from:
config.yaml
For local Pixi runs, the default database host is 127.0.0.1, which works with:
docker compose up -d dbDuring Docker image build, the Dockerfile rewrites the database host to db so the app container can reach the Compose PostgreSQL service.
C++ dependencies are declared in vcpkg.json, including:
- Drogon with
ctl,postgres, andyamlfeatures - Glaze
- libsodium
- yaml-cpp
CMake uses vcpkg manifest mode through the configured presets. You usually do not need to call vcpkg directly; use Pixi tasks instead.
- Controllers handle HTTP routing and request/response boundaries.
- Services own business workflows.
- Repositories own database access.
- Domains and DTOs define API and business data shapes.
- Generated model files live under
models/.
The project currently builds with the configured CMake standard in CMakeLists.txt and requires Clang >= 21 for the primary local toolchain.