Setup
The stack
Section titled “The stack”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.
Python service
Section titled “Python service”Requirements: Python 3.14.
cd servicespython3 -m venv ../.venv../.venv/bin/pip install -r requirements.txt pytest-asyncioRun the suite from services/ (the pyproject.toml sets pythonpath = ["src"]):
cd services../.venv/bin/pytest -qInside the container:
docker exec -w /app brand_protect-python-1 python -m pytest -qRails app
Section titled “Rails app”Requirements: Ruby 3.4, Bundler.
cd rails_webbundle installbin/rails db:preparebin/rails tailwindcss:buildbin/rails testInside the container:
docker exec brand_protect-rails-1 bin/rails testDocs site
Section titled “Docs site”cd docsnpm installPreview with the dev server (background mode):
cd docsastro dev --backgroundastro dev statusastro dev logsastro dev stopEnvironment
Section titled “Environment”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.