Local Development
Infrastructure
To work properly, BOB requires a connection to both a database and Redis. The fastest way to achieve this is by building the Docker infrastructure. I recommend using the boilerplate-deploy
repository to set up the infrastructure locally.
You can use the infrastructure.yaml
file to create the full infrastructure for running BOB locally:
You can customize the .local.env
file to adjust any infrastructure-specific settings. Just modify it to your needs and rename it to .env
.
Docker Compose automatically loads the .env
file from the run directory and incorporates its values into the
Compose (YAML) file. You can reference these variables in the file using ${NAME_OF_VARIABLE_FROM_ENV}
.
Environment
You need to create a separate environment with Python version 3.11 or higher. I recommend using pyenv
:
This command creates a new virtual environment in the specified pyenv
location with the name bob
.
Clone the Git repository next to boilerplate-deploy
:
Use your package manager to install all requirements:
Start App
Now, in your IDE, load the environment into the interpreter. You should use _envs/local.env
from boilerplate-api
.
Add the following commands to your IDE run toolbar and test them:
- Running Tests
- Running API in Uvicorn
- Running Celery (Background Tasks)
- Running Celery Beat (Scheduled Tasks)