Summary
Set up robust database lifecycle management for the FlowFi backend, including Prisma migrations, optional seed data, and health checks that verify database connectivity.
Scope
- Ensure Prisma datasource is configured for Postgres and matches docker compose connection string.
- Add npm scripts to run:
- prisma generate for client generation.
- prisma migrate dev for local development.
- prisma migrate deploy for non development environments.
- Optionally add a seed script that inserts example users and streams.
- Extend health endpoint to:
- Execute a lightweight database query.
- Surface database status in the JSON response.
Acceptance Criteria
- Migrations run successfully against a fresh Postgres database.
- Local developers can seed example data with a documented command.
- Health endpoint returns unhealthy when the database is unreachable.
- Misconfigured DATABASE_URL leads to clear logs and non zero exit.
Summary
Set up robust database lifecycle management for the FlowFi backend, including Prisma migrations, optional seed data, and health checks that verify database connectivity.
Scope
Acceptance Criteria