This is the repository of the API of the Mangia Club App
First clone the repository:
$ git clone https://github.com/dgroh/mangia.club.git
Open a command line from the root folder of the project and create a python virtual environment.
From the root folder of the project inside the activated virtual environment create the following environment variables:
On Windows
set FLASK_APP=run.py
set FLASK_ENV=development
On Linux/Mac
set FLASK_APP=run.py
set FLASK_ENV=development
Also from the command line, install the project requirements:
$ pip install -r requirements.txt
The app uses MongoDB as default database and Redis for caching. To run them with the application run:
$ docker run --rm --name mangia-club-mongo -d -it -p 27017:27017 mongo:latest
$ docker run --rm --name mangia-club-redis -d -it -p 6379:6379 redis:latest
To use the Mongo-Cli to access the MongoDB instance of the application, run:
$ docker exec -it mangia-club-mongo mongo
To use the Redis-Cli to access the Redis instance of the application, run:
$ docker exec -it mangia-club-redis redis-cli
To start the API runs:
$ flask run
This will start the API on http://localhost:5000
To test the API you can use Postman
For generating the documentation based on the docstrings
we use pdoc
If a docstring
has been changed, run:
$ pdoc api --html -o docs --force
This will update the current index.html
© Copyright 2020, Daniel Groh. All Rights Reserved