Skip to content

m2b3/SciCommons-backend

Repository files navigation

Set up Guide

1. Create a Conda Environment

conda create -n <env_name> python=3.12.3

2. Activate the Conda Environment

conda activate <env_name>

3. Install the Required Libraries using poetry

poetry install

4. Create a .env and add the environment variables present in the .env.example file

touch .env
cp .env.example .env

5. Apply Database Migrations

poetry run python manage.py migrate

6. Run the Server

poetry run python manage.py runserver

7. Install Redis

Windows:

Useful Links:

Mac:

brew install redis

Linux (Ubuntu):

sudo apt update
sudo apt install redis-server

8. Run Celery Worker

(Before running Celery, make sure Redis is properly set up on your machine.)

Windows:

celery -A myapp worker --loglevel=info --concurrency=5 --pool=solo

Mac/Linux (Ubuntu):

celery -A myapp worker --loglevel=info --concurrency=5

Note: The --pool=solo flag is required on Windows but not necessary on Mac/Linux.

After installation, start Redis using:

redis-server

9. Run Docker locally

docker compose -f docker-composse.dev.yml up

# To run in detached mode:
docker compose -f docker-compose.dev.yml up -d

You can now access the server at http://localhost:8000/ and API documentation at http://localhost:8000/api/docs/.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 6