Coding conventions

Practical defaults for this monorepo. Extend with team agreements as needed.

Tooling

  • Yarn — use yarn / yarn <script> in each project directory (ethica-api, ethica-erp, customer-portal, etc.).
  • TypeScript — shared language across API and frontends; keep strict settings per project tsconfig.
  • Formatting and lint (API)ethica-api includes Prettier (yarn format) and ESLint (yarn lint). Run before large merges.

Backend (ethica-api)

  • NestJS — feature boundaries as modules; controllers thin, services hold domain logic.
  • Validation — DTOs with class-validator; rely on the global ValidationPipe rather than ad hoc checks.
  • Persistence — Sequelize models and migrations; no raw SQL in controllers unless justified and reviewed.

Frontends (Next.js)

  • App Router — prefer server components where data fetching and SEO matter; use client components for interactivity.
  • API access — call ethica-api over HTTPS; never connect to PostgreSQL from the browser.
  • Styling — Tailwind where already adopted; keep spacing and components consistent within each app.

Reviews

  • Keep PRs reviewable in size; align breaking API or schema changes with migrations and docs.
  • Link internal style guides here if they live outside this repository.