Skip to content

Database Setup

This app doesn’t run its own database locally — Postgres lives on Aiven, a managed hosting service. That’s true whether you’re developing in Codespaces or anywhere else: nothing here spins up a local Postgres container.

  1. Create a free/dev-tier Postgres service on Aiven.
  2. From its overview page, grab: host, port, user, password, and database name.
  3. Aiven requires an encrypted connection — the driver this app uses (psycopg) negotiates that automatically, nothing extra to configure.

Map what Aiven gives you directly onto these variables:

Aiven gives you Goes in
Host POSTGRES_SERVER
Port POSTGRES_PORT
Database name POSTGRES_DB
User POSTGRES_USER
Password POSTGRES_PASSWORD

On a brand-new database, tables don’t exist yet — run the migrations once:

Terminal window
cd backend
uv run alembic upgrade head

That also runs automatically as part of the container startup sequence (scripts/prestart.sh), so you’ll usually only need this manually if you’re running the backend outside Docker.

Not wired into the app yet — there’s no REDIS_* setting in app/core/config.py today. If a future feature needs it (caching, background jobs), it’ll get added the same way: an Aiven Redis service, credentials via Codespaces secrets, a new setting in config.py.