Magpie backend
Go to file
2023-12-08 19:26:16 -03:00
cmake first thoughts about database 2023-12-07 17:32:43 -03:00
database some primitive database stuff 2023-12-08 19:26:16 -03:00
request first thoughts about database 2023-12-07 17:32:43 -03:00
response first thoughts about database 2023-12-07 17:32:43 -03:00
server some primitive database stuff 2023-12-08 19:26:16 -03:00
stream Initial setup 2023-11-21 19:19:08 -03:00
CMakeLists.txt first thoughts about database 2023-12-07 17:32:43 -03:00
main.cpp first couple of requests 2023-11-23 16:57:32 -03:00
README.md Some details to readme 2023-11-29 20:25:12 -03:00

Pica - Backend for Megpie budgeting app

... some description

Prerequisites

  • fcgi
  • nlohmann_json

Building

$ git clone https://git.macaw.me/blue/pica
$ cd pica
$ mkdir build
$ cd build
$ cmake ..
$ cmake --build .

Usage

Webserver

First you need a webserver. In this example I'm going to use apache.

Install apache from your package manager.

Create a file like this in apache config dir (in my case it's /etc/httpd/conf/extra/fcgi-pica.conf)

<Location /pica>
    ProxyPass "unix:/run/pica/pica.sock|fcgi://localhost"
    ProxyPassReverse "http://localhost"
</Location>

Incude this file from apache config file (in my case it's /etc/httpd/conf/httpd.conf)

Include conf/extra/fcgi-pica.conf

Also you need to have 2 modules enabled proxy and proxy_fcgi, usually you need to uncomment following lines in /etc/httpd/conf/httpd.conf

LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_fcgi_module modules/mod_proxy_fcgi.so

In case you use debian-like distro (ubuntu) you should use a2enmod command instead:

# a2enmod proxy_fcgi

This should enable both modules, because module proxy_fcgi has module proxy as a dependency.

Start apache

$ sudo systemctl start httpd

Creating a directory

Next you need to create a directory for pica socket file

# mkdir /run/pica
# chown <your user> /run/pica

Running an app

At this stage we're redy to run an app

$ cd build
$ ./pica