geovisualisierung/projects/project-3/backend
2021-01-26 17:28:14 +00:00
..
routers Fix IndexError when Bikepoint doesn't exist in historical data 2020-12-29 20:07:12 +01:00
.dockerignore Make project docker ready 2020-12-21 18:47:00 +01:00
.gitignore Update gitignore and requirements 2020-12-20 01:35:55 +01:00
api_database.py Fix IndexError when Bikepoint doesn't exist in historical data 2020-12-29 20:07:12 +01:00
api.py Activate strict CORS 2021-01-17 15:38:31 +00:00
db_init.py Fix stupid accident dataset (remove duplicates?!?!) 2020-12-22 02:26:58 +01:00
Dockerfile Make project docker ready 2020-12-21 18:47:00 +01:00
README.md Update README.md 2021-01-26 17:28:14 +00:00
requirements.txt Make project docker ready 2020-12-21 18:47:00 +01:00

Backend Project

1. Install requirements

pip3 install -r requirements.txt

2. Init database

To init the database it is required that you have at least python 3.7 installed.

Generate the database with

python3 db_init.py

Note: Import can be interrupted to resume it later!
Note: The importer outputs logs to the terminal, and the db_init.log file.

3. Start the backend

To start the backend, you first have to initialize the database!

Run with docker

Switch into the project directory, then run:

docker build -t geovis-backend .

After the build make sure you are in the same directory as "bike-data.db" resides, if so, run

docker run -v $(pwd):/app -p 8080:80 --restart always -d geovis-backend

Note: $(pwd) puts the current directory in the command, if you are on Windows, you can use WSL or provide the full path by typing it out.

To stop just shut down the container.