3.0 KiB
3.0 KiB
Milestone 01 — Infrastructure and Database Foundation
Reference
Read plans/wedding-bootstrap-plan.md first. It is the source of truth for architecture, naming, schema intent, and constraints.
Goal
Create the local/runtime foundation for the app: dependencies, Docker Compose services, environment template, Kysely database client, SQL migration script, and initial schema.
Scope
Implement only:
- Required dependencies for PostgreSQL, Kysely, migrations, validation, auth/upload placeholders where needed.
docker-compose.ymlwith PostgreSQL and MinIO services, plus MinIO bucket initialization..env.examplewith all required bootstrap variables.- Typed config helper.
- Kysely PostgreSQL client.
- Node
.mjsSQL migration runner underscripts/. - Initial pure SQL migration for the core schema.
- Initial database typings, either hand-written or generated if practical.
- Package scripts needed to run migrations.
Non-goals
Do not implement:
- Google auth.
/adminpages.- shadcn UI setup unless strictly required by project initialization.
- Guest RSVP pages.
- MinIO upload endpoints.
- Presigned upload logic.
- Song/toast/message forms.
- Final visual design.
Required constraints
- Use PostgreSQL.
- Use Kysely. Do not add Prisma, Drizzle, TypeORM, Sequelize, or another ORM.
- Keep SQL schema aligned with
wedding-bootstrap-plan.md. invitations.languageis required from the first migration.invitation_members.attendingis the source of truth for attendance.- Do not duplicate attendance status on
invitation_responses. photo_uploads.invitation_idmust be unique to enforce one photo per invitation.
Implementation tasks
- Add dependencies:
kyselypgzodnanoid- AWS S3 packages if useful to install now
- Add dev dependencies:
@types/pg
kysely-codegenif used- Add
.env.example. - Add
docker-compose.ymlwith:postgresminiominio-init
- Add
lib/config.tsfor server-side env parsing. - Add
lib/db/client.ts. - Add
scripts/migrate-sql.mjs. - Add
migrations/0001_initial_schema.sql. - Add
lib/db/types.ts. - Add package scripts:
db:migrate- optionally
db:generateif usingkysely-codegen
Initial tables
Create:
invitationsinvitation_membersinvitation_responsesphoto_uploadssong_requeststoast_requestsguest_messages- optionally
admin_audit_events
Verification
Run:
docker compose up -d postgres minio minio-init
npm run db:migrate
npm run lint
npm run build
If Docker is unavailable in the execution environment, still implement the files and clearly report that Docker verification could not be run.
Acceptance criteria
- Docker Compose defines working PostgreSQL and MinIO services.
.env.exampledocuments all required variables.- Migrations create the planned schema.
- The Node
.mjsmigration script can run pure SQL files against PostgreSQL. - The app still passes lint/build.
- No future milestone features were implemented.