Stage 1: backend foundation (Postgres, sessions, accounts, OTel) #1
Reference in New Issue
Block a user
Delete Branch "feature/stage-1-backend-foundation"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Implements Stage 1 per PLAN.md.
backend, committed go-jet code + cmd/jetgen.CI: both go-unit and integration workflows green on the branch head. Session/account REST handlers deferred to Stage 6; OTLP/dashboards to Stage 11.
- internal/postgres: pgx-over-database/sql pool (otelsql), embedded goose migrations into schema 'backend', committed go-jet code + cmd/jetgen tool. - internal/account: durable accounts + unified telegram/email identities (UUIDv7 keys), find-or-create provisioning with unique-conflict handling. - internal/session: opaque 256-bit tokens stored as a SHA-256 hash, revoke-only (no TTL); write-through cache gating /readyz; store + service. - internal/telemetry: OTel tracer/meter providers (none/stdout) + request-timing middleware; internal/config gains Postgres + OTel env loading. - internal/server: /api/v1 {public,user,internal,admin} skeleton + X-User-ID middleware; /readyz checks DB ping + cache; main wires telemetry -> db+migrate -> warm cache -> server. - Tests: unit + integration (build tag 'integration', testcontainers postgres:17) for migrations, accounts, sessions, readyz; new integration.yaml. - Docs: ARCHITECTURE, TESTING, PLAN refinements, root + backend READMEs. Session/account REST handlers deferred to Stage 6 (gateway); OTLP + dashboards to Stage 11.