Backend API for Midossi's digital library.
Download Python 3.10+ from the official site
Note
This project was developed using Python 3.10.2 and newer versions, and might not work with older versions
To clone the repository, use one of the following commands depending on whether the repository is public or private:
git clone https://github.com/Biblioteca-Midossi/BibliotecaBackend.gitUse GitHub Desktop or:
git clone git@github.com:Biblioteca-Midossi/BibliotecaFrontend.gitNote
Authentication with SSH is required for private repositories.
It is recommended to create a Python virtual environment:
python3 -m venv .venvActivate the virtual environment and install the dependencies:
# On Windows
.venv\Scripts\activate
# On Unix or Unix-like systems
source .venv/bin/activate
# Install dependencies (may not finish on windows because of hypercorn)
pip install -r requirements.txt- A PostgreSQL database
- A Redis database
Rename .env_template to .env and fill in the appropriate credentials.
On Unix-like systems (Linux, MacOS):
source start.sh [-<process manager abbreviation> | --<process manager>]Check
source start.sh --helpfor all the available process managers
On Windows:
uvicorn App:app --host 0.0.0.0 --port 8000Note
It is recommended to run the system on Unix-like systems for stability and for more control over it. In both cases, the API will listen to every IPv4 address available to the host on port 8000. To change that, you can use a specific IPv4 address instead of 0.0.0.0. You can also change the port it listens to, but remember to also change it on the frontend, if you're using it.