Project overview & architecture
Understand paozhu through its layout, dual-pool model and request lifecycle.
Positioning
Paozhu is a C++20 web framework that provides HTTP/1.1, HTTP/2, WebSocket, ORM, annotation routing and ACME in one process. It supports CMake and xmake, with dependencies via vcpkg.json or system packages.
Layout
paozhu/
├── startup/ # main_dev / main_daemon / main_docker
├── controller/src/ # annotated controllers
├── common/ # generated route table
├── models/ orm/ # ORM business shells + generated layers
├── view/ viewsrc/ # templates and compiled views
├── conf/ # server.conf / orm.conf / acme.conf
├── www/default/ # static root
└── bin/paozhu # built executableRequest lifecycle
Receive and parse
The I/O coroutine pool reads bytes and parses HTTP/1.1 or HTTP/2.
Route match
Look up the registry generated into
common/autocontrolmethod.hpp.Auth and pre-filter
Routes with
maskcodepass throughroute_auth_fn, then the pre-filter.Business logic
Sync handlers run on worker threads; coroutine handlers stay on the coroutine path and use
async_APIs.Response
Return
client.output, JSON or a template view, then let the framework compress and send it.
Optional capabilities
PDF, Office, ZIP, SMS, payment and chart modules are enabled by CMake options and off by default. Check ENABLE_PDF, ENABLE_OFFICE and related flags before building.