client/: React + Vite app (components, hooks, pages, assets inclient/src/).server/: Express API (routes/,services/,db/,middleware/,storage/, tests inserver/__tests__/).shared/: Cross‑package TypeScript utilities used by both client and server.migrations/+drizzle.config.ts: Database schema and migration config.- Build output in
dist/; environment files:.env,.env.example,.env.test.
npm run dev: Start server with Vite dev client on port 5000 (configurable via PORT env).npm run build: Build client via Vite and bundle server todist/.npm start: Run production server fromdist/index.js.npm test: Run Jest tests (Node, TypeScript). Add--coveragefor report.npm run check: Type-check withtsc.- DB utilities:
npm run db:push|generate|migrate|studio|check(drizzle-kit).
- Language: TypeScript (strict mode, ESNext modules). Paths:
@/*→client/src/*,@shared/*→shared/*. - Indentation: 2 spaces; keep imports sorted logically; prefer explicit types on public APIs.
- React components: PascalCase files (e.g.,
UserProfileForm.tsx). Hooks:useX.ts(x). - Avoid introducing new patterns; mirror existing server/controller/service separation and client folder layout.
- Frameworks: Jest + ts-jest; Supertest for API; RTL for components; jsdom for browser APIs.
- Locations: Server tests in
server/__tests__/; client tests underclient/src/**/__tests__/. - Coverage targets (global): Lines 80%, Functions 75%, Branches 70%, Statements 80%.
- Commands:
npm test,npm run test:watch, or target a file:npm test -- server/__tests__/auth-workflow.test.ts.
- Commits: Short, imperative subject (e.g., "add streaming fetch to query client"). Group related changes.
- PRs: Clear description, linked issues, test plan, and screenshots/GIFs for UI changes. Note env or migration impacts.
- CI: Ensure tests pass locally; include coverage-sensitive changes where relevant.
- Do not commit secrets. Copy
.env.exampleto.envfor local dev. - Required keys include Stripe, Firebase, and PostHog; set webhook secret for
/api/webhook. - CORS is strict in prod; use
http://localhost:5173during dev. Web server runs onhttp://localhost:5000.