Skip to main content

General principles

Backend conventions (NestJS)

File naming

Module structure

Each feature module follows the same structure:

Controller pattern

Service pattern

Frontend conventions (React)

File naming

Component pattern

Page component pattern

Styling conventions

Tailwind classes

  • Use Tailwind utility classes exclusively
  • No custom CSS unless absolutely necessary
  • Use cn() utility for conditional classes:

shadcn/ui components

All UI primitives come from shadcn/ui. Do not create custom button, input, or table components; use the existing ones:

Error handling

Backend

  • Use NestJS exception filters for consistent error responses
  • Throw specific exceptions (NotFoundException, ForbiddenException)
  • Log errors with context using NestJS Logger

Frontend

  • Use React Query’s error state for API errors
  • Display errors via toast notifications (sonner)
  • Use Error Boundaries for component-level error isolation

Git conventions