# lfqcamargo/orbee-api architecture

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

- Interactive diagram: https://gitdiagram.com/lfqcamargo/orbee-api
- Repository: https://github.com/lfqcamargo/orbee-api

## Overview

Orbee is a NestJS API for user accounts and authenticated service-business operations. Users register and verify accounts, sign in, and manage sessions; authenticated users then manage customers, catalogs, technicians, service orders, appointments, and charges, with dashboard and report capabilities. The code is organized around controllers and services, with shared authentication and persistence infrastructure. The README documents several operational features whose implementation was not sampled, so those relationships are shown only at the documented capability level.

Main entry points: [`src/app.module.ts`](https://github.com/lfqcamargo/orbee-api/blob/main/src/app.module.ts) (NestJS API), [`src/shared/database/prisma.service.ts`](https://github.com/lfqcamargo/orbee-api/blob/main/src/shared/database/prisma.service.ts) (PostgreSQL via Prisma), [`src/shared/auth/jwt-auth.guard.ts`](https://github.com/lfqcamargo/orbee-api/blob/main/src/shared/auth/jwt-auth.guard.ts) (JWT authentication), [`src/modules/appointment`](https://github.com/lfqcamargo/orbee-api/tree/main/src/modules/appointment) (Appointments)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_identity["Identity &amp; mail"]
  node_user["User accounts"]
  node_mail["Verification mail"]
end

subgraph group_operations["Business operations"]
  node_customer["Customers"]
  node_catalog["Equipment &amp; services"]
  node_technician["Technicians"]
  node_orders["Service orders"]
  node_appointments["Appointments"]
  node_finance["Charges &amp; payments"]
end

subgraph group_insights["Operational insights"]
  node_dashboard["Dashboard"]
  node_reports["Reports"]
end

subgraph group_shared["Shared infrastructure"]
  node_api["NestJS API<br/>[app.module.ts]"]
  node_auth["JWT authentication<br/>[jwt-auth.guard.ts]"]
  node_tokens["Token provider<br/>[token-provider.ts]"]
  node_database[("PostgreSQL via Prisma<br/>[prisma.service.ts]")]
  node_mailworker["Mail worker"]
end

node_operator(("API client"))

node_operator -->|"sends requests"| node_api
node_api -->|"registers module"| node_user
node_api -->|"registers module"| node_customer
node_api -->|"registers modules"| node_catalog
node_api -->|"registers module"| node_technician
node_api -->|"registers module"| node_orders
node_api -->|"registers module"| node_appointments
node_api -->|"registers module"| node_finance
node_api -->|"registers module"| node_dashboard
node_api -->|"registers module"| node_reports
node_user -->|"queues verification"| node_mail
node_mailworker -->|"sends messages"| node_mail
node_mailworker -->|"reads mail jobs"| node_database
node_auth -->|"verifies tokens"| node_tokens
node_operator -->|"authenticates requests"| node_auth
node_auth -->|"guards updates"| node_customer
node_auth -->|"guards listing"| node_appointments
node_auth -->|"guards status changes"| node_orders
node_auth -->|"guards reversals"| node_finance
node_customer -.->|"persists records"| node_database
node_catalog -.->|"persists records"| node_database
node_technician -.->|"persists records"| node_database
node_orders -.->|"persists records"| node_database
node_appointments -.->|"persists records"| node_database
node_finance -.->|"persists records"| node_database
node_dashboard -->|"queries metrics"| node_database
node_reports -.->|"queries data"| node_database
node_operator -->|"manages operations"| node_orders
node_operator -->|"manages schedule"| node_appointments
node_operator -->|"manages payments"| node_finance
node_operator -->|"views summary"| node_dashboard
node_operator -->|"generates reports"| node_reports
node_appointments -.->|"checks conflicts"| node_appointments

click node_user "https://github.com/lfqcamargo/orbee-api/tree/main/src/modules/user"
click node_mail "https://github.com/lfqcamargo/orbee-api/tree/main/src/shared/mail"
click node_customer "https://github.com/lfqcamargo/orbee-api/tree/main/src/modules/customer"
click node_catalog "https://github.com/lfqcamargo/orbee-api/tree/main/src/modules/equipment"
click node_technician "https://github.com/lfqcamargo/orbee-api/tree/main/src/modules/technician"
click node_orders "https://github.com/lfqcamargo/orbee-api/tree/main/src/modules/service-order"
click node_appointments "https://github.com/lfqcamargo/orbee-api/tree/main/src/modules/appointment"
click node_finance "https://github.com/lfqcamargo/orbee-api/tree/main/src/modules/finance"
click node_dashboard "https://github.com/lfqcamargo/orbee-api/tree/main/src/modules/dashboard"
click node_reports "https://github.com/lfqcamargo/orbee-api/tree/main/src/modules/report"
click node_api "https://github.com/lfqcamargo/orbee-api/blob/main/src/app.module.ts"
click node_auth "https://github.com/lfqcamargo/orbee-api/blob/main/src/shared/auth/jwt-auth.guard.ts"
click node_tokens "https://github.com/lfqcamargo/orbee-api/blob/main/src/shared/auth/token-provider.ts"
click node_database "https://github.com/lfqcamargo/orbee-api/blob/main/src/shared/database/prisma.service.ts"
click node_mailworker "https://github.com/lfqcamargo/orbee-api/blob/main/src/shared/mail/mail-worker.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_user,node_mail,node_operator toneBlue
class node_customer,node_catalog,node_technician,node_orders,node_appointments,node_finance toneAmber
class node_dashboard,node_reports toneMint
class node_api,node_auth,node_tokens,node_database,node_mailworker toneRose
```

## Components

### Identity & mail

- [User accounts](https://github.com/lfqcamargo/orbee-api/tree/main/src/modules/user): `src/modules/user`
- [Verification mail](https://github.com/lfqcamargo/orbee-api/tree/main/src/shared/mail): `src/shared/mail`

### Business operations

- [Customers](https://github.com/lfqcamargo/orbee-api/tree/main/src/modules/customer): `src/modules/customer`
- [Equipment & services](https://github.com/lfqcamargo/orbee-api/tree/main/src/modules/equipment): `src/modules/equipment`
- [Technicians](https://github.com/lfqcamargo/orbee-api/tree/main/src/modules/technician): `src/modules/technician`
- [Service orders](https://github.com/lfqcamargo/orbee-api/tree/main/src/modules/service-order): `src/modules/service-order`
- [Appointments](https://github.com/lfqcamargo/orbee-api/tree/main/src/modules/appointment): `src/modules/appointment`
- [Charges & payments](https://github.com/lfqcamargo/orbee-api/tree/main/src/modules/finance): `src/modules/finance`

### Operational insights

- [Dashboard](https://github.com/lfqcamargo/orbee-api/tree/main/src/modules/dashboard): `src/modules/dashboard`
- [Reports](https://github.com/lfqcamargo/orbee-api/tree/main/src/modules/report): `src/modules/report`

### Shared infrastructure

- [NestJS API](https://github.com/lfqcamargo/orbee-api/blob/main/src/app.module.ts): `src/app.module.ts`
- [JWT authentication](https://github.com/lfqcamargo/orbee-api/blob/main/src/shared/auth/jwt-auth.guard.ts): `src/shared/auth/jwt-auth.guard.ts`
- [Token provider](https://github.com/lfqcamargo/orbee-api/blob/main/src/shared/auth/token-provider.ts): `src/shared/auth/token-provider.ts`
- [PostgreSQL via Prisma](https://github.com/lfqcamargo/orbee-api/blob/main/src/shared/database/prisma.service.ts): `src/shared/database/prisma.service.ts`
- [Mail worker](https://github.com/lfqcamargo/orbee-api/blob/main/src/shared/mail/mail-worker.service.ts): `src/shared/mail/mail-worker.service.ts`

### Other components

- **API client**

## Connections

- API client → NestJS API: sends requests
- NestJS API → User accounts: registers module (evidence: `src/app.module.ts`)
- NestJS API → Customers: registers module (evidence: `src/app.module.ts`)
- NestJS API → Equipment & services: registers modules (evidence: `src/app.module.ts`)
- NestJS API → Technicians: registers module (evidence: `src/app.module.ts`)
- NestJS API → Service orders: registers module (evidence: `src/app.module.ts`)
- NestJS API → Appointments: registers module (evidence: `src/app.module.ts`)
- NestJS API → Charges & payments: registers module (evidence: `src/app.module.ts`)
- NestJS API → Dashboard: registers module (evidence: `src/app.module.ts`)
- NestJS API → Reports: registers module (evidence: `src/app.module.ts`)
- User accounts → Verification mail: queues verification
- Mail worker → Verification mail: sends messages (evidence: `src/shared/mail/mail-worker.service.ts`)
- Mail worker → PostgreSQL via Prisma: reads mail jobs (evidence: `src/shared/mail/mail-worker.service.ts`)
- JWT authentication → Token provider: verifies tokens (evidence: `src/shared/auth/jwt-auth.guard.ts`)
- API client → JWT authentication: authenticates requests
- JWT authentication → Customers: guards updates (evidence: `src/modules/customer/controllers/update-customer.controller.ts`)
- JWT authentication → Appointments: guards listing (evidence: `src/modules/appointment/controllers/list-appointments.controller.ts`)
- JWT authentication → Service orders: guards status changes (evidence: `src/modules/service-order/controllers/update-service-order-status.controller.ts`)
- JWT authentication → Charges & payments: guards reversals (evidence: `src/modules/finance/controllers/reverse-payment.controller.ts`)
- Customers → PostgreSQL via Prisma: persists records
- Equipment & services → PostgreSQL via Prisma: persists records
- Technicians → PostgreSQL via Prisma: persists records
- Service orders → PostgreSQL via Prisma: persists records
- Appointments → PostgreSQL via Prisma: persists records
- Charges & payments → PostgreSQL via Prisma: persists records
- Dashboard → PostgreSQL via Prisma: queries metrics (evidence: `src/modules/dashboard/services/get-dashboard.service.ts`)
- Reports → PostgreSQL via Prisma: queries data
- API client → Service orders: manages operations
- API client → Appointments: manages schedule
- API client → Charges & payments: manages payments
- API client → Dashboard: views summary
- API client → Reports: generates reports
- Appointments → Appointments: checks conflicts
