fpesa is a python3.5 and python3.6 compatible webapp that provides a restapi to save and receive messages and a websocket connection that receives live updates when a new message is saved.
It comes with a simple web frontend that allows to test the features described above.
For getting an overview of the whole project, see docs/overview.rst
Instructions are tested with debian 9.1.0
# as root
apt-get install git
git clone https://github.com/BenediktSeidl/fpesa.git
cd fpesa
Install docker according to the offical docker docs
# as root
apt-get install docker-compose
# grant access to docker for your personal user account
usermod -aG docker <your-developer-user>
# inside fpesa folder
docker-compose build # only needed for first run or for updating changed code
docker-compose up
fpesa-frontend-build
and fpesa-base
are ment to exit early.
Wait until the static files are build and fpesa-frontend-build exits, then open http://127.0.0.1:8099/
# as root
apt-get install python3 python-virtualenv postgresql rabbitmq-server nginx
# install nodejs
cd /tmp/
wget "https://nodejs.org/dist/v8.9.4/node-v8.9.4-linux-x64.tar.xz"
xz -d node-v8.9.4-linux-x64.tar.xz
tar -xf node-v8.9.4-linux-x64.tar
cd node-v8.9.4-linux-x64
cp -r {bin,include,lib,share} /usr/
# setup database for production and tests
su - postgres
psql
CREATE ROLE fpesa LOGIN PASSWORD 'fpesa';
CREATE DATABASE fpesa WITH OWNER = fpesa;
CREATE DATABASE fpesa_test WITH OWNER = fpesa;
\q
exit
# enable http api of rabbitmq for tests
rabbitmq-plugins enable rabbitmq_management
virtualenv --python=python3 v
source v/bin/activate
python setup.py develop
# running the tests to make sure everything works
pip install pytest requests
pytest tests
All commands shown in this section show the developing setup. For instructions on how to run the project in production see docker-compose.yml
When all Components are running you can access the frontend on http://127.0.0.1:8888/
cd frontend
npm install # only once and after changes on package.json
npm run dev
cd dev/nginx
./run.sh
./v/bin/fpesa -v liveupdate
./v/bin/fpesa -v restmapper
./v/bin/fpesa -v messages_post
./v/bin/fpesa -v messages_get --debug
source v/bin/activate
pip install -r docs/requirements.txt
sphinx-build docs docs/_build
# open docs/_build/index.html with your browser