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
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. 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
C++ standard request c++20
asio openssl zlib brotli
Supports Linux MacOS Windows
>= Sequoiabrew install asio
brew install cmake
brew install openssl
brew install zlib
brew install brotli
Ubuntu>= 22.04 , test on Fedora38, need install asan(sudo yum install libasan)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
Supports install methods vcpkg and xmake
conf/server.conf replace /Users/hzq/paozhu path to your project pathpaozhu-main> xmake
paozhu-main> .\build\windows\x64\release\paozhu.exeInvoke-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 installInstall 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 DebugProject root unzip asio.zip or Download asio new version to project root part
|-vendor
|-CMakeLists.txt
|-asio
|-asio
|-asio.hppDirectory like this
mkdir build
cd build
cmake ..
makeUse in production environment,Compile as daemon
cmake .. -DCMAKE_BUILD_TYPE=Release
make -j8conf/server.conffile and getmainhostvaluesudo vim /etc/hostsAdd to the last line of the hosts file (if it is www.youdomain.com)
127.0.0.1 www.youdomain.comrun
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.
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.
ab -n 120000 -c 20 http://www.xxx.com h2load -n 12000 -c 100 -m 10 https://www.xxx.com ./webbench -c 300 -t 59 http://www.xxx.com/cms/list 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
…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
…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
…welcome to raise issues for mutual communication, and of course, we also welcome your active PR.
Paozhu is provided under the MIT License
No open issues yet, or sync has not completed.