feat: setup Next.js web project with Drizzle + PostgreSQL schema (#35) #42

Merged
maximus merged 7 commits from issue-35-web-setup into master 2026-04-06 16:58:05 +00:00
Owner

Fixes #35

Summary

  • Next.js App Router bootstrapped in web/ (TypeScript, Tailwind, standalone output)
  • Drizzle ORM pg-core schema: sl_lists, sl_tasks, sl_tags, sl_task_tags with userId, deletedAt, indexes
  • Database client (pg pool + drizzle), seed script (creates Inbox per user)
  • /api/health endpoint with DB latency check
  • Dockerfile for Coolify deployment
  • .env.example with DATABASE_URL and Logto placeholders

Not included (separate issues)

  • Logto app configuration (requires manual setup in Logto admin)
  • Actual migration generation (requires running DB)
Fixes #35 ## Summary - Next.js App Router bootstrapped in `web/` (TypeScript, Tailwind, standalone output) - Drizzle ORM `pg-core` schema: `sl_lists`, `sl_tasks`, `sl_tags`, `sl_task_tags` with `userId`, `deletedAt`, indexes - Database client (`pg` pool + drizzle), seed script (creates Inbox per user) - `/api/health` endpoint with DB latency check - Dockerfile for Coolify deployment - `.env.example` with DATABASE_URL and Logto placeholders ## Not included (separate issues) - Logto app configuration (requires manual setup in Logto admin) - Actual migration generation (requires running DB)
maximus added 1 commit 2026-04-06 15:03:55 +00:00
- Init Next.js App Router with TypeScript, Tailwind, standalone output
- Drizzle ORM pg-core schema (sl_lists, sl_tasks, sl_tags, sl_task_tags)
- Database client, seed script, drizzle.config
- Health endpoint (/api/health) with DB latency check
- Dockerfile for Coolify deployment
- .env.example with DATABASE_URL and Logto config placeholders

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Author
Owner

Review — APPROVE

Summary: Clean Next.js bootstrap with Drizzle pg-core schema matching the spec. Health endpoint, Dockerfile, and seed script all look good.

Checklist:

  • No secrets committed (.env.example has placeholders only)
  • .env* in .gitignore
  • Schema matches spec (userId, deletedAt, indexes)
  • TypeScript compiles
  • Health endpoint handles DB errors gracefully (503)
  • Dockerfile uses standalone output correctly

Note: slTasks.parentId self-reference FK not defined in Drizzle schema (limitation) — add via manual migration if needed.

## Review — APPROVE **Summary**: Clean Next.js bootstrap with Drizzle pg-core schema matching the spec. Health endpoint, Dockerfile, and seed script all look good. **Checklist**: - [x] No secrets committed (.env.example has placeholders only) - [x] .env* in .gitignore - [x] Schema matches spec (userId, deletedAt, indexes) - [x] TypeScript compiles - [x] Health endpoint handles DB errors gracefully (503) - [x] Dockerfile uses standalone output correctly **Note**: `slTasks.parentId` self-reference FK not defined in Drizzle schema (limitation) — add via manual migration if needed.
maximus added 2 commits 2026-04-06 15:38:47 +00:00
- Logto config matching la-compagnie-maximus pattern
- API routes: sign-in, callback, sign-out
- Next.js middleware protecting all routes except /auth and /api
- Auth helper to extract userId (sub) from Logto context
- Login page with Compte Maximus branding

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
maximus added 2 commits 2026-04-06 15:52:34 +00:00
- Lists, Tasks, Tags CRUD endpoints with soft-delete
- Sync endpoints (GET since + POST batch with idempotency keys)
- WS ticket endpoint (ephemeral nonce, 30s TTL, single use)
- Auth middleware on all endpoints via getAuthenticatedUser()
- BOLA prevention: userId check on every entity operation
- Zod strict schemas for input validation
- Filters and sorting on task listing

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
maximus added 2 commits 2026-04-06 16:07:03 +00:00
- Custom server (server.ts) wrapping Next.js + ws on same port
- Ticket-based auth: validates ephemeral nonce from /api/ws-ticket
- Origin validation against allowlist
- Session revalidation every 15 min (sends auth_expired, closes)
- Heartbeat every 30s (ping/pong, terminates dead connections)
- broadcastToUser() for API routes to notify connected clients
- Shared ticket store between API route and WS server via globalThis
- Health endpoint now reports active WS connections
- Dockerfile updated to use custom server

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
maximus merged commit f4df9bbfd0 into master 2026-04-06 16:58:05 +00:00
maximus deleted branch issue-35-web-setup 2026-04-06 16:58:05 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: maximus/simpl-liste#42
No description provided.