Mobile-first PWA for inventory at a coffee shop (Shop + Storage unit). React + Node monorepo.
- apps/client – React (Vite) PWA, mobile-first
- apps/server – Node (Express) API, auth, inventory, images
- packages/shared – Shared TypeScript types
- Node 18+
- npm 7+ (or pnpm; use pnpm-workspace.yaml and pnpm scripts if you prefer)
npm install
# Edit apps/server/.env if needed (DATABASE_URL, SESSION_SECRET)
npm run db:generate -w server
npm run db:migrate -w server
npm run db:seed -w servernpm run dev- Client: http://localhost:5173 (proxies /api to server)
- Server: http://localhost:3000
Default admin after seed: see seed output (e.g. admin@example.com / password).
npm run build
npm run startServes API and static client on one host. Use HTTPS so "Add to Home Screen" works on iPhone.
- Build command (repo root):
npm install && npm run build - Start command (repo root):
npm start
The server runsprisma migrate deployautomatically beforenode dist/index.jsso new migrations (e.g. Shop tasks) apply on deploy. - Environment variables (required in the dashboard):
DATABASE_URL— Postgres connection stringJWT_SECRET— long random string (required in production for login)NODE_ENV—production
- If
prestart/prisma migrate deployfails, check deploy logs: usually missingDATABASE_URL, DB unreachable, or migration conflict. The real error appears above the genericnpm error Lifecycle script start failedline.