{"id":20172268,"url":"https://github.com/apostoldevel/apostol","last_synced_at":"2025-04-10T02:51:47.518Z","repository":{"id":110915272,"uuid":"179836198","full_name":"apostoldevel/apostol","owner":"apostoldevel","description":"Apostol is a framework for developing server-side (backend) applications.","archived":false,"fork":false,"pushed_at":"2024-09-23T13:52:10.000Z","size":7858,"stargazers_count":6,"open_issues_count":0,"forks_count":1,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-03-24T04:22:01.576Z","etag":null,"topics":["backend","backend-development","backend-server","http","http-server","httpd","httpd-server","postgresql","rest","rest-api","restful","restful-api","restful-webservices","web-server","web-service"],"latest_commit_sha":null,"homepage":"https://apostoldevel.com","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/apostoldevel.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":"2019-04-06T13:22:38.000Z","updated_at":"2024-09-23T13:52:13.000Z","dependencies_parsed_at":"2023-07-08T05:02:26.102Z","dependency_job_id":"cf6f63e6-5bdf-42ca-9ab4-c5dba181ed92","html_url":"https://github.com/apostoldevel/apostol","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apostoldevel%2Fapostol","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apostoldevel%2Fapostol/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apostoldevel%2Fapostol/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apostoldevel%2Fapostol/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/apostoldevel","download_url":"https://codeload.github.com/apostoldevel/apostol/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248146975,"owners_count":21055453,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["backend","backend-development","backend-server","http","http-server","httpd","httpd-server","postgresql","rest","rest-api","restful","restful-api","restful-webservices","web-server","web-service"],"created_at":"2024-11-14T01:29:27.365Z","updated_at":"2025-04-10T02:51:47.478Z","avatar_url":"https://github.com/apostoldevel.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![ru](https://img.shields.io/badge/lang-ru-green.svg)](https://github.com/apostoldevel/apostol/blob/master/README.ru-RU.md)\n\n![image](https://github.com/apostoldevel/apostol/assets/91010417/cf0b289d-185f-4852-a9a9-cd953f4a7199)\n\n# Apostol\n\n**Apostol** is a framework for developing server applications (system services) on the Linux OS.\n\nDESCRIPTION\n-\nApostol is developed in the C++ programming language using an asynchronous programming model based on the [epoll API](https://man7.org/linux/man-pages/man7/epoll.7.html) with direct access to the [PostgreSQL](https://www.postgresql.org/) (via the `libpq` library) specifically for high-load systems.\n\nThe key element of the platform is the built-in HTTP server with direct access to the PostgreSQL DBMS.\n\nThe **uniqueness** of the solution lies in the fact that both the HTTP server and PostgreSQL sockets are within a single event processing loop, which allows data to be transmitted instantly from the HTTP server to the database. In other words, there are no intermediaries, typically represented by scripting languages, between the HTTP server and the database. This, in turn, allows database queries to be executed with maximum efficiency and minimal latency.\n\n* The main advantages:\n    * **Autonomy**: After building, you get a fully ready-to-use binary file in the form of a system service (daemon) under Linux OS;\n    * **Speed**: Queries to the HTTP server and the database are executed as fast as the operating system and DBMS allow;\n    * **Connection pool**: Apostol has its own customizable connection pool with [PostgreSQL](https://www.postgresql.org/).\n     \nMODULES\n-\n\nThe framework has a modular design, built-in HTTP server, and [PostgreSQL](https://www.postgresql.org/) client.\n\n### This build comes with two modules:\n\n- [WebServer](https://github.com/apostoldevel/module-WebServer) (Web server);\n    * Provides the [Swagger UI](https://swagger.io/tools/swagger-ui) which will be available at [http://localhost:8080](http://localhost:8080) in your browser after launching **Apostol**.\n\n\n- [PGFetch](https://github.com/apostoldevel/module-PGFetch) (Postgres Fetch);\n    * Enables receiving and sending `HTTP requests` in the `PL/pgSQL` programming language.\n  \n### With additional modules, Apostol can be turned into:\n\n- [AuthServer](https://github.com/apostoldevel/module-AuthServer) (Authorization server OAuth 2.0);\n- [AppServer](https://github.com/apostoldevel/module-AppServer) (Application server);\n- [MessageServer](https://github.com/apostoldevel/process-MessageServer) (Message server: SMTP/FCM/API);\n- [FileServer](https://github.com/apostoldevel/module-FileServer) (File server);\n- [Replication](https://github.com/apostoldevel/process-Replication) (Database replication);\n- [StreamServer](https://github.com/apostoldevel/process-StreamServer) (Streaming data server).\n\nApostol has built-in WebSocket support: [WebSocket API](https://github.com/apostoldevel/module-WebSocketAPI).\n\nCombining all the above, you can create an information system [CRM System](https://github.com/apostoldevel/apostol-crm), [Central system for charging points](https://github.com/apostoldevel/apostol-cs) or [Telegram bot on PL/pgSQL](https://github.com/apostoldevel/apostol-pgtg) why not ;-).\n\n_With Apostol your possibilities are only limited by your imagination._\n\nProjects\n-\n\nProjects implemented at **Apostol**:\n \n* [CopyFrog](https://copyfrog.ai) (AI-powered platform for creating unique images, Ad Copy, video creatives, marketing descriptions for products and services)\n* [OCPP CSS](https://ocpp-css.com) (Central System as Service for Charging Points)\n* [BitDeals](https://testnet.bitdeals.org) (Bitcoin payment processing service)\n* [Ship Safety ERP](https://ship-safety.ru) (ERP system for organization of production activities of the shipping company)\n* [PlugMe](https://plugme.ru) (CRM system for charging stations and owners of electric vehicles)\n* [DEBT Master](https://debt-master.ru) (A system for automating debt collection)\n\nDocker\n-\n\nYou can build an image yourself or get a ready-made one from Docker Hub:\n\n### Build\n\n~~~\ndocker build -t apostol .\n~~~\n\n### Get\n\n~~~\ndocker pull apostoldevel/apostol\n~~~\n### Run\n\nIf you built it yourself:\n~~~\ndocker run -d -p 8080:8080 -p 8081:8081 -p 5433:5432 --rm --name apostol apostol\n~~~\n\nIf you got a ready-made image:\n~~~\ndocker run -d -p 8080:8080 -p 8081:8081 -p 5433:5432 --rm --name apostol apostoldevel/apostol\n~~~\n\n[Swagger UI](https://github.com/swagger-api/swagger-ui) will be available at \u003chttp://localhost:8080\u003e or http://host-ip:8080 in your browser.\n\n[Pgweb](https://github.com/sosedoff/pgweb) is a web-based database explorer for PostgreSQL will be available at \u003chttp://localhost:8081\u003e or http://host-ip:8081 in your browser.\n\n\u003e Instead of pgweb, you can use any other tool for working with databases. PostgreSQL from the container will be available on port 5433.\n\nDIRECTORY STRUCTURE\n-\n    auto/                       contains scripts files\n    cmake-modules/              contains CMake modules files\n    conf/                       contains configuration files\n    src/                        contains source code files\n    ├─app/                      contains source code files: Apostol\n    ├─core/                     contains source code files: Apostol Core\n    ├─lib/                      contains source code files for libraries\n    | └─delphi/                 contains source code files for the library*: Delphi classes for C++\n    └─modules/                  contains source code files for add-ons (modules)\n    www/                        contains files for the website\n\nBUILD AND INSTALLATION\n-\nTo install **Apostol**, you will need:\n\n1. C++ compiler;\n2. [CMake](https://cmake.org) or an Integrated Development Environment (IDE) with [CMake](https://cmake.org) support;\n3. [libpq-dev](https://www.postgresql.org/download) library (libraries and headers for C language frontend development);\n4. [postgresql-server-dev-all](https://www.postgresql.org/download) library (libraries and headers for C language backend development).\n\n### Linux (Debian/Ubuntu)\n\nTo install the C++ compiler and necessary libraries on Ubuntu, run:\n~~~\nsudo apt-get install build-essential libssl-dev libcurl4-openssl-dev make cmake gcc g++\n~~~\n\n###### A detailed description of how to install C++, CMake, IDE, and other components required for the project build is not included in this guide.\n\n#### PostgreSQL\n\nTo install PostgreSQL, use the instructions at [this](https://www.postgresql.org/download/) link.\n\n#### Database\n\nTo install the database, you need to perform the following steps:\n\n1. Specify the name of the database in the db/sql/sets.conf file (by default: web)\n1. Specify the passwords for the DBMS users [libpq-pgpass](https://postgrespro.ru/docs/postgrespro/13/libpq-pgpass):\n   ~~~\n   $ sudo -iu postgres -H vim .pgpass\n   ~~~\n   ~~~\n   *:*:*:http:http\n   ~~~\n1. Specify in the configuration file /etc/postgresql/{version}/main/pg_hba.conf:\n   ~~~\n   # TYPE  DATABASE        USER            ADDRESS                 METHOD\n   local  web    http          md5\n   ~~~\n1. Apply the settings:\n   ~~~\n   $ sudo pg_ctlcluster \u003cversion\u003e main reload\n   ~~~   \n1. Execute:\n   ~~~\n   $ cd db/\n   $ ./install.sh --make\n   ~~~\n\n###### The --make parameter is required to install the database for the first time. After that, the installation script can be run without parameters or with the --install parameter.\n\nTo install **Apostol** (without Git), you need to:\n\n1. Download [Apostol](https://github.com/apostoldevel/apostol/archive/master.zip);\n2. Unpack it;\n3. Configure CMakeLists.txt (if necessary);\n4. Build and compile (see below).\n\nTo install Apostol using Git, execute:\n~~~\ngit clone https://github.com/apostoldevel/apostol.git\n~~~\n\n###### Build:\n~~~\ncd apostol\n./configure\n~~~\n\n###### Compilation and installation:\n~~~\ncd cmake-build-release\nmake\nsudo make install\n~~~\n\nBy default, the apostol binary will be installed in:\n~~~\n/usr/sbin\n~~~\n\nThe configuration file and files required for operation, depending on the installation option, will be located in:\n~~~\n/etc/apostol\nor\n~/apostol\n~~~\n\nLAUNCH\n-\n###### If `INSTALL_AS_ROOT` is set to ON.\n\n`apostol` is a Linux system service (daemon).\nTo manage `apostol`, use standard service management commands.\n\nTo launch `apostol`, execute:\n~~~\nsudo systemctl start apostol\n~~~\n\nTo check the status, execute:\n~~~\nsudo systemctl status apostol\n~~~\n\nThe result should be something like this:\n~~~\n● apostol.service - Apostol\n     Loaded: loaded (/etc/systemd/system/apostol.service; enabled; vendor preset: enabled)\n     Active: active (running) since Sat 2019-04-06 00:00:00 MSK; 3y ago\n    Process: 461158 ExecStartPre=/usr/bin/rm -f /run/apostol.pid (code=exited, status=0/SUCCESS)\n    Process: 461160 ExecStartPre=/usr/sbin/apostol -t (code=exited, status=0/SUCCESS)\n    Process: 461162 ExecStart=/usr/sbin/apostol (code=exited, status=0/SUCCESS)\n   Main PID: 461163 (apostol)\n      Tasks: 2 (limit: 77011)\n     Memory: 2.6M\n        CPU: 44ms\n     CGroup: /system.slice/apostol.service\n             ├─461163 apostol: master process /usr/sbin/apostol\n             └─461164 apostol: worker process (\"pq fetch\", \"web server\")\n~~~\n\nMANAGEMENT\n-\n\n`apostol` can be managed using signals.\nThe main process number is written by default to the `/run/apostol.pid` file.\nYou can change the name of this file during the build configuration or in the `apostol.conf` `[daemon]` section with the `pid` key.\n\nThe main process supports the following signals:\n\n|Signal   |Action            |\n|---------|------------------|\n|TERM, INT|fast shutdown     |\n|QUIT     |graceful shutdown |\n|HUP      |configuration change, launching new worker processes with new configuration, graceful shutdown of old worker processes|\n|WINCH    |graceful shutdown of worker processes|\n\nThere is no need to manage worker processes individually. Nevertheless, they also support some signals:\n\n|Signal   |Action            |\n|---------|------------------|\n|TERM, INT|fast shutdown     |\n|QUIT     |graceful shutdown |","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fapostoldevel%2Fapostol","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fapostoldevel%2Fapostol","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fapostoldevel%2Fapostol/lists"}