thenewboston-developers / thenewboston-Backend

API for thenewboston.
18 stars 10 forks source link

Project setup

SECTIONS

  1. Initial Project Setup
  2. Essential Developer Guidelines

Initial Project Setup

  1. Install Python version 3.10.13 and make sure it is being used in the following steps and later during development (it is recommended to use pyenv for Python versions management)

  2. Install Poetry

export PIP_REQUIRED_VERSION=24.2
pip install pip==${PIP_REQUIRED_VERSION} && \
pip install virtualenvwrapper && \
pip install poetry==1.8.3 && \
poetry config virtualenvs.path ${HOME}/.virtualenvs && \
poetry run pip install pip==${PIP_REQUIRED_VERSION}
  1. Clone the Repository
git clone https://github.com/thenewboston-developers/thenewboston-Backend.git
  1. Copy the settings templates into a new local directory:
mkdir -p local
cp thenewboston/project/settings/templates/settings.dev.py ./local/settings.dev.py
cp thenewboston/project/settings/templates/settings.unittests.py ./local/settings.unittests.py
  1. Install / upgrade docker as described at https://docs.docker.com/engine/install/
    
    # Known working versions described in the comments below 

docker --version # Docker version 26.0.1, build d260a54

(!!!) At least Docker Compose version v2.24.0 is required

docker compose version # Docker Compose version v2.26.1


6. Commands for setting up local environment. Run the following commands:

```bash
make run-dependencies  # Sets up the necessary Docker containers for Redis and PostgreSQL
make update            # Installs project dependencies, pre-commit and applies database migrations
  1. Fire Up the Server 🚀
make run-server       # Starts the Django development server
make run-celery       # Starts the Celery worker for background tasks and LLM chatbot
make run-celery-beat  # Starts the Celery Beat

Now you're all set! The backend is up and ready for action.

Essential Developer Guidelines

To contribute effectively, follow these guidelines: