Network Class Backend is a backend part of the Student-Labs-2023 project called Network Classroom, written based on the FastAPI web framework in Python 3.11.4.
In order to run the project, you need to run PostgreSQL locally:
- Download and install PostgreSQL versions 14.9
- When installing, you specify the password and port, remember them
- Next, you need to run pgAdmin 4 and connect to the server that you will have in the list
- Next, you need to download backup.sql, according to the following link.
- Next, you need to expand the tab Databases and right-click on the postgres database
- Next, select Restore and in the window that opens, next to the inscription Filename choose backup.sql
- Press the button Restore
- Make sure that you have added the necessary tables for testing
- You can start launching the project!
- Install the required Python version, namely Python 3.11.4
- Clone Repository
git clone -b develop-after-rebase https://github.com/Student-Labs-2023/network-class-backend
- Go to the root folder of the project
cd network-class-backend
- Install the necessary dependencies
pip install -r requirements.txt
- Create a .env file in the root of the project and put the following information there:
DB_HOST=localhost DB_PORT=5432 <- Here you specify the port that you specified during installation PostgreSQL DB_NAME=postgres DB_USER=postgres DB_PASS=postgres <- Here, instead of postgres, you specify the password that you specified during installation PostgreSQL
- To start the project, use the following command
gunicorn src.main:app --workers 4 --worker-class uvicorn.workers.UvicornWorker --bind=0.0.0.0:8000