Paozhu logoPaozhu Docs
Documentation
START

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

repositorytext
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 executable

Request lifecycle

  1. Receive and parse

    The I/O coroutine pool reads bytes and parses HTTP/1.1 or HTTP/2.

  2. Route match

    Look up the registry generated into common/autocontrolmethod.hpp.

  3. Auth and pre-filter

    Routes with maskcode pass through route_auth_fn, then the pre-filter.

  4. Business logic

    Sync handlers run on worker threads; coroutine handlers stay on the coroutine path and use async_ APIs.

  5. 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.