Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
P

paozhu

> 数据库
Open source

Paozhu C++ Web Framework,(Based on C++20) Support HTTP/1 HTTP/2, Rapid development of CRUD web applications, Include modules HttpServer HttpClient WebSocket O

662 stars0 likes2 views
WebsiteGitHub

About

Paozhu C++ Web Framework,(Based on C++20) Support HTTP/1 HTTP/2, Rapid development of CRUD web applications, Include modules HttpServer HttpClient WebSocket O

English | 简体中文

Paozhu(炮竹) is a full-stack, rapid development framework for the Web, Our slogan is "Born for rapid development of C++ Web", This framework integrates C++ ORM. The development speed is as fast as script languages. The framework integrates a webserver, which can natively parse HTTP/1.1 HTTP/2 JSON WebSocket protocols and GET and POST requests. The framework also distinguishes between different methods of POST requests. The framework comes with a built-in OBJ micro-object that can store data such as char, int, string, float, etc. The framework automatically parses URL and POST parameters into the micro-object, and uses URL path mapping to function mounting points. It also uses coroutines, thread pools, and database connection pools.

QQ GROUP 668296235

Discussing the joy of C++ web development with community developers.

1.Features

✅ 1. Supports json decode encode, not use thirdparty, support json standard
✅ 2. Supports multiple domain name websites, support SAAS tenants and themes
✅ 3. Supports multiple domain name ssl server
✅ 4. Supports http/1.1 and http/2 protocols
✅ 5. Supports WebSocket server and client, with duplex sending and receiving
✅ 6. The framework comes with WebSocket push, which supports regular push to WebSocket client
✅ 7. Supports httpclient GET and POST requests, in both synchronous and asynchronous modes
✅ 8. Built in ORM, supports MySQL PostgreSQL SQLite MariaDB supports both coroutine and synchronous modes
✅ 9. Framework has two thread pool,framework thread pool,user program runing thread pool
✅10. The framework uses asio Coroutines
✅11. The framework features that I/O uses the coroutine pool to run and thread pool to run
✅12. The framework supports compress gzip br out files
✅13. URL POST Upload Files. use client.get[] client.post[] client.files[] get
✅14. Integrated the SendMail library, supporting both synchronous and asynchronous modes
✅15. Supports generating QR codes, verification codes, and charts (in svg format)
✅16. Plugin module,Hot Module Replacement
✅17. The framework supports cache Module,ORM supports Result save to cache
✅18. The controller directory cpp files annotation auto pick to url mapping
✅19. Struct or class annotation to JSON Object, json_encode json_decode function
✅20. Support full demo admin backend, visit url /admin/main
✅21. Support PHP-FPM fastcgi running, which can replace Apache, allowing PHP programmers to smoothly transition to C++development mode
✅22. Built-in WeChat Mini Program payment function
✅23. Supports Socket server and client, supports SSL connection for Socket, facilitating IoT development
✅24. Supports both RPC server and client, using HTTP annotation URL functions
✅25. Traffic limiting, with a two-stage limit based on a 60-second moving average of traffic
✅26. Integrate ACME protocol to automatically renew SSL certificates and server-side OCSP stapling
✅27. Integrate zip file packaging and decompression
✅28. Simple Excel (xlsx) read-write support, simple conversion between Word (docx) and HTML
✅29. Built-in image generation and processing, supporting both JPG and PNG formats
✅30. Built-in HTML to PDF module webpdf

2.Runtime environment

C++ standard request c++20
asio openssl zlib brotli

Supports Linux MacOS Windows

3.Environment configuration

3.1 MacOS

  • system requirements
>= Sequoia
  • Install necessary dependencies
bash
brew install asio
brew install cmake
brew install openssl
brew install zlib
brew install brotli

3.2 Ubuntu && Fedora

  • system requirements
Ubuntu>= 22.04 , test on Fedora38, need install asan(sudo yum install libasan)
bash
sudo apt-get install cmake
sudo apt-get install -y brotli  libbrotli-dev zlib1g-dev
sudo apt-get install openssl libssl-dev
sudo apt-get install mysql-server
 
  • Environment configuration
    MacOS environment configuration
    Ubuntu environment configuration
    RockyLinux AlmaLinux environment configuration

3.3 Windows

Supports install methods vcpkg and xmake

  • xmake install Execute at the root directory of the project
    Config conf/server.conf replace /Users/hzq/paozhu path to your project path
paozhu-main> xmake
paozhu-main> .\build\windows\x64\release\paozhu.exe
  • vcpkg install
Invoke-WebRequest -OutFile vcpkg2023.zip https://github.com/microsoft/vcpkg/archive/refs/tags/2023.12.12.zip
            unzip vcpkg2023.zip
            cd vcpkg-2023.12.12
            bootstrap-vcpkg.bat
            vcpkg integrate install
            vcpkg integrate project
            vcpkg install

Install ninja https://github.com/ninja-build/ninja/releases

Compile project CMAKE_TOOLCHAIN_FILE is vcpkg install localtion path

unzip asio.zip
cmake . -B ${{github.workspace}} -DENABLE_WIN_VCPKG=ON -DENABLE_VCPKG=ON -DCMAKE_TOOLCHAIN_FILE=vcpkg-2023.12.12/scripts/buildsystems/vcpkg.cmake -DVCPKG_TARGET_TRIPLET=x64-windows -DCMAKE_BUILD_TYPE=Debug -G Ninja
cmake --build . --config Debug

4.Install

Project root unzip asio.zip or Download asio new version to project root part

bash
|-vendor
|-CMakeLists.txt
|-asio
  |-asio
  |-asio.hpp

Directory like this

bash
mkdir build
cd build
cmake ..
make

Use in production environment,Compile as daemon

bash
cmake .. -DCMAKE_BUILD_TYPE=Release
make -j8

5.hosts configuration

  • viewconf/server.conffile and getmainhostvalue
  • replace /Users/hzq/paozhu path to your project path
  • open host file
bash
sudo vim /etc/hosts

Add to the last line of the hosts file (if it is www.youdomain.com)

127.0.0.1 www.youdomain.com

6.https test

run

bash
sudo ./bin/paozhu 

open the browser and enter http://localhost or http://www.youdomain.com in the address bar

for more details, please see the source code under the controller directory, which includes CRUD examples.

7.Stress testing

Use h2load and ab testing, you must enable the cmake compilation option -DENABLE_BENCHMARK=ON, cmake .. -DCMAKE_BUILD_TYPE=Release -DENABLE_BENCHMARK=ON, Because the framework has enabled traffic limiting measures by default.

bash
 ab -n 120000 -c 20 http://www.xxx.com  
bash
 h2load -n 12000 -c 100 -m 10 https://www.xxx.com  
bash
 ./webbench -c 300 -t 59 http://www.xxx.com/cms/list  

8.1 Sample Hello world

In the controller/src directory of the project testhello.cpp file, It is recommended to place all business code entries in controller/src, as annotations will be automatically extracted for URL mapping, ORM automatically generates C++ entity code from the database, with no manual coding required.

…

C++ ORM Coroutines, URL request is completed throughout the entire coroutine function
From admin demo file controller/src/techempower.cpp

…

WebSocket Server and Client

The example file is demonstrated on the server side in websockets/loopwebsockets.hpp

…

The example file is demonstrated in the client at controller/src/test_websocket_handle.cpp

…

Socket Server and Client

The instance file is demonstrated on the server side of the Socket in controller/src/sockets/my_test_socket.hpp

…

The instance file is in the controller/src/test_socket_handle.cpp for the Socket client demonstration

…

9.Related tutorial

  • Paozhu docs

10.Roadmap

  • 1.Improved HTTP features
  • 2.HttpClient Improved
  • 3.HTTP/2 client

11.Contribute

welcome to raise issues for mutual communication, and of course, we also welcome your active PR.

12.LICENSE

Paozhu is provided under the MIT License

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

C++http-clienthttp-serverhttp2-serverorm

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 17, 2026
Category数据库
PricingOpen source

> Related tools

P
PostgreSQL
功能强大的开源关系型数据库
R
Redis
内存数据结构存储,常用作缓存与队列
M
MySQL
广泛使用的开源关系型数据库