/monorepo
Backend

Backend Overview

Overview of the NestJS backend architecture.

The backend is built with NestJS, providing a modular, testable, and scalable architecture.

Structure

The apps/api/src directory is organized into logical modules:

  • app.module.ts: The root module that imports all other modules.
  • common/: Shared utilities, guards, decorators, and configuration that are used across the entire application.
  • auth/: Authentication logic (OIDC, Strategies, Guards).
  • user/: User management (profiles, updates).
  • role/: Role and permission management.
  • organization/: Multi-tenancy support (organizations/teams).
  • files/: File upload and management (S3 integration).
  • whitelabel/: Theming and whitelabel configuration.

Dependency Injection

We heavily utilize NestJS's dependency injection system. Services are injected into controllers and other services, making the code easy to test and maintain.

Configuration

Configuration is managed using @nestjs/config. Environment variables are loaded from .env files and validated using Joi or class-validator to ensure the application starts with a valid configuration.