Implement Phase 1 foundation: monorepo, database, auth, CI#29
Merged
Conversation
Set up monorepo structure with packages/shared (Zod schemas, types, constants), apps/api (Fastify 5), and apps/web (Vite 6 + React 19). Configure TypeScript, ESLint 9 flat config, Prettier, and Vitest.
Define 6 Drizzle ORM tables (users, wines, bottles, tasting_notes, storage_locations, refresh_tokens) with indexes. Add FTS5 virtual table with sync triggers, migration runner, and seed script with ~50 wines, ~130 bottles, and sample tasting notes.
Implement buildServer() factory with CORS, Zod type provider, pino logging, and structured error handler. Add GET /api/health endpoint with graceful shutdown on SIGINT/SIGTERM.
Add @fastify/jwt plugin with access (15min) and refresh (7d) token namespaces. Implement login, refresh, and logout endpoints with bcrypt password verification, refresh token rotation, and reuse detection. Add requireAuth and requireAdmin middleware.
Configure CI pipeline with lint-and-typecheck, unit-tests, and functional-tests jobs running in parallel after lint passes. Add e2e-tests job with Playwright and coverage artifact uploads.
Add .env.example with all configuration variables documented. Update .gitignore for data/, .drizzle/, playwright artifacts. Rewrite README with quick start guide, test accounts, and available scripts reference.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Changes
GET /api/health), auth endpoints (login, refresh, logout).env.example, updated.gitignore, README with quick start guide and test accountsTest Plan
npm install && cp .env.example .env && npm run db:migrate && npm run db:seed && npm run devcurl http://localhost:3001/api/healthreturns{"status":"ok",...}curl -X POST http://localhost:3001/api/auth/login -H 'Content-Type: application/json' -d '{"email":"admin@cellarsync.local","password":"adminpassword1"}'returns tokenshttp://localhost:5173loads React app and shows API health statusnpm run lint && npm run typecheckpass with zero errors