explaingit

drogonframework/drogon

13,879C++Audience · developerComplexity · 4/5Setup · hard

TLDR

Drogon is a high-performance C++17/20 web framework for building HTTP APIs and web applications, with async I/O, WebSocket support, built-in database access to PostgreSQL, MySQL, SQLite, and Redis, and a templating system, targeting low-latency server workloads.

Mindmap

mindmap
  root((Drogon))
    What it does
      HTTP web framework
      REST API server
      High performance
    Features
      WebSocket support
      HTTPS and compression
      Session management
    Databases
      PostgreSQL async
      MySQL async
      SQLite and Redis
    Developer Tools
      Built-in ORM
      Template engine
      CLI code generator
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Things people build with this

USE CASE 1

Build a high-throughput REST API in C++ that handles thousands of concurrent connections with low latency, outperforming scripting-language frameworks.

USE CASE 2

Create a web application with server-side HTML templates that embed C++ logic, compiled automatically by the framework.

USE CASE 3

Add async database access to a C++ service using Drogon's built-in ORM for PostgreSQL or MySQL without a separate ORM library.

Tech stack

C++C++17PostgreSQLMySQLSQLiteRedis

Getting it running

Difficulty · hard Time to first run · 1h+

Requires a C++17 compiler, CMake build system, and a database server, no binary packages, must compile from source.

In plain English

Drogon is a web server framework written in C++17/20. It lets you build HTTP-based applications and REST APIs in C++, running on Linux, macOS, Windows, and several BSD variants. The name comes from a dragon in the TV series Game of Thrones. The framework is built around non-blocking I/O and asynchronous processing, meaning it handles many requests at once without dedicating a separate thread to each connection. This design targets high throughput and low latency, and the project references TechEmpower benchmark results to illustrate its performance compared to other frameworks. On the feature side, Drogon supports HTTPS, WebSocket connections, JSON request and response handling, file upload and download, gzip and brotli compression, and built-in session management with cookies. It has a routing system that maps URL paths to controller classes, and a filter chain mechanism that lets you run shared checks (such as login verification) before requests reach their handlers. There is also a server-side templating system that embeds C++ code into HTML pages, with the framework compiling those templates automatically. Database access is built in. Drogon can connect to PostgreSQL and MySQL asynchronously, SQLite3 via a thread pool, and Redis for caching. It includes a lightweight ORM so you can work with database rows as C++ objects. A command-line tool called drogon_ctl generates controller and view skeleton files so you spend less time writing boilerplate. The typical Drogon application main function is just a few lines: configure the port and thread count, optionally load a JSON config file, and call run(). Controller logic lives in separate classes, and routing is declared via macros or the config file rather than crowding the startup code.

Copy-paste prompts

Prompt 1
Show me how to create a minimal Drogon REST API in C++17 with two endpoints: GET /users that returns a JSON list from PostgreSQL, and POST /users that inserts a row.
Prompt 2
I want to add JWT authentication to a Drogon app using a filter that runs before every protected route. Write the filter class and show how to register it in the config file.
Prompt 3
Help me set up Drogon's CMake build system and a Docker container that compiles and runs a Drogon app with a PostgreSQL connection, I am new to C++ web development.
Open on GitHub → Explain another repo

← drogonframework on gitmyhub — every repo by this author, as a profile.

Verify against the repo before relying on details.