Deployment Guide
🚀 Deployment Guide
Section titled “🚀 Deployment Guide”Deploying a ZunoFramework application involves compiling your C++ code with CMake, configuring TLS (if needed), and running the resulting binary in a secure and reliable environment. This guide walks you through the key steps for production-ready deployment.
🛠️ Building with CMake
Section titled “🛠️ Building with CMake”ZunoFramework is designed to be integrated via CMake using FetchContent
. Here’s a minimal example:
cmake_minimum_required(VERSION 3.20)project(MyZunoApp)
set(CMAKE_CXX_STANDARD 20)set(CMAKE_BUILD_TYPE Release)
include(FetchContent)FetchContent_Declare(zunoGIT_REPOSITORY https://github.com/ZunoFramework/zuno.gitGIT_TAG main)FetchContent_MakeAvailable(zuno)
add_executable(myapp main.cpp)target_link_libraries(myapp PRIVATE zuno)
To build your project:
mkdir -p buildcd buildcmake ..cmake --build . --config Release
This will generate an optimized binary (e.g. myapp
) ready for deployment.
🔐 TLS Configuration
Section titled “🔐 TLS Configuration”If your application uses app.listenTLS()
, make sure your certificate and key files are present and readable:
app.listenTLS(443, { "certs/server.crt", "certs/server.key"});
Deployment tips:
- Use certificates from a trusted CA (e.g. Let’s Encrypt).
- Set secure permissions:
chmod 600
for private keys. - Avoid hardcoding paths—consider using a configuration file.
⚠️ Environment Configuration (Planned)
Section titled “⚠️ Environment Configuration (Planned)”Support for environment variables is not yet implemented in ZunoFramework. For now, configuration values such as ports, file paths, or feature flags should be passed directly in code or loaded from a custom configuration file.
Planned support will allow:
# Not yet supportedexport ZUNO_ENV=productionexport ZUNO_PORT=8080
Stay tuned for updates in future releases.
🧩 Running as a Service
Section titled “🧩 Running as a Service”To keep your app running in production, use a process manager like systemd
:
[Unit]Description=Zuno Web ApplicationAfter=network.target
[Service]ExecStart=/opt/zuno/myappRestart=alwaysUser=www-data
[Install]WantedBy=multi-user.target
Then enable and start the service:
sudo systemctl enable zuno-appsudo systemctl start zuno-app
📈 Logging and Monitoring
Section titled “📈 Logging and Monitoring”Zuno provides built-in logging via zuno::log
. In production, redirect logs to a file or use a logging agent:
./myapp >> /var/log/zuno.log 2>&1
You can also integrate with:
- journald (via systemd)
- Fluent Bit or Logrotate
- Prometheus (via custom metrics)
🧪 Health Checks
Section titled “🧪 Health Checks”Implement a simple health check route to verify uptime:
app.get("/health", {}, [](const zuno::Request& req, zuno::Response& res) { res.json({{"status", "ok"}});});
Use this endpoint with uptime monitors or load balancers.
Need help with a specific deployment setup? Join the discussion on GitHub or check the Advanced Configuration guide.