# tannguyen17112003/tsa-backend architecture

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

- Interactive diagram: https://gitdiagram.com/tannguyen17112003/tsa-backend
- Repository: https://github.com/tannguyen17112003/tsa-backend

## Overview

This is a NestJS backend whose README is only the framework starter template; the source tree reveals the product domains. The visible request pattern is authenticated clients calling API controllers, which delegate to domain services. The implementation excerpt also shows registration and sign-in relying on persistence and selected email, Firebase, and notification services. Many domain services and application wiring were not sampled, so their internal dependencies are omitted rather than inferred.

Main entry points: [`src/auth/auth.service.impl.ts`](https://github.com/tannguyen17112003/tsa-backend/blob/master/src/auth/auth.service.impl.ts) (Authentication logic), [`src/auth/auth.controller.ts`](https://github.com/tannguyen17112003/tsa-backend/blob/master/src/auth/auth.controller.ts) (Authentication API), [`src/notifications/notifications.service.impl.ts`](https://github.com/tannguyen17112003/tsa-backend/blob/master/src/notifications/notifications.service.impl.ts) (Notifications), [`src/users/users.service.impl.ts`](https://github.com/tannguyen17112003/tsa-backend/blob/master/src/users/users.service.impl.ts) (User management)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_identity["Identity &amp; users"]
  node_auth_api["Authentication API<br/>[auth.controller.ts]"]
  node_auth_logic["Authentication logic"]
  node_users["User management"]
end

subgraph group_commerce["Orders &amp; delivery"]
  node_orders["Order management"]
  node_deliveries["Delivery management"]
  node_payments["Payment processing"]
  node_geolocation["Live geolocation"]
end

subgraph group_campus["Campus operations"]
  node_regulation["Dorm regulations"]
  node_tickets["Support tickets"]
  node_reports["Reports"]
  node_recognition["Recognition"]
end

subgraph group_platform["Platform services"]
  node_notifications["Notifications"]
  node_email["Email delivery"]
  node_firebase["Firebase integration"]
  node_cloudinary["Media uploads"]
  node_python_api["Python API integration"]
  node_database[("Application database<br/>[prisma.service.ts]")]
end

node_client(("API client"))

node_client -->|"requests"| node_auth_api
node_auth_api -->|"delegates to"| node_auth_logic
node_client -.->|"manages account"| node_users
node_client -->|"places and tracks"| node_orders
node_client -->|"manages delivery"| node_deliveries
node_client -.->|"submits payment"| node_payments
node_client -->|"manages rules"| node_regulation
node_client -->|"opens tickets"| node_tickets
node_client -->|"manages reports"| node_reports
node_client -->|"uses recognition"| node_recognition
node_client -.->|"shares location"| node_geolocation
node_client -->|"manages notifications"| node_notifications
node_client -->|"uploads media"| node_cloudinary
node_auth_logic -->|"reads and writes"| node_database
node_auth_logic -->|"sends verification"| node_email
node_auth_logic -->|"verifies identity"| node_firebase
node_auth_logic -->|"sends push"| node_notifications

click node_auth_api "https://github.com/tannguyen17112003/tsa-backend/blob/master/src/auth/auth.controller.ts"
click node_auth_logic "https://github.com/tannguyen17112003/tsa-backend/blob/master/src/auth/auth.service.impl.ts"
click node_users "https://github.com/tannguyen17112003/tsa-backend/blob/master/src/users/users.service.impl.ts"
click node_orders "https://github.com/tannguyen17112003/tsa-backend/blob/master/src/orders/orders.service.impl.ts"
click node_deliveries "https://github.com/tannguyen17112003/tsa-backend/blob/master/src/deliveries/deliveries.service.impl.ts"
click node_payments "https://github.com/tannguyen17112003/tsa-backend/blob/master/src/payment/payment.service.impl.ts"
click node_regulation "https://github.com/tannguyen17112003/tsa-backend/blob/master/src/regulation/regulation.service.impl.ts"
click node_tickets "https://github.com/tannguyen17112003/tsa-backend/blob/master/src/tickets/tickets.service.impl.ts"
click node_reports "https://github.com/tannguyen17112003/tsa-backend/blob/master/src/reports/reports.service.impl.ts"
click node_recognition "https://github.com/tannguyen17112003/tsa-backend/blob/master/src/recognition/recognition.service.impl.ts"
click node_geolocation "https://github.com/tannguyen17112003/tsa-backend/blob/master/src/geolocation/geolocation.gateway.ts"
click node_notifications "https://github.com/tannguyen17112003/tsa-backend/blob/master/src/notifications/notifications.service.impl.ts"
click node_email "https://github.com/tannguyen17112003/tsa-backend/blob/master/src/email/email.service.impl.ts"
click node_firebase "https://github.com/tannguyen17112003/tsa-backend/blob/master/src/firebase/firebase.service.impl.ts"
click node_cloudinary "https://github.com/tannguyen17112003/tsa-backend/blob/master/src/cloudinary/cloudinary.service.impl.ts"
click node_python_api "https://github.com/tannguyen17112003/tsa-backend/blob/master/src/python-api/python-api.service.impl.ts"
click node_database "https://github.com/tannguyen17112003/tsa-backend/blob/master/src/prisma/prisma.service.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_auth_api,node_auth_logic,node_users,node_client toneBlue
class node_orders,node_deliveries,node_payments,node_geolocation toneAmber
class node_regulation,node_tickets,node_reports,node_recognition toneMint
class node_notifications,node_email,node_firebase,node_cloudinary,node_python_api,node_database toneRose
```

## Components

### Identity & users

- [Authentication API](https://github.com/tannguyen17112003/tsa-backend/blob/master/src/auth/auth.controller.ts): `src/auth/auth.controller.ts`
- [Authentication logic](https://github.com/tannguyen17112003/tsa-backend/blob/master/src/auth/auth.service.impl.ts): `src/auth/auth.service.impl.ts`
- [User management](https://github.com/tannguyen17112003/tsa-backend/blob/master/src/users/users.service.impl.ts): `src/users/users.service.impl.ts`

### Orders & delivery

- [Order management](https://github.com/tannguyen17112003/tsa-backend/blob/master/src/orders/orders.service.impl.ts): `src/orders/orders.service.impl.ts`
- [Delivery management](https://github.com/tannguyen17112003/tsa-backend/blob/master/src/deliveries/deliveries.service.impl.ts): `src/deliveries/deliveries.service.impl.ts`
- [Payment processing](https://github.com/tannguyen17112003/tsa-backend/blob/master/src/payment/payment.service.impl.ts): `src/payment/payment.service.impl.ts`
- [Live geolocation](https://github.com/tannguyen17112003/tsa-backend/blob/master/src/geolocation/geolocation.gateway.ts): `src/geolocation/geolocation.gateway.ts`

### Campus operations

- [Dorm regulations](https://github.com/tannguyen17112003/tsa-backend/blob/master/src/regulation/regulation.service.impl.ts): `src/regulation/regulation.service.impl.ts`
- [Support tickets](https://github.com/tannguyen17112003/tsa-backend/blob/master/src/tickets/tickets.service.impl.ts): `src/tickets/tickets.service.impl.ts`
- [Reports](https://github.com/tannguyen17112003/tsa-backend/blob/master/src/reports/reports.service.impl.ts): `src/reports/reports.service.impl.ts`
- [Recognition](https://github.com/tannguyen17112003/tsa-backend/blob/master/src/recognition/recognition.service.impl.ts): `src/recognition/recognition.service.impl.ts`

### Platform services

- [Notifications](https://github.com/tannguyen17112003/tsa-backend/blob/master/src/notifications/notifications.service.impl.ts): `src/notifications/notifications.service.impl.ts`
- [Email delivery](https://github.com/tannguyen17112003/tsa-backend/blob/master/src/email/email.service.impl.ts): `src/email/email.service.impl.ts`
- [Firebase integration](https://github.com/tannguyen17112003/tsa-backend/blob/master/src/firebase/firebase.service.impl.ts): `src/firebase/firebase.service.impl.ts`
- [Media uploads](https://github.com/tannguyen17112003/tsa-backend/blob/master/src/cloudinary/cloudinary.service.impl.ts): `src/cloudinary/cloudinary.service.impl.ts`
- [Python API integration](https://github.com/tannguyen17112003/tsa-backend/blob/master/src/python-api/python-api.service.impl.ts): `src/python-api/python-api.service.impl.ts`
- [Application database](https://github.com/tannguyen17112003/tsa-backend/blob/master/src/prisma/prisma.service.ts): `src/prisma/prisma.service.ts`

### Other components

- **API client**

## Connections

- API client → Authentication API: requests (evidence: `src/auth/auth.controller.ts`)
- Authentication API → Authentication logic: delegates to (evidence: `src/auth/auth.controller.ts`)
- API client → User management: manages account
- API client → Order management: places and tracks
- API client → Delivery management: manages delivery
- API client → Payment processing: submits payment
- API client → Dorm regulations: manages rules
- API client → Support tickets: opens tickets
- API client → Reports: manages reports
- API client → Recognition: uses recognition
- API client → Live geolocation: shares location
- API client → Notifications: manages notifications
- API client → Media uploads: uploads media
- Authentication logic → Application database: reads and writes (evidence: `src/auth/auth.service.impl.ts`)
- Authentication logic → Email delivery: sends verification (evidence: `src/auth/auth.service.impl.ts`)
- Authentication logic → Firebase integration: verifies identity (evidence: `src/auth/auth.service.impl.ts`)
- Authentication logic → Notifications: sends push (evidence: `src/auth/auth.service.impl.ts`)
