Skip to content

Latest commit

 

History

History
36 lines (30 loc) · 2.68 KB

File metadata and controls

36 lines (30 loc) · 2.68 KB

Repository Guidelines

Project Structure & Module Organization

  • client/src contains the React front end (components, pages, hooks, contexts) wired through Vite aliases such as @/components.
  • server hosts the Express API, session/email integrations, and __tests__; server/routes.ts is the central entry point.
  • shared/schema.ts defines Drizzle ORM tables shared by both runtimes; keep DTO changes there.
  • migrations stores SQL artifacts generated by Drizzle, while docs holds product-facing documentation for reference.

Build, Test, and Development Commands

  • npm install installs both client and server dependencies in the monorepo workspace.
  • npm run dev boots the API (via tsx server/index.ts) and proxies the Vite client at http://localhost:3000.
  • npm run build outputs the Vite bundle and bundles the API with esbuild into dist/.
  • npm run start serves the production build from dist/index.js.
  • npm run db:push syncs Drizzle schema updates to the configured database.

Coding Style & Naming Conventions

  • TypeScript is required; use ES modules and 2-space indentation to match the existing codebase.
  • React components live in PascalCase files/directories (client/src/components/ProfileCard.tsx); hooks use the useThing prefix.
  • Tailwind utility classes drive styling; prefer composing via class-variance-authority helpers instead of inline strings where available.
  • Run npm run check before submitting to ensure the TypeScript compiler stays clean.

Testing Guidelines

  • Vitest is the test runner; place unit tests beside the runtime they exercise (server/__tests__/feature.test.ts).
  • Use the .test.ts suffix and mirror the module name (storage.test.ts covers storage.ts).
  • npm run test executes the suite headlessly; npm run test:watch supports TDD cycles.
  • Track coverage with npm run test:coverage, aiming to cover new API branches and critical UI interactions.

Commit & Pull Request Guidelines

  • Follow the short, descriptive style seen in history (Fix analytics route guard, Add Vitest infrastructure); prefer imperative mood and keep subjects under ~72 characters.
  • PRs should include a concise summary, testing evidence (npm run test, npm run dev smoke checks), and screenshots for UI-facing changes.
  • Highlight schema or migration changes and call out environment variables new contributors must set.

Environment & Data Setup

  • Copy .env.example to .env and set DATABASE_URL; local Postgres or Neon works.
  • After schema edits run npm run db:push, then seed development data with NODE_ENV=development tsx server/seed.ts.
  • Keep secrets out of commits and document any required third-party credentials in the PR description.