# elia-epita/students-app architecture

> Architecture diagram of the GitHub repository elia-epita/students-app, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-12). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/elia-epita/students-app
- Repository: https://github.com/elia-epita/students-app

## Overview

This is a NestJS students API: HTTP clients call student CRUD endpoints, which delegate to a service that loads and persists students and courses; the service also records recommendation events. Bootstrap configures global request handling and API reference docs, while application modules configure persistence and common request protections. The README is a generic NestJS starter description and does not document further product capabilities. Edges reflect shown calls and registrations; unsampled integrations are omitted.

Main entry points: [`src/main.ts`](https://github.com/elia-epita/students-app/blob/main/src/main.ts) (HTTP bootstrap), [`src/app.module.ts`](https://github.com/elia-epita/students-app/blob/main/src/app.module.ts) (Application module), [`src/students/students.module.ts`](https://github.com/elia-epita/students-app/blob/main/src/students/students.module.ts) (Students module), [`src/students/students.controller.ts`](https://github.com/elia-epita/students-app/blob/main/src/students/students.controller.ts) (Students controller)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["API and bootstrap"]
  node_bootstrap["HTTP bootstrap<br/>[main.ts]"]
  node_app_module["Application module<br/>[app.module.ts]"]
  node_app_controller["Root controller<br/>[app.controller.ts]"]
  node_app_service["Greeting service<br/>[app.service.ts]"]
end

subgraph group_students["Student domain"]
  node_students_module["Students module<br/>[students.module.ts]"]
  node_students_controller["Students controller"]
  node_students_service["Students service"]
  node_create_dto["Create DTO"]
  node_update_dto["Update DTO"]
  node_pagination_dto["Pagination DTO"]
end

subgraph group_crosscut["Request cross-cutting"]
  node_common_module["Common module<br/>[common.module.ts]"]
  node_api_guard["API key guard<br/>[api-key.guard.ts]"]
  node_public_decorator["Public decorator"]
  node_logging_middleware["Logging middleware"]
  node_exception_filter["Exception filter"]
  node_wrap_interceptor["Response wrapper"]
  node_timeout_interceptor["Timeout interceptor"]
  node_parse_pipe["Integer parse pipe<br/>[parse-int.pipe.ts]"]
end

subgraph group_persistence["Persistence"]
  node_student_entity["Student entity<br/>[student.entity.ts]"]
  node_course_entity["Course entity<br/>[course.entity.ts]"]
  node_event_entity["Event entity<br/>[event.entity.ts]"]
  node_postgres[("PostgreSQL")]
end

node_client(("HTTP client"))

node_client -->|"sends requests"| node_bootstrap
node_bootstrap -->|"creates app"| node_app_module
node_bootstrap -->|"registers filter"| node_exception_filter
node_bootstrap -->|"registers interceptor"| node_wrap_interceptor
node_bootstrap -->|"registers interceptor"| node_timeout_interceptor
node_bootstrap -->|"serves API docs"| node_client
node_app_module -->|"registers"| node_app_controller
node_app_module -->|"provides"| node_app_service
node_app_module -->|"imports"| node_students_module
node_app_module -->|"imports"| node_common_module
node_app_module -->|"configures connection"| node_postgres
node_app_controller -->|"calls greeting"| node_app_service
node_students_module -->|"registers"| node_students_controller
node_students_module -->|"provides"| node_students_service
node_students_module -->|"registers entity"| node_student_entity
node_students_module -->|"registers entity"| node_course_entity
node_students_module -->|"registers entity"| node_event_entity
node_students_controller -->|"delegates requests"| node_students_service
node_students_controller -->|"accepts input"| node_create_dto
node_students_controller -->|"accepts input"| node_update_dto
node_students_controller -->|"accepts query"| node_pagination_dto
node_students_controller -->|"parses ID"| node_parse_pipe
node_students_service -->|"loads and saves"| node_student_entity
node_students_service -->|"looks up courses"| node_course_entity
node_students_service -->|"creates event"| node_event_entity
node_students_service -->|"persists records"| node_postgres
node_student_entity -->|"relates courses"| node_course_entity
node_course_entity -->|"relates students"| node_student_entity
node_common_module -->|"registers global guard"| node_api_guard
node_common_module -->|"applies middleware"| node_logging_middleware
node_api_guard -->|"checks metadata"| node_public_decorator
node_update_dto -->|"reuses fields"| node_create_dto

click node_bootstrap "https://github.com/elia-epita/students-app/blob/main/src/main.ts"
click node_app_module "https://github.com/elia-epita/students-app/blob/main/src/app.module.ts"
click node_app_controller "https://github.com/elia-epita/students-app/blob/main/src/app.controller.ts"
click node_app_service "https://github.com/elia-epita/students-app/blob/main/src/app.service.ts"
click node_students_module "https://github.com/elia-epita/students-app/blob/main/src/students/students.module.ts"
click node_students_controller "https://github.com/elia-epita/students-app/blob/main/src/students/students.controller.ts"
click node_students_service "https://github.com/elia-epita/students-app/blob/main/src/students/students.service.ts"
click node_create_dto "https://github.com/elia-epita/students-app/blob/main/src/students/dto/create-student.dto.ts"
click node_update_dto "https://github.com/elia-epita/students-app/blob/main/src/students/dto/update-student.dto.ts"
click node_pagination_dto "https://github.com/elia-epita/students-app/blob/main/src/students/dto/pagination-query.dto.ts"
click node_student_entity "https://github.com/elia-epita/students-app/blob/main/src/students/entites/student.entity.ts"
click node_course_entity "https://github.com/elia-epita/students-app/blob/main/src/students/entites/course.entity.ts"
click node_event_entity "https://github.com/elia-epita/students-app/blob/main/src/events/entities/event.entity.ts"
click node_common_module "https://github.com/elia-epita/students-app/blob/main/src/common/common.module.ts"
click node_api_guard "https://github.com/elia-epita/students-app/blob/main/src/common/guards/api-key.guard.ts"
click node_public_decorator "https://github.com/elia-epita/students-app/blob/main/src/common/decorators/public.decorator.ts"
click node_logging_middleware "https://github.com/elia-epita/students-app/blob/main/src/common/middleware/logging.middleware.ts"
click node_exception_filter "https://github.com/elia-epita/students-app/blob/main/src/common/filters/http-exception.filter.ts"
click node_wrap_interceptor "https://github.com/elia-epita/students-app/blob/main/src/common/interceptors/wrap-response.interceptor.ts"
click node_timeout_interceptor "https://github.com/elia-epita/students-app/blob/main/src/common/interceptors/timeout.interceptor.ts"
click node_parse_pipe "https://github.com/elia-epita/students-app/blob/main/src/common/pipes/parse-int.pipe.ts"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_bootstrap,node_app_module,node_app_controller,node_app_service,node_client toneBlue
class node_students_module,node_students_controller,node_students_service,node_create_dto,node_update_dto,node_pagination_dto toneAmber
class node_common_module,node_api_guard,node_public_decorator,node_logging_middleware,node_exception_filter,node_wrap_interceptor,node_timeout_interceptor,node_parse_pipe toneMint
class node_student_entity,node_course_entity,node_event_entity,node_postgres toneRose
```

## Components

### API and bootstrap

- [HTTP bootstrap](https://github.com/elia-epita/students-app/blob/main/src/main.ts): `src/main.ts`
- [Application module](https://github.com/elia-epita/students-app/blob/main/src/app.module.ts): `src/app.module.ts`
- [Root controller](https://github.com/elia-epita/students-app/blob/main/src/app.controller.ts): `src/app.controller.ts`
- [Greeting service](https://github.com/elia-epita/students-app/blob/main/src/app.service.ts): `src/app.service.ts`

### Student domain

- [Students module](https://github.com/elia-epita/students-app/blob/main/src/students/students.module.ts): `src/students/students.module.ts`
- [Students controller](https://github.com/elia-epita/students-app/blob/main/src/students/students.controller.ts): `src/students/students.controller.ts`
- [Students service](https://github.com/elia-epita/students-app/blob/main/src/students/students.service.ts): `src/students/students.service.ts`
- [Create DTO](https://github.com/elia-epita/students-app/blob/main/src/students/dto/create-student.dto.ts): `src/students/dto/create-student.dto.ts`
- [Update DTO](https://github.com/elia-epita/students-app/blob/main/src/students/dto/update-student.dto.ts): `src/students/dto/update-student.dto.ts`
- [Pagination DTO](https://github.com/elia-epita/students-app/blob/main/src/students/dto/pagination-query.dto.ts): `src/students/dto/pagination-query.dto.ts`

### Request cross-cutting

- [Common module](https://github.com/elia-epita/students-app/blob/main/src/common/common.module.ts): `src/common/common.module.ts`
- [API key guard](https://github.com/elia-epita/students-app/blob/main/src/common/guards/api-key.guard.ts): `src/common/guards/api-key.guard.ts`
- [Public decorator](https://github.com/elia-epita/students-app/blob/main/src/common/decorators/public.decorator.ts): `src/common/decorators/public.decorator.ts`
- [Logging middleware](https://github.com/elia-epita/students-app/blob/main/src/common/middleware/logging.middleware.ts): `src/common/middleware/logging.middleware.ts`
- [Exception filter](https://github.com/elia-epita/students-app/blob/main/src/common/filters/http-exception.filter.ts): `src/common/filters/http-exception.filter.ts`
- [Response wrapper](https://github.com/elia-epita/students-app/blob/main/src/common/interceptors/wrap-response.interceptor.ts): `src/common/interceptors/wrap-response.interceptor.ts`
- [Timeout interceptor](https://github.com/elia-epita/students-app/blob/main/src/common/interceptors/timeout.interceptor.ts): `src/common/interceptors/timeout.interceptor.ts`
- [Integer parse pipe](https://github.com/elia-epita/students-app/blob/main/src/common/pipes/parse-int.pipe.ts): `src/common/pipes/parse-int.pipe.ts`

### Persistence

- [Student entity](https://github.com/elia-epita/students-app/blob/main/src/students/entites/student.entity.ts): `src/students/entites/student.entity.ts`
- [Course entity](https://github.com/elia-epita/students-app/blob/main/src/students/entites/course.entity.ts): `src/students/entites/course.entity.ts`
- [Event entity](https://github.com/elia-epita/students-app/blob/main/src/events/entities/event.entity.ts): `src/events/entities/event.entity.ts`
- **PostgreSQL**

### Other components

- **HTTP client**

## Connections

- HTTP client → HTTP bootstrap: sends requests
- HTTP bootstrap → Application module: creates app (evidence: `src/main.ts`)
- HTTP bootstrap → Exception filter: registers filter (evidence: `src/main.ts`)
- HTTP bootstrap → Response wrapper: registers interceptor (evidence: `src/main.ts`)
- HTTP bootstrap → Timeout interceptor: registers interceptor (evidence: `src/main.ts`)
- HTTP bootstrap → HTTP client: serves API docs (evidence: `src/main.ts`)
- Application module → Root controller: registers (evidence: `src/app.module.ts`)
- Application module → Greeting service: provides (evidence: `src/app.module.ts`)
- Application module → Students module: imports (evidence: `src/app.module.ts`)
- Application module → Common module: imports (evidence: `src/app.module.ts`)
- Application module → PostgreSQL: configures connection (evidence: `src/app.module.ts`)
- Root controller → Greeting service: calls greeting (evidence: `src/app.controller.ts`)
- Students module → Students controller: registers (evidence: `src/students/students.module.ts`)
- Students module → Students service: provides (evidence: `src/students/students.module.ts`)
- Students module → Student entity: registers entity (evidence: `src/students/students.module.ts`)
- Students module → Course entity: registers entity (evidence: `src/students/students.module.ts`)
- Students module → Event entity: registers entity (evidence: `src/students/students.module.ts`)
- Students controller → Students service: delegates requests (evidence: `src/students/students.controller.ts`)
- Students controller → Create DTO: accepts input (evidence: `src/students/students.controller.ts`)
- Students controller → Update DTO: accepts input (evidence: `src/students/students.controller.ts`)
- Students controller → Pagination DTO: accepts query (evidence: `src/students/students.controller.ts`)
- Students controller → Integer parse pipe: parses ID (evidence: `src/students/students.controller.ts`)
- Students service → Student entity: loads and saves (evidence: `src/students/students.service.ts`)
- Students service → Course entity: looks up courses (evidence: `src/students/students.service.ts`)
- Students service → Event entity: creates event (evidence: `src/students/students.service.ts`)
- Students service → PostgreSQL: persists records (evidence: `src/students/students.service.ts`)
- Student entity → Course entity: relates courses (evidence: `src/students/entites/student.entity.ts`)
- Course entity → Student entity: relates students (evidence: `src/students/entites/course.entity.ts`)
- Common module → API key guard: registers global guard (evidence: `src/common/common.module.ts`)
- Common module → Logging middleware: applies middleware (evidence: `src/common/common.module.ts`)
- API key guard → Public decorator: checks metadata (evidence: `src/common/guards/api-key.guard.ts`)
- Update DTO → Create DTO: reuses fields (evidence: `src/students/dto/update-student.dto.ts`)
