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
strictsettings per projecttsconfig. - Formatting and lint (API) —
ethica-apiincludes 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 globalValidationPiperather 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-apiover 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.