{"id":21037679,"url":"https://github.com/xujintao/ratel","last_synced_at":"2026-05-22T07:11:20.323Z","repository":{"id":237393386,"uuid":"113154949","full_name":"xujintao/ratel","owner":"xujintao","description":"a c/c++ fastcgi based server","archived":false,"fork":false,"pushed_at":"2018-02-03T11:17:25.000Z","size":291,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-13T20:42:59.446Z","etag":null,"topics":["boost-libraries","cpp17","docker","fastcgi","jsoncpp","travis-ci"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/xujintao.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-12-05T08:33:44.000Z","updated_at":"2018-01-23T06:55:57.000Z","dependencies_parsed_at":"2024-05-01T07:53:25.832Z","dependency_job_id":"bb9b2b07-9402-435d-9e00-f9d7f2d68366","html_url":"https://github.com/xujintao/ratel","commit_stats":null,"previous_names":["xujintao/ratel"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/xujintao/ratel","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xujintao%2Fratel","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xujintao%2Fratel/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xujintao%2Fratel/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xujintao%2Fratel/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/xujintao","download_url":"https://codeload.github.com/xujintao/ratel/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xujintao%2Fratel/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33333417,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-21T12:23:38.849Z","status":"online","status_checked_at":"2026-05-22T02:00:06.671Z","response_time":265,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["boost-libraries","cpp17","docker","fastcgi","jsoncpp","travis-ci"],"created_at":"2024-11-19T13:27:31.100Z","updated_at":"2026-05-22T07:11:20.283Z","avatar_url":"https://github.com/xujintao.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Build Status](https://travis-ci.org/xujintao/ratel.svg?branch=master)](https://travis-ci.org/xujintao/ratel)\n\nRatel is a api server solution using c/c++:sunglasses:. It is based on spawn-fcgi, fastcgi, fastcgi++, boost and many other libraries which can achieve through github.  \n![](https://github.com/xujintao/ratel/blob/master/ratel.png)\n\n## Library\n\n* [spawn-fcgi](https://github.com/lighttpd/spawn-fcgi)  \nratel/app fork process via spawn-fcgi.\n\n* [fcgi or fastcgi](https://github.com/LuaDist/fcgi)  \nA blocking fastcgi based network library. Because of the feature of blocking, Ratel discard, and here just take it to compare with the next non-blocking network library.\n\n* [fastcgi++](https://github.com/eddic/fastcgipp)  \nA non-blocking fastcgi based network library with c++14, which means our compiler must be support c++14. One receiver-thread(as producer) accept request asynchronously, \nand push all request to a container which other multi-thread(act as consumer) pull from and handle.\n\n* log  \n1.The log module in ratel is based on [boost.log](http://www.boost.org/doc/libs/1_54_0/libs/log/doc/html/index.html), and version must be at least 1.54.0.  \n2.Instead of verboss \"\u003c\u003c\", it use printf-style syntax:sunglasses:, which means we can log like this:  \n```\nLog(info, \"Num:%d, note:%s\", 1, \"log here\");\n```\n\n* [jsoncpp](https://github.com/open-source-parsers/jsoncpp)  \nBefore jsoncpp, i tried [boost.ptree](http://www.boost.org/doc/libs/1_54_0/doc/html/property_tree.html) and [rapidJson](https://github.com/Tencent/rapidjson). \nHowever boost.ptree [does not conform to JSON standard](https://svn.boost.org/trac10/ticket/9721#no2) and rapidJson is extremely clunky to use. As for jsoncpp, \nthe fact that [Serialize UTF-8 string with Unicode escapes #687](https://github.com/open-source-parsers/jsoncpp/pull/687) since v1.8.4 seems to be useless:disappointed_relieved:. \nSo, here i will stay with v1.8.3 until it makes some change.\n\n* mysqlwrapper  \nA [mysql-connector](https://github.com/mysql/mysql-connector-cpp) based sql wrapper which makes mysql easier to use.  \n\n## Quick start\nOn Ubuntu 14.04, start with the following steps:\n```sh\n# 1. Add toolchain repo:\n$ sudo apt-add-repository \"ppa:ubuntu-toolchain-r/test\"\n$ sudo apt-get update\n\n# 2. Install toolchain\n$ sudo apt-get install gcc-7 g++-7\n\n# 3. Enable gcc7:\n$ sudo ln -s /usr/bin/gcc-7 /usr/bin/gcc -f\n$ sudo ln -s /usr/bin/g++-7 /usr/bin/g++ -f\n\n# 4. The default boost repo version on ubuntu 14.04 is 1.54.0:\n$ sudo apt-get install libboost-log1.54-dev \\\n                       libboost-system1.54-dev \\\n                       libboost-thread1.54-dev \\\n                       libboost-filesystem1.54-dev\n\n# 5. Install mysql-connector-c++\n$ wget https://dev.mysql.com/get/Downloads/Connector-C++/mysql-connector-c++-1.1.9-linux-ubuntu14.04-x86-64bit.tar.gz\n$ tar -xzvf mysql-connector-c++-1.1.9-linux-ubuntu14.04-x86-64bit.tar.gz\n$ sudo cp -drf mysql-connector-c++-1.1.9-linux-ubuntu14.04-x86-64bit/lib/* /usr/lib\n```\n\nIf CentOS7.4, you can get started in five steps:  \n```sh\n# 1. Install a package with repository for your system:\n$ sudo yum install centos-release-scl-rh\n\n# 2. Install the collection:\n$ sudo yum install devtoolset-7-gcc devtoolset-7-gcc-c++ devtoolset-7-gdb\n\n# 3. Start using software collections:\n$ source /opt/rh/devtoolset-7/enable\n\n# 4. The default boost from yum on centos7.4 is 1.53.0, we have to download 1.54.0 and build.\n$ cd ~\n$ wget -q https://sourceforge.net/projects/boost/files/boost/1.54.0/boost_1_54_0.tar.gz\n$ tar -xzf boost_1_54_0.tar.gz\n$ cd boost_1_54_0\n$ ./bootstrap.sh\n$ ./b2 --with-log --with-thread --with-system --with-filesystem\n$ sudo cp -drf boost /usr/include\n$ sudo cp -drf stage/lib/* /usr/lib64\n\n# 5. Install mysql-connector-c++\n$ wget https://dev.mysql.com/get/Downloads/Connector-C++/mysql-connector-c++-1.1.9-linux-el7-x86-64bit.tar.gz\n$ tar -xzvf mysql-connector-c++-1.1.9-linux-el7-x86-64bit.tar.gz\n$ sudo cp -drf mysql-connector-c++-1.1.9-linux-el7-x86-64bit/lib/* /usr/lib64\n```\n\nThen, clone and make like this:  \n```sh\n$ git clone https://github.com/xujintao/ratel\n$ cd ratel\n$ ./build.sh\n$ ./restart.sh\n```\n\nNow, it should be running well locally. Next we will show how to deploy it to field server by travis-ci.\n\n## Deploy\n![](https://github.com/xujintao/ratel/blob/master/deploy.png)\n1. Travis-CI git ratel project clone from github, building with the help of [docker4cpp](https://github.com/xujintao/docker4cpp) container, \nand then package all the result directely to test/product server or build runtime images to docker hub.  \n\n2. c++ runtime \n\n| runtime | CentOS7.4 | ubuntu14.04 |\n| ------  | --------- | ----------- |\n| libc | /usr/lib64/libc-2.17.so (2012.12.25) | /lib/x86_64-linux-gnu/libc-2.19.so (2014.2.7) |\n| libstdc++(c++11) | /usr/lib64/libstdc++.so.6.0.19 (2014.5.22) | /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.19 (2014.5.22) |\n| libstdc++(c++17) | /opt/rh/devtoolset-7/.../x86_64-redhat-linux/7/* (2017-12-25) | /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.24 (2017.8.20) | \n\u003e [GCC Development Plan](https://gcc.gnu.org/develop.html)  \n\u003e [ABI Policy and Guidelines](https://gcc.gnu.org/onlinedocs/libstdc++/manual/abi.html)  \n\n## License\n\n[MIT](https://github.com/xujintao/ratel/blob/master/LICENSE)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxujintao%2Fratel","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxujintao%2Fratel","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxujintao%2Fratel/lists"}