Clone the project
git clone https://github.com/Seven-Musketeers/backendGo to the project directory
cd backendInstall dependencies
We need poetry to install the dependencies and manage them. Refer to this link on how to install poetry.
After the installation, we need to activate the virtual environment. Run this command to activate it.
poetry shellThen finally install all the dependencies using this command.
poetry installEnvironment File Setup
Rename the .env.example file to .env to setup the environment file.
Setup Database
To setup the database, we need docker-compose. You can refer to this to install docker-compose on your system. If you already have postgres installed on your system, make sure to disable it first before running the command below.
After the installation of docker and docker-compose you can run this command to setup the database
docker-compose up -dThis will start the database up in the background.
Run Migrations Before starting the project for the first time we need to make migrations and run the migrate command to sync our database with the latest changes.
First, make the migration files using this command:
python manage.py makemigrationsThen, migrate the database using the migrations files by running this command:
python manage.py migrateStarting the Project After all the initial setup, we're now ready to start the project up. Run this command to start the project:
python manage.py runserver