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.
Getting a database
Section titled “Getting a database”- Create a free/dev-tier Postgres service on Aiven.
- From its overview page, grab: host, port, user, password, and database name.
- Aiven requires an encrypted connection — the driver this app uses (
psycopg) negotiates that automatically, nothing extra to configure.
Wiring it into the app
Section titled “Wiring it into the app”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 |
First connection
Section titled “First connection”On a brand-new database, tables don’t exist yet — run the migrations once:
cd backenduv run alembic upgrade headThat 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.