Skip to content

Setup

Run docker compose up --build to start everything: Postgres 16, Redis, the Rails app (port 3000), the Python service (port 8000), and Redis Insight (port 5540). See Installation for first-run details.

For day-to-day development you’ll typically want to run the services in containers and iterate from the host.

Requirements: Python 3.14.

Terminal window
cd services
python3 -m venv ../.venv
../.venv/bin/pip install -r requirements.txt pytest-asyncio

Run the suite from services/ (the pyproject.toml sets pythonpath = ["src"]):

Terminal window
cd services
../.venv/bin/pytest -q

Inside the container:

Terminal window
docker exec -w /app brand_protect-python-1 python -m pytest -q

Requirements: Ruby 3.4, Bundler.

Terminal window
cd rails_web
bundle install
bin/rails db:prepare
bin/rails tailwindcss:build
bin/rails test

Inside the container:

Terminal window
docker exec brand_protect-rails-1 bin/rails test
Terminal window
cd docs
npm install

Preview with the dev server (background mode):

Terminal window
cd docs
astro dev --background
astro dev status
astro dev logs
astro dev stop

Copy .env.example to .env and set INTERNAL_API_TOKEN, RAILS_MASTER_KEY, and POSTGRES_PASSWORD (see Configuration). The services talk over PYTHON_API_URL / RAILS_API_URL; locally that means http://localhost:8000/api/v1 and http://localhost:3000.