Skip to content

Bookquest-projects/backend

Repository files navigation

backend

Project setup

Warning

This project requires Python 3.10.0 or higher.

![WARNING] This project requires Docker if you want to run the database locally.

Environment variables

Create a .env file in the root of the project with the following content:

SECRET_KEY="your_secret_key"

JWT_SECRET_KEY="your_jwt_secret"

DB_USER="sa"
DB_NAME="master"
SQLSERVER_PASS="abcDEF123#"
DB_HOST="localhost"
DEBUG="True"

ORIGIN="http://localhost:8080"

You can generate a secret key or a jwt secret key by running with Python:

python -c 'import os; print(os.urandom(16))'

Then copy the output and paste it in the .env file.

Database setup

To set up the database, run:

go to the database folder:

cd database
docker build -t database .

Then run the database container:

docker run -d -p 5432:5432 database

Backend setup

Return to the root of the project:

cd ..

Check your Python version:

python --version

If you have Python 3.10.0 or higher, you can continue with the setup, otherwise, you need to install the correct version.

To setup a virtual environment, run:

python -m venv venv

To install the dependencies, run:

pip install -r requirements.txt

Running the project

To start the project, run:

python bookquest/app/__init__.py

Linting

To check lint errors, run:

flake8 bookquest --format=pylint

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •