Skip to main content

Development environment

Prerequisites

  • Python 3.12+
  • Docker and Docker Compose

Packages installation

  1. Create a Python virtual environment (recommended)

  2. Install the dependencies with the following command:

pip install ".[api,playground,dev,test]"

Configuration

It is recommended to use a Python virtualenv.

  1. Create a config.yml file based on the example configuration file config.example.yml.
cp config.example.yml config.yml
  1. Create a env file based on the example environment file env.example
cp .env.example .env
  1. Comment host names variables like this (by default, they are set to localhost in compose.example.yml):
# POSTGRES_HOST=postgres
  1. Check the configuration documentation to configure your configuration file.

Launch services

Start services locally with the following command:

make dev
tip

This command will start the API and the playground services and support the following options:

make dev [service=api|playground|both] [env=.env] [compose=compose.yml] # service=both by default

For more information, run make help.

To run the services without make command, you can use the following commands:

  1. Export the environment variables:
  export $(grep -v '^#' .env | xargs) 
  1. Launch the API:
uvicorn api.main:app --log-level debug --reload

The API will be available at http://localhost:8000.

  1. Launch the Playground:
cd playground
reflex run --env dev --loglevel debug

The playground will be available at http://localhost:8501.