- Vladislav Artiukhov (vartiukhov@constructor.university)
- Vladislav Naumkin (vnaumkin@constructor.university)
Here is the hosted website of the homework 6 on GitHub Pages: https://giga-chad-llc.github.io/Defendr/
First, install all dependancies via:
pip install fastapi bcrypt mysql-connector-python uvicorn python-dotenv
# Or if using Python3.10:
pip install -r ./requirements.txt
To start the server run make server
(see Makefile
), that will start the server on localhost:8000
(see server):
python -m server.server # uvicorn should be installed as shown above
In order to connect to the database adjust the server/.env
file to match the database parameters, e.g.:
# These params configured to match the database instance created via 'docker-compose.yaml'
# This env file is already set up on clamv server
DB_HOST=localhost
DB_PORT=3306
DB_USER=root
DB_PASSWORD=123
DB_DATABASE=defendr
Open index.html
and navigate to the dashboard panel to see the dashboard; insert some data and press the sumbit button.
There is a docker/docker-compose.yaml
file with MySQL and Adminer services. To start the services navigate to the root folder of the project and run the following:
docker-compose -f ./docker/docker-compose.yaml up
To populate the database with fake data use the script scripts/python/populate_data.py
, it order to execute the script run the following from the root directory:
# insure that the dependancies mentioned in 'requirements.txt' are satisfied
# (i.e. run `pip install -r ./requirements.txt`)
python -m scripts.python.populate_data