Monorepo: Next.js frontend + Express API, Prisma/Postgres, Swagger docs, Storybook.
- apps/web — Next.js, Tailwind CSS, shadcn/ui, lucide-react, Storybook
src/features/<domain>/— feature UI grouped by business domain (auth,profile,wallet)src/components/ui/— base design-system primitives, seeDESIGN.mdsrc/components/guards/auth-guard.tsx— the single route guard mounted inapp/layout.tsx; redirects per-route based on sign-in/profile-completion/rolesrc/contexts/auth-context.tsx—AuthProvider/useAuth(), the shared signed-in user profile consumed by the guard, navbar, and feature components
- apps/api — Express, Prisma, PostgreSQL, Swagger (
swagger-jsdoc+swagger-ui-express)- Layers:
router/→controller/→service/→repository/. Validation (zod) lives in the controller; no separate DTO layer.
- Layers:
yarn install
# start Postgres in Docker
yarn db:create
# generate the Prisma client and push the schema
yarn db:generate
yarn db:push
# run everything (in separate terminals)
yarn api:dev # http://localhost:4000 (docs at /api-docs)
yarn web:dev # http://localhost:3000
yarn web:storybook # http://localhost:6006Copy each app's .env.example to .env before running it.
Add one file to each of apps/api/src/{router,controller,service,repository}
following the task.*.ts example, then register the router in
apps/api/src/routes.ts.
Shared types (e.g. API response shapes) go in apps/web/src/types/, one file per
resource, so components import them instead of redeclaring them.
See root package.json for the full list (lint, format, db:*, web:*, api:*).