# dhtphu05/dut-job-fair-backend architecture

> Architecture diagram of the GitHub repository dhtphu05/dut-job-fair-backend, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-25). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/dhtphu05/dut-job-fair-backend
- Repository: https://github.com/dhtphu05/dut-job-fair-backend

## Overview

DUT Job Fair Backend is a NestJS API for event operations. Its central scanner workflow is an authenticated scanner client submitting a student QR scan, after which scanner APIs record or retrieve booth check-ins; school and business admins inspect attendance, dashboards, and exports. Separate API domains manage event participants and venues, schools, and reward milestones and claims. Authentication handles role-based access and refreshable sessions. The README documents PostgreSQL/TypeORM and additional domain capabilities; service-level wiring beyond the supplied excerpts is not asserted.

Main entry points: [`src/app.module.ts`](https://github.com/dhtphu05/dut-job-fair-backend/blob/main/src/app.module.ts) (Application modules), [`src/auth/auth.service.ts`](https://github.com/dhtphu05/dut-job-fair-backend/blob/main/src/auth/auth.service.ts) (Auth service), [`src/auth/guards`](https://github.com/dhtphu05/dut-job-fair-backend/tree/main/src/auth/guards) (JWT and role guards), [`src/scanner/scanner.controller.ts`](https://github.com/dhtphu05/dut-job-fair-backend/blob/main/src/scanner/scanner.controller.ts) (Scanner API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["API runtime"]
  node_server["NestJS bootstrap<br/>[main.ts]"]
  node_app_module["Application modules<br/>[app.module.ts]"]
  node_entities["Domain entities"]
end

subgraph group_identity["Identity and access"]
  node_auth_controller["Auth API<br/>[auth.controller.ts]"]
  node_auth_service["Auth service<br/>[auth.service.ts]"]
  node_auth_guards["JWT and role guards"]
end

subgraph group_event["Event operations"]
  node_scanner_api["Scanner API"]
  node_scanner_service["Scanner service<br/>[scanner.service.ts]"]
  node_checkin_api["Check-in API"]
  node_checkin_service["Check-in service<br/>[checkin.service.ts]"]
  node_students_api["Students API"]
  node_students_service["Students service"]
  node_businesses_api["Businesses API"]
  node_businesses_service["Businesses service"]
  node_booths_api["Booths API"]
  node_booths_service["Booths service<br/>[booths.service.ts]"]
  node_schools_api["Schools API"]
  node_schools_service["Schools service<br/>[schools.service.ts]"]
end

subgraph group_administration["Admin operations"]
  node_school_admin_api["School admin API"]
  node_school_admin_service["School admin service"]
  node_business_admin_api["Business admin API"]
  node_business_admin_service["Business admin service"]
end

subgraph group_rewards["Rewards"]
  node_rewards_api["Rewards API"]
  node_rewards_service["Rewards service<br/>[rewards.service.ts]"]
end

node_api_client(("API clients"))
node_postgres[("PostgreSQL")]

node_api_client -->|"sends API requests"| node_server
node_server -->|"starts"| node_app_module
node_app_module -->|"registers routes"| node_auth_controller
node_app_module -->|"registers routes"| node_scanner_api
node_app_module -->|"registers routes"| node_checkin_api
node_app_module -->|"registers routes"| node_students_api
node_app_module -->|"registers routes"| node_businesses_api
node_app_module -->|"registers routes"| node_booths_api
node_app_module -->|"registers routes"| node_schools_api
node_app_module -->|"registers routes"| node_school_admin_api
node_app_module -->|"registers routes"| node_business_admin_api
node_app_module -->|"registers routes"| node_rewards_api
node_auth_controller -->|"calls"| node_auth_service
node_auth_service -->|"reads and writes"| node_entities
node_auth_service -->|"persists sessions and users"| node_postgres
node_auth_guards -->|"validates access"| node_auth_service
node_scanner_api -->|"guards requests"| node_auth_guards
node_scanner_api -->|"calls"| node_scanner_service
node_checkin_api -->|"calls"| node_checkin_service
node_students_api -->|"guards requests"| node_auth_guards
node_students_api -->|"calls"| node_students_service
node_businesses_api -->|"calls"| node_businesses_service
node_booths_api -->|"calls"| node_booths_service
node_schools_api -->|"calls"| node_schools_service
node_school_admin_api -->|"calls"| node_school_admin_service
node_business_admin_api -->|"calls"| node_business_admin_service
node_rewards_api -->|"guards protected routes"| node_auth_guards
node_rewards_api -->|"calls"| node_rewards_service

click node_server "https://github.com/dhtphu05/dut-job-fair-backend/blob/main/src/main.ts"
click node_app_module "https://github.com/dhtphu05/dut-job-fair-backend/blob/main/src/app.module.ts"
click node_auth_controller "https://github.com/dhtphu05/dut-job-fair-backend/blob/main/src/auth/auth.controller.ts"
click node_auth_service "https://github.com/dhtphu05/dut-job-fair-backend/blob/main/src/auth/auth.service.ts"
click node_auth_guards "https://github.com/dhtphu05/dut-job-fair-backend/tree/main/src/auth/guards"
click node_scanner_api "https://github.com/dhtphu05/dut-job-fair-backend/blob/main/src/scanner/scanner.controller.ts"
click node_scanner_service "https://github.com/dhtphu05/dut-job-fair-backend/blob/main/src/scanner/scanner.service.ts"
click node_checkin_api "https://github.com/dhtphu05/dut-job-fair-backend/blob/main/src/checkin/checkin.controller.ts"
click node_checkin_service "https://github.com/dhtphu05/dut-job-fair-backend/blob/main/src/checkin/checkin.service.ts"
click node_students_api "https://github.com/dhtphu05/dut-job-fair-backend/blob/main/src/students/students.controller.ts"
click node_students_service "https://github.com/dhtphu05/dut-job-fair-backend/blob/main/src/students/students.service.ts"
click node_businesses_api "https://github.com/dhtphu05/dut-job-fair-backend/blob/main/src/businesses/businesses.controller.ts"
click node_businesses_service "https://github.com/dhtphu05/dut-job-fair-backend/blob/main/src/businesses/businesses.service.ts"
click node_booths_api "https://github.com/dhtphu05/dut-job-fair-backend/blob/main/src/booths/booths.controller.ts"
click node_booths_service "https://github.com/dhtphu05/dut-job-fair-backend/blob/main/src/booths/booths.service.ts"
click node_schools_api "https://github.com/dhtphu05/dut-job-fair-backend/blob/main/src/schools/schools.controller.ts"
click node_schools_service "https://github.com/dhtphu05/dut-job-fair-backend/blob/main/src/schools/schools.service.ts"
click node_school_admin_api "https://github.com/dhtphu05/dut-job-fair-backend/blob/main/src/school-admin/school-admin.controller.ts"
click node_school_admin_service "https://github.com/dhtphu05/dut-job-fair-backend/blob/main/src/school-admin/school-admin.service.ts"
click node_business_admin_api "https://github.com/dhtphu05/dut-job-fair-backend/blob/main/src/business-admin/business-admin.controller.ts"
click node_business_admin_service "https://github.com/dhtphu05/dut-job-fair-backend/blob/main/src/business-admin/business-admin.service.ts"
click node_rewards_api "https://github.com/dhtphu05/dut-job-fair-backend/blob/main/src/rewards/rewards.controller.ts"
click node_rewards_service "https://github.com/dhtphu05/dut-job-fair-backend/blob/main/src/rewards/rewards.service.ts"
click node_entities "https://github.com/dhtphu05/dut-job-fair-backend/tree/main/src/entities"

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_server,node_app_module,node_entities,node_api_client toneBlue
class node_auth_controller,node_auth_service,node_auth_guards,node_postgres toneAmber
class node_scanner_api,node_scanner_service,node_checkin_api,node_checkin_service,node_students_api,node_students_service,node_businesses_api,node_businesses_service,node_booths_api,node_booths_service,node_schools_api,node_schools_service toneMint
class node_school_admin_api,node_school_admin_service,node_business_admin_api,node_business_admin_service toneRose
class node_rewards_api,node_rewards_service toneIndigo
```

## Components

### API runtime

- [NestJS bootstrap](https://github.com/dhtphu05/dut-job-fair-backend/blob/main/src/main.ts): `src/main.ts`
- [Application modules](https://github.com/dhtphu05/dut-job-fair-backend/blob/main/src/app.module.ts): `src/app.module.ts`
- [Domain entities](https://github.com/dhtphu05/dut-job-fair-backend/tree/main/src/entities): `src/entities`

### Identity and access

- [Auth API](https://github.com/dhtphu05/dut-job-fair-backend/blob/main/src/auth/auth.controller.ts): `src/auth/auth.controller.ts`
- [Auth service](https://github.com/dhtphu05/dut-job-fair-backend/blob/main/src/auth/auth.service.ts): `src/auth/auth.service.ts`
- [JWT and role guards](https://github.com/dhtphu05/dut-job-fair-backend/tree/main/src/auth/guards): `src/auth/guards`

### Event operations

- [Scanner API](https://github.com/dhtphu05/dut-job-fair-backend/blob/main/src/scanner/scanner.controller.ts): `src/scanner/scanner.controller.ts`
- [Scanner service](https://github.com/dhtphu05/dut-job-fair-backend/blob/main/src/scanner/scanner.service.ts): `src/scanner/scanner.service.ts`
- [Check-in API](https://github.com/dhtphu05/dut-job-fair-backend/blob/main/src/checkin/checkin.controller.ts): `src/checkin/checkin.controller.ts`
- [Check-in service](https://github.com/dhtphu05/dut-job-fair-backend/blob/main/src/checkin/checkin.service.ts): `src/checkin/checkin.service.ts`
- [Students API](https://github.com/dhtphu05/dut-job-fair-backend/blob/main/src/students/students.controller.ts): `src/students/students.controller.ts`
- [Students service](https://github.com/dhtphu05/dut-job-fair-backend/blob/main/src/students/students.service.ts): `src/students/students.service.ts`
- [Businesses API](https://github.com/dhtphu05/dut-job-fair-backend/blob/main/src/businesses/businesses.controller.ts): `src/businesses/businesses.controller.ts`
- [Businesses service](https://github.com/dhtphu05/dut-job-fair-backend/blob/main/src/businesses/businesses.service.ts): `src/businesses/businesses.service.ts`
- [Booths API](https://github.com/dhtphu05/dut-job-fair-backend/blob/main/src/booths/booths.controller.ts): `src/booths/booths.controller.ts`
- [Booths service](https://github.com/dhtphu05/dut-job-fair-backend/blob/main/src/booths/booths.service.ts): `src/booths/booths.service.ts`
- [Schools API](https://github.com/dhtphu05/dut-job-fair-backend/blob/main/src/schools/schools.controller.ts): `src/schools/schools.controller.ts`
- [Schools service](https://github.com/dhtphu05/dut-job-fair-backend/blob/main/src/schools/schools.service.ts): `src/schools/schools.service.ts`

### Admin operations

- [School admin API](https://github.com/dhtphu05/dut-job-fair-backend/blob/main/src/school-admin/school-admin.controller.ts): `src/school-admin/school-admin.controller.ts`
- [School admin service](https://github.com/dhtphu05/dut-job-fair-backend/blob/main/src/school-admin/school-admin.service.ts): `src/school-admin/school-admin.service.ts`
- [Business admin API](https://github.com/dhtphu05/dut-job-fair-backend/blob/main/src/business-admin/business-admin.controller.ts): `src/business-admin/business-admin.controller.ts`
- [Business admin service](https://github.com/dhtphu05/dut-job-fair-backend/blob/main/src/business-admin/business-admin.service.ts): `src/business-admin/business-admin.service.ts`

### Rewards

- [Rewards API](https://github.com/dhtphu05/dut-job-fair-backend/blob/main/src/rewards/rewards.controller.ts): `src/rewards/rewards.controller.ts`
- [Rewards service](https://github.com/dhtphu05/dut-job-fair-backend/blob/main/src/rewards/rewards.service.ts): `src/rewards/rewards.service.ts`

### Other components

- **API clients**
- **PostgreSQL**

## Connections

- API clients → NestJS bootstrap: sends API requests
- NestJS bootstrap → Application modules: starts
- Application modules → Auth API: registers routes
- Application modules → Scanner API: registers routes
- Application modules → Check-in API: registers routes
- Application modules → Students API: registers routes
- Application modules → Businesses API: registers routes
- Application modules → Booths API: registers routes
- Application modules → Schools API: registers routes
- Application modules → School admin API: registers routes
- Application modules → Business admin API: registers routes
- Application modules → Rewards API: registers routes
- Auth API → Auth service: calls
- Auth service → Domain entities: reads and writes
- Auth service → PostgreSQL: persists sessions and users
- JWT and role guards → Auth service: validates access
- Scanner API → JWT and role guards: guards requests
- Scanner API → Scanner service: calls
- Check-in API → Check-in service: calls
- Students API → JWT and role guards: guards requests
- Students API → Students service: calls
- Businesses API → Businesses service: calls
- Booths API → Booths service: calls
- Schools API → Schools service: calls
- School admin API → School admin service: calls
- Business admin API → Business admin service: calls
- Rewards API → JWT and role guards: guards protected routes
- Rewards API → Rewards service: calls
