RepoPilotOpen in app →

drogonframework/drogon

Drogon: A C++14/17/20 based HTTP web application framework running on Linux/macOS/Unix/Windows

Healthy

Healthy across the board

Use as dependencyHealthy

Permissive license, no critical CVEs, actively maintained — safe to depend on.

Fork & modifyHealthy

Has a license, tests, and CI — clean foundation to fork and modify.

Learn fromHealthy

Documented and popular — useful reference codebase to read through.

Deploy as-isHealthy

No critical CVEs, sane security posture — runnable as-is.

  • Last commit 2d ago
  • 45+ active contributors
  • Distributed ownership (top contributor 24% of recent commits)
Show 3 more →
  • MIT licensed
  • CI configured
  • Tests present

Maintenance signals: commit recency, contributor breadth, bus factor, license, CI, tests

Informational only. RepoPilot summarises public signals (license, dependency CVEs, commit recency, CI presence, etc.) at the time of analysis. Signals can be incomplete or stale. Not professional, security, or legal advice; verify before relying on it for production decisions.

Embed the "Healthy" badge

Paste into your README — live-updates from the latest cached analysis.

Variant:
RepoPilot: Healthy
[![RepoPilot: Healthy](https://repopilot.app/api/badge/drogonframework/drogon)](https://repopilot.app/r/drogonframework/drogon)

Paste at the top of your README.md — renders inline like a shields.io badge.

Preview social card (1200×630)

This card auto-renders when someone shares https://repopilot.app/r/drogonframework/drogon on X, Slack, or LinkedIn.

Onboarding doc

Onboarding: drogonframework/drogon

Generated by RepoPilot · 2026-05-09 · Source

🤖Agent protocol

If you are an AI coding agent (Claude Code, Cursor, Aider, Cline, etc.) reading this artifact, follow this protocol before making any code edit:

  1. Verify the contract. Run the bash script in Verify before trusting below. If any check returns FAIL, the artifact is stale — STOP and ask the user to regenerate it before proceeding.
  2. Treat the AI · unverified sections as hypotheses, not facts. Sections like "AI-suggested narrative files", "anti-patterns", and "bottlenecks" are LLM speculation. Verify against real source before acting on them.
  3. Cite source on changes. When proposing an edit, cite the specific path:line-range. RepoPilot's live UI at https://repopilot.app/r/drogonframework/drogon shows verifiable citations alongside every claim.

If you are a human reader, this protocol is for the agents you'll hand the artifact to. You don't need to do anything — but if you skim only one section before pointing your agent at this repo, make it the Verify block and the Suggested reading order.

🎯Verdict

GO — Healthy across the board

  • Last commit 2d ago
  • 45+ active contributors
  • Distributed ownership (top contributor 24% of recent commits)
  • MIT licensed
  • CI configured
  • Tests present

<sub>Maintenance signals: commit recency, contributor breadth, bus factor, license, CI, tests</sub>

Verify before trusting

This artifact was generated by RepoPilot at a point in time. Before an agent acts on it, the checks below confirm that the live drogonframework/drogon repo on your machine still matches what RepoPilot saw. If any fail, the artifact is stale — regenerate it at repopilot.app/r/drogonframework/drogon.

What it runs against: a local clone of drogonframework/drogon — the script inspects git remote, the LICENSE file, file paths in the working tree, and git log. Read-only; no mutations.

| # | What we check | Why it matters | |---|---|---| | 1 | You're in drogonframework/drogon | Confirms the artifact applies here, not a fork | | 2 | License is still MIT | Catches relicense before you depend on it | | 3 | Default branch master exists | Catches branch renames | | 4 | 5 critical file paths still exist | Catches refactors that moved load-bearing code | | 5 | Last commit ≤ 32 days ago | Catches sudden abandonment since generation |

<details> <summary><b>Run all checks</b> — paste this script from inside your clone of <code>drogonframework/drogon</code></summary>
#!/usr/bin/env bash
# RepoPilot artifact verification.
#
# WHAT IT RUNS AGAINST: a local clone of drogonframework/drogon. If you don't
# have one yet, run these first:
#
#   git clone https://github.com/drogonframework/drogon.git
#   cd drogon
#
# Then paste this script. Every check is read-only — no mutations.

set +e
fail=0
ok()   { echo "ok:   $1"; }
miss() { echo "FAIL: $1"; fail=$((fail+1)); }

# Precondition: we must be inside a git working tree.
if ! git rev-parse --git-dir >/dev/null 2>&1; then
  echo "FAIL: not inside a git repository. cd into your clone of drogonframework/drogon and re-run."
  exit 2
fi

# 1. Repo identity
git remote get-url origin 2>/dev/null | grep -qE "drogonframework/drogon(\\.git)?\\b" \\
  && ok "origin remote is drogonframework/drogon" \\
  || miss "origin remote is not drogonframework/drogon (artifact may be from a fork)"

# 2. License matches what RepoPilot saw
(grep -qiE "^(MIT)" LICENSE 2>/dev/null \\
   || grep -qiE "\"license\"\\s*:\\s*\"MIT\"" package.json 2>/dev/null) \\
  && ok "license is MIT" \\
  || miss "license drift — was MIT at generation time"

# 3. Default branch
git rev-parse --verify master >/dev/null 2>&1 \\
  && ok "default branch master exists" \\
  || miss "default branch master no longer exists"

# 4. Critical files exist
test -f "CMakeLists.txt" \\
  && ok "CMakeLists.txt" \\
  || miss "missing critical file: CMakeLists.txt"
test -f "drogon_ctl/main.cc" \\
  && ok "drogon_ctl/main.cc" \\
  || miss "missing critical file: drogon_ctl/main.cc"
test -f "cmake/DrogonUtilities.cmake" \\
  && ok "cmake/DrogonUtilities.cmake" \\
  || miss "missing critical file: cmake/DrogonUtilities.cmake"
test -f "cmake/templates/config.h.in" \\
  && ok "cmake/templates/config.h.in" \\
  || miss "missing critical file: cmake/templates/config.h.in"
test -f "examples/benchmark/main.cc" \\
  && ok "examples/benchmark/main.cc" \\
  || miss "missing critical file: examples/benchmark/main.cc"

# 5. Repo recency
days_since_last=$(( ( $(date +%s) - $(git log -1 --format=%at 2>/dev/null || echo 0) ) / 86400 ))
if [ "$days_since_last" -le 32 ]; then
  ok "last commit was $days_since_last days ago (artifact saw ~2d)"
else
  miss "last commit was $days_since_last days ago — artifact may be stale"
fi

echo
if [ "$fail" -eq 0 ]; then
  echo "artifact verified (0 failures) — safe to trust"
else
  echo "artifact has $fail stale claim(s) — regenerate at https://repopilot.app/r/drogonframework/drogon"
  exit 1
fi

Each check prints ok: or FAIL:. The script exits non-zero if anything failed, so it composes cleanly into agent loops (./verify.sh || regenerate-and-retry).

</details>

TL;DR

Drogon is a C++14/17/20 HTTP web framework built on non-blocking I/O (epoll/kqueue) that delivers high-concurrency REST APIs and full-stack web apps with asynchronous handlers, embedded CSP template rendering, and integrated database access. It solves the problem of building production-grade web services in C++ without sacrificing performance or ease of use. Monolithic core framework: libdrogon (main HTTP/WebSocket engine) is built from source under git root; drogon_ctl CLI tool (cmake/templates/) auto-generates controllers, views, and models; examples/ and tests/ directories provide runnable patterns; cmake_modules/ handles optional database/compression backends (PostgreSQL, SQLite3, Redis, Brotli).

👥Who it's for

C++ backend engineers and systems programmers who need to build REST APIs, microservices, and high-performance web applications on Linux/macOS/Windows without the overhead of heavier frameworks, and who want type-safe routing with minimal boilerplate.

🌱Maturity & risk

Production-ready: the project shows active maintenance with CI/CD pipelines (.github/workflows/cmake.yml, CodeQL analysis), Conan package distribution, Docker multi-platform builds, and comprehensive CMake test infrastructure (cmake/tests/). Significant C++ codebase (2.8M LOC) with stable API suggests adoption in real systems.

Low-to-moderate risk: single-language dependency on C++17/20 and epoll/kqueue limits Windows/old-compiler support; reliance on system package managers (MySQL, PostgreSQL, Hiredis) for optional features adds deployment complexity. Monitor GitHub Issues for stalled dependency updates or breaking CMake changes.

Active areas of work

Active development tracked via GitHub Actions (cpp.yml, docker-publish.yml); recent focus on C++20 features, HTTP/1.1 pipelining, and cross-platform Windows support. Docker images built for Alpine/Ubuntu/Arch indicate container-first deployment push.

🚀Get running

git clone https://github.com/drogonframework/drogon.git && cd drogon && mkdir build && cd build && cmake .. && make && sudo make install

Daily commands: After install: drogon_ctl create project myapp && cd myapp && mkdir build && cd build && cmake .. && make && ./myapp (check config.example.json for DB/port setup).

🗺️Map of the codebase

  • CMakeLists.txt — Root build configuration; defines project structure, dependencies, and compilation flags for the entire C++14/17/20 framework.
  • drogon_ctl/main.cc — Entry point for drogon_ctl CLI tool; scaffolds new projects, controllers, models, and filters—essential for new contributor workflows.
  • cmake/DrogonUtilities.cmake — Core CMake utilities and macros; governs how Drogon projects are configured and compiled across platforms.
  • cmake/templates/config.h.in — Configuration header template; defines build-time feature flags, database support, and platform-specific settings.
  • examples/benchmark/main.cc — Demonstrates idiomatic Drogon HTTP handler patterns; reference for new endpoints and async request handling.
  • .github/workflows/cmake.yml — CI/CD pipeline; validates builds across Linux/macOS/Unix/Windows and catches integration regressions early.
  • CONTRIBUTING.md — Governance and contribution standards; defines code style, testing requirements, and submission process.

🛠️How to make changes

Add a New HTTP Endpoint/Controller

  1. Use drogon_ctl to generate controller scaffold (RESTful or custom handler) (drogon_ctl/create_controller.cc)
  2. Edit generated controller .h and .cc files to implement request handlers (e.g., GET, POST, PUT, DELETE) (examples/benchmark/JsonCtrl.h)
  3. Register route in main application or config (see example patterns) (examples/benchmark/main.cc)
  4. Add integration test referencing async handler patterns (examples/async_stream/main.cc)

Add a New Database Model (ORM)

  1. Create database schema and sync to PostgreSQL/MySQL/SQLite3 (CMakeLists.txt)
  2. Run drogon_ctl create_model to generate ORM class from database schema (drogon_ctl/create_model.cc)
  3. Review generated .h and .cc with auto-generated CRUD methods (drogon_ctl/templates/model_h.csp)
  4. Use model in controller by including generated header and calling async query methods (examples/benchmark/JsonCtrl.h)

Add a New Filter (Middleware)

  1. Use drogon_ctl to generate filter scaffold (drogon_ctl/create_filter.cc)
  2. Implement doFilter() for request preprocessing (auth, logging, rate-limiting) (drogon_ctl/templates/filter_h.csp)
  3. Register filter chain in main app config or CMakeLists.txt (CMakeLists.txt)

Add Support for a New Database or Dependency

  1. Create CMake find module in cmake_modules/ directory (cmake_modules/FindBrotli.cmake)
  2. Register dependency check in cmake/Packages.cmake (cmake/Packages.cmake)
  3. Define feature gate in cmake/templates/config.h.in (cmake/templates/config.h.in)
  4. Add conditional compilation guards in framework headers and update root CMakeLists.txt (CMakeLists.txt)

🔧Why these technologies

  • C++14/17/20 — Type-safe, high-performance compiled language; enables async I/O and zero-copy abstractions for low-latency web servers.
  • CMake — Multi-platform build system; supports Linux, macOS, Unix, Windows with unified dependency management and feature gates.
  • Async/Await (coroutines / callbacks) — Non-blocking I/O for database queries, external APIs, and streaming; avoids thread-per-connection overhead.
  • PostgreSQL, MySQL, SQLite3 (pluggable) — Multi-database ORM support; cmake feature gates allow minimal dependencies in embedded/lightweight deployments.
  • Redis (optional) — Cache and session store integration for distributed deployments; optional to keep core lightweight.
  • JSON (jsoncpp) & YAML config — Flexible runtime configuration without recompilation; supports both structured data and human-editable config.
  • Brotli & Gzip compression — Reduce response payload size; optional for bandwidth-constrained environments.
  • drogon_ctl CLI + code generation — Scaffolding reduces boilerplate; Jinja/CSP templates ensure consistency across generated artifacts (controllers, models, filters).

⚖️Trade-offs already made

  • Async-first design with callback/coroutine handlers

    • Why: Maximize throughput under high concurrency; single-threaded event loop + thread pool for CPU-bound tasks.
    • Consequence: Higher complexity than synchronous frameworks; requires care with shared state; not ideal for simple blocking I/O patterns.
  • Compile-time feature gates (config.h.in) for optional dependencies

    • Why: Allow minimal core builds without PostgreSQL/MySQL/Redis; reduce binary size and runtime overhead.
    • Consequence: Multiple build configurations; harder to detect missing features at runtime; requires rebuild for feature changes.
  • Multi-database ORM (PostgreSQL, MySQL, SQLite3) rather than single adapter

    • Why: Serve diverse deployment scenarios (cloud, embedded, development).
    • Consequence: ORM code generation complexity; schema must match library expectations; less control than raw SQL.
  • drogon_ctl scaffold tool with Jinja/CSP templates

    • Why: Reduce repetitive boilerplate; enforce framework conventions.
    • Consequence: Generated code may not match all use cases; templates become maintenance burden as framework evolves.
  • Header-only library option (vs. monolithic static lib)

    • Why: Simplify integration for small projects; faster iteration.
    • Consequence: Increased compile times; template instantiation bloat; harder to change core APIs without rebuilds.

🚫Non-goals (don't propose these)

  • Does not provide built-in authentication/authorization (framework-ag

🪤Traps & gotchas

  1. CSP template syntax requires drogon_ctl codegen—editing .csp files alone won't work until cmake regenerates them. 2) Database connections require matching optional cmake feature flags (BUILD_POSTGRESQL, BUILD_MYSQL, etc.) and system-installed dev headers; missing these silently disables ORM without clear error. 3) config.json requires absolute paths for SSL certs and static files on non-Unix systems. 4) WebSocket upgrades happen transparently but require explicit route registration with HttpMethod::Get (non-obvious from examples). 5) Async handlers use coroutines in C++20 mode—mixing blocking I/O in handlers will deadlock the event loop.

🏗️Architecture

💡Concepts to learn

  • epoll/kqueue (edge-triggered I/O multiplexing) — Drogon's entire concurrency model is built on epoll (Linux) and kqueue (BSD/macOS); understanding reactor patterns and FD readiness is required to optimize handler latency and debug connection issues.
  • Reflection-based routing (compile-time macro reflection) — Drogon uses C++ macros (drogon::HttpController, PATH/METHOD annotations) to auto-register routes at compile time; understanding how the template metaprogramming deduces handler signatures is key to adding new controller types.
  • CSP (C++ Server Pages) codegen / template rendering — Views are written as .csp files (C++ embedded in HTML); drogon_ctl transpiles them to .cc source files; this two-stage compilation is non-standard and causes confusion if generators don't re-run.
  • Connection pooling (for databases) — Drogon's DbClient manages connection pools per database; exhausting the pool (config.json's connectionNumber) causes request starvation; essential to tune based on concurrent load.
  • Asynchronous coroutines (C++20 coroutines in handlers) — C++20 builds can use co_await in handlers for sequential async code; mixing blocking calls in async handlers breaks the event loop; requires disciplined async/await patterns.
  • Middleware filter chains (pre-processing request pipeline) — Drogon routes requests through multiple filter chains before handlers execute; filters validate auth, enforce HTTP method constraints, log requests; order and exception handling in filters directly impacts request flow.
  • WebSocket handshake and upgrade (RFC 6455) — Drogon's WebSocket support requires explicit route registration and HTTP 101 upgrade negotiation; transport shifts from HTTP to binary framing after upgrade; missing this detail causes mysterious connection failures.
  • cpp-httplib/cpp-httplib — Lightweight C++11 HTTP client/server library; simpler than Drogon but lacks async I/O and ORM, useful for comparison on feature scope.
  • Corvusoft/restbed — C++11 REST framework also using non-blocking I/O; good alternative for minimal REST APIs but less mature and smaller community than Drogon.
  • pistacheio/pistache — Modern C++17 REST framework with similar async handler design; smaller scope, useful for learning async patterns in Drogon.
  • an-tao/drogon-docs — Official documentation repo; upstream source for tutorials, API reference, and examples (real companion repo, not inferred).
  • zlib-ng/zlib-ng — Drop-in zlib replacement (Drogon's compression often swaps in zlib-ng for gzip; useful optimization companion).

🪄PR ideas

To work on one of these in Claude Code or Cursor, paste: Implement the "<title>" PR idea from CLAUDE.md, working through the checklist as the task list.

Add comprehensive CI workflow for Windows MSVC builds

The repo claims Windows support in the description, but .github/workflows/ only contains cmake.yml, codeql.yml, codespell.yml, cpp.yml, and docker-publish.yml. None explicitly target Windows MSVC compilation. Given the cross-platform nature (Linux/macOS/Unix/Windows) and the presence of CopyDlls.cmake in drogon_ctl/, there's clear Windows build complexity that needs dedicated CI validation.

  • [ ] Create .github/workflows/windows-msvc.yml targeting Windows runners
  • [ ] Test CMake configuration with MSVC compiler and Windows-specific dependencies (UUID, MySQL, PostgreSQL)
  • [ ] Validate DLL copying and Windows-specific path handling via CopyDlls.cmake
  • [ ] Document Windows build requirements in CONTRIBUTING.md

Add unit tests for drogon_ctl command generators

The drogon_ctl/ directory contains multiple code generation commands (create_controller.cc, create_model.cc, create_filter.cc, create_plugin.cc, create_view.cc) but there's no visible test directory for these critical tools. Generated code quality directly impacts new user experience, yet there are no tests validating output correctness, syntax, or consistency.

  • [ ] Create cmake/tests/drogon_ctl/ test directory with test fixtures
  • [ ] Add unit tests for create_controller.cc validating generated controller syntax and interface compliance
  • [ ] Add unit tests for create_model.cc validating generated ORM model code against database schema
  • [ ] Integrate tests into ParseAndAddDrogonTests.cmake and run in CI pipeline

Add FindBrotli.cmake to CMake discovery and document compression codec options

cmake_modules/ contains FindBrotli.cmake alongside other dependency finders (FindHiredis.cmake, FindMySQL.cmake, FindSQLite3.cmake), but config.example.json/yaml and CONTRIBUTING.md lack documentation on Brotli compression support. This leaves contributors uncertain about optional compression codecs and build configuration.

  • [ ] Document all supported compression codecs (gzip, brotli, deflate) in README.md with build instructions
  • [ ] Add codec configuration examples to config.example.json and config.example.yaml
  • [ ] Update CONTRIBUTING.md with optional dependency matrix (which cmake_modules are required vs optional)
  • [ ] Verify FindBrotli.cmake integration in CMakeLists.txt and add conditional feature detection tests

🌿Good first issues

  • Add CMake feature test for Brotli fallback; currently config.h doesn't define BROTLI_VERSION, causing silent compile errors when only runtime libbrotli is available—add cmake/tests/check_brotli_version.cc and update cmake/Packages.cmake.
  • Extend drogon_ctl to generate OpenAPI/Swagger schemas from route definitions (schema output in controllers/.swagger.json); many users need API docs but must write them manually.
  • Document Windows MSVC build prerequisites in a new WINDOWS_INSTALL.md with explicit vcpkg ports needed (openssl, sqlite3, postgresql-libpq) and expected CMake flags—currently only Linux/macOS documented.

Top contributors

Click to expand

📝Recent commits

Click to expand
  • 4c54307 — Bump version to 1.9.13 (an-tao)
  • db97309 — Update trantor (#2511) (an-tao)
  • 22e165d — vector: reserve before inserting (#2510) (kaili302)
  • 1875638 — Add HttpRequest::clearHeaders() to clear all headers efficiently (#2046) (#2506) (two-headBoy)
  • a922095 — Fix sqlite3 test failed in CI (#2508) (an-tao)
  • 71b72f0 — Fix HttpClient not sending WebDAV requests (#2507) (Lectem)
  • b1af64a — Add WebDAV HTTP methods (PROPFIND, MKCOL, COPY, MOVE) (#2505) (Lectem)
  • ef1f344 — Fix connection limit bug (#2503) (hwc0919)
  • 4c05658 — Fix the bugs exposed by CI (#2495) (an-tao)
  • fb41a64 — feat(orm): Add JOIN support to Mapper/BaseBuilder and FK auto-detection in code generator (#2491) (SBALAVIGNESH123)

🔒Security observations

The Drogon framework demonstrates a reasonably mature security posture with CI/CD pipelines (GitHub Actions), code quality tools (clang-format, CPPLINT), and multi-platform support. However, there are medium-severity risks related to potential SQL injection and XSS vulnerabilities in the ORM/templating layer that require careful code review. Configuration file examples and Docker security practices need hardening. Overall, as a framework project, security implementation depends on how developers use the framework and configure their applications. The framework should provide more explicit security guidance and defaults.

  • Medium · Potential SQL Injection Risk in ORM/Database Layer — drogon_ctl/create_model.cc, drogon_ctl/templates/model_*.csp. The presence of model generation tools (drogon_ctl/create_model.cc) and model templates suggests dynamic SQL query construction. Without visible parameterized query enforcement in the file structure, there is risk of SQL injection if user input is incorporated into database queries. Fix: Ensure all database queries use prepared statements and parameterized queries. Implement input validation and sanitization. Review ORM implementation for SQL injection vulnerabilities.
  • Medium · Potential XSS Vulnerability in View Templates — drogon_ctl/templates/*.csp files. Template files exist (.csp files) for view rendering. If user-controlled data is rendered without proper escaping/sanitization in these templates, XSS attacks are possible. Fix: Implement automatic HTML escaping by default in template engine. Use content security policies. Review template rendering for unsafe data handling. Ensure output encoding matches context (HTML, JavaScript, CSS, URL).
  • Medium · Exposed Configuration Files in Repository — config.example.json, config.example.yaml. Configuration examples (config.example.json, config.example.yaml) are present. While examples, actual production configurations might be committed with sensitive data like database passwords, API keys, or connection strings. Fix: Ensure actual configuration files are in .gitignore. Use environment variables for sensitive settings. Implement configuration validation. Document secure configuration practices. Scan git history for accidentally committed secrets.
  • Low · Docker Configuration Security — docker/alpine/Dockerfile, docker/arch/Dockerfile, docker/ubuntu/Dockerfile. Multiple Dockerfile configurations exist (Alpine, Arch, Ubuntu). Docker images may have security implications if base images are outdated, unnecessary packages installed, or running as root. Fix: Use minimal base images. Pin base image versions. Run containers as non-root user. Remove unnecessary packages. Implement multi-stage builds. Scan images for vulnerabilities using tools like Trivy.
  • Low · Missing Security Headers Configuration — config.example.json, config.example.yaml. While this is a framework repository, there's no visible documentation or default configuration for security headers (HSTS, X-Frame-Options, CSP, etc.) in the configuration examples. Fix: Document and provide examples for security header configuration. Include recommended headers: HSTS, X-Content-Type-Options, X-Frame-Options, Content-Security-Policy, etc.
  • Low · Dependency Management Clarity — conanfile.txt, CMakeLists.txt. No direct visibility of dependency versions in provided context. The use of conanfile.txt suggests Conan package manager, but pinned versions are not visible. Fix: Pin exact versions for all dependencies. Implement automated dependency scanning. Keep dependencies updated. Use Software Composition Analysis (SCA) tools.
  • Low · CPPLINT Configuration Present — CPPLINT.cfg. While code style checking (CPPLINT.cfg) is good practice, it doesn't enforce security checks specifically. Fix: Integrate static security analysis tools (cppcheck, clang-tidy, SonarQube) into CI/CD. Add security-focused linting rules.

LLM-derived; treat as a starting point, not a security audit.


Generated by RepoPilot. Verdict based on maintenance signals — see the live page for receipts. Re-run on a new commit to refresh.

Healthy signals · drogonframework/drogon — RepoPilot