# trandongthanh/sepfa26 architecture

> Architecture diagram of the GitHub repository trandongthanh/sepfa26, 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/trandongthanh/sepfa26
- Repository: https://github.com/trandongthanh/sepfa26

## Overview

LanCare Hub is a backend API for matching customers with plant-care providers and managing care services. Its core workflow runs from provider discovery and profile/package management through order submission, negotiation, agreement, payment, handover, and ongoing care reports. Authentication supports customer/provider accounts and role-based access; adjacent capabilities include disputes, video calls, customer/provider verification, and document uploads. The tree and controller excerpts establish API-to-service calls; service internals were not sampled, so uncertain cross-service wiring is omitted.

Main entry points: [`BE/src/main.ts`](https://github.com/trandongthanh/sepfa26/blob/main/BE/src/main.ts) (LanCare API), [`BE/src/orders/orders.controller.ts`](https://github.com/trandongthanh/sepfa26/blob/main/BE/src/orders/orders.controller.ts) (Order API), [`BE/src/providers/providers.service.ts`](https://github.com/trandongthanh/sepfa26/blob/main/BE/src/providers/providers.service.ts) (Provider service), [`BE/src/payments/webhooks.controller.ts`](https://github.com/trandongthanh/sepfa26/blob/main/BE/src/payments/webhooks.controller.ts) (SePay webhook)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_identity["Identity and profiles"]
  node_auth_api["Authentication API<br/>[auth.controller.ts]"]
  node_auth_service["Authentication service<br/>[auth.service.ts]"]
  node_accounts["Account management"]
  node_customers["Customer profiles"]
end

subgraph group_marketplace["Provider marketplace"]
  node_providers["Provider profiles"]
  node_provider_admin["Provider approval"]
  node_provider_service["Provider service"]
end

subgraph group_orders["Order lifecycle"]
  node_orders_api["Order API"]
  node_orders_service["Order service<br/>[orders.service.ts]"]
  node_handover["Handover service"]
  node_disputes["Dispute handling"]
end

subgraph group_care["Care and communication"]
  node_reports_api["Care report API"]
  node_reports["Care reports"]
  node_calls_api["Video call API"]
  node_calls["Video call service"]
end

subgraph group_operations["Payments and media"]
  node_payments["Payment processing"]
  node_webhook["SePay webhook"]
  node_uploads["Document uploads"]
  node_upload_service["Upload service<br/>[uploads.service.ts]"]
end

node_customer(("Customer"))
node_provider(("Provider"))
node_admin(("Administrator"))
node_api["LanCare API<br/>[main.ts]"]
node_sepay{{"SePay"}}
node_getstream{{"GetStream"}}
node_cloudinary{{"Cloudinary"}}
node_database[("Application database<br/>[typeorm.config.ts]")]

node_customer -->|"uses"| node_api
node_provider -->|"uses"| node_api
node_admin -->|"uses"| node_api
node_api -->|"routes"| node_auth_api
node_api -->|"routes"| node_accounts
node_api -->|"routes"| node_customers
node_api -->|"routes"| node_providers
node_api -->|"routes"| node_provider_admin
node_api -->|"routes"| node_orders_api
node_api -->|"routes"| node_disputes
node_api -->|"routes"| node_webhook
node_api -->|"routes"| node_reports_api
node_api -->|"routes"| node_calls_api
node_api -->|"routes"| node_uploads
node_auth_api -->|"calls"| node_auth_service
node_accounts -->|"calls"| node_auth_service
node_customers -->|"reads/writes"| node_database
node_providers -->|"calls"| node_provider_service
node_provider_admin -->|"calls"| node_provider_service
node_provider_service -->|"reads/writes"| node_database
node_orders_api -->|"calls"| node_orders_service
node_orders_api -->|"calls"| node_handover
node_disputes -->|"reads/writes"| node_database
node_webhook -->|"calls"| node_payments
node_sepay -->|"sends event"| node_webhook
node_reports_api -->|"calls"| node_reports
node_calls_api -->|"calls"| node_calls
node_calls -.->|"integrates"| node_getstream
node_uploads -->|"calls"| node_upload_service
node_upload_service -.->|"uploads"| node_cloudinary

click node_api "https://github.com/trandongthanh/sepfa26/blob/main/BE/src/main.ts"
click node_auth_api "https://github.com/trandongthanh/sepfa26/blob/main/BE/src/auth/auth.controller.ts"
click node_auth_service "https://github.com/trandongthanh/sepfa26/blob/main/BE/src/auth/auth.service.ts"
click node_accounts "https://github.com/trandongthanh/sepfa26/blob/main/BE/src/accounts/accounts.controller.ts"
click node_customers "https://github.com/trandongthanh/sepfa26/blob/main/BE/src/customers/customers.controller.ts"
click node_providers "https://github.com/trandongthanh/sepfa26/blob/main/BE/src/providers/providers.controller.ts"
click node_provider_admin "https://github.com/trandongthanh/sepfa26/blob/main/BE/src/providers/admin-providers.controller.ts"
click node_provider_service "https://github.com/trandongthanh/sepfa26/blob/main/BE/src/providers/providers.service.ts"
click node_orders_api "https://github.com/trandongthanh/sepfa26/blob/main/BE/src/orders/orders.controller.ts"
click node_orders_service "https://github.com/trandongthanh/sepfa26/blob/main/BE/src/orders/orders.service.ts"
click node_handover "https://github.com/trandongthanh/sepfa26/blob/main/BE/src/orders/handover.service.ts"
click node_disputes "https://github.com/trandongthanh/sepfa26/blob/main/BE/src/orders/disputes.controller.ts"
click node_payments "https://github.com/trandongthanh/sepfa26/blob/main/BE/src/payments/payments.service.ts"
click node_webhook "https://github.com/trandongthanh/sepfa26/blob/main/BE/src/payments/webhooks.controller.ts"
click node_reports_api "https://github.com/trandongthanh/sepfa26/blob/main/BE/src/care-reports/care-reports.controller.ts"
click node_reports "https://github.com/trandongthanh/sepfa26/blob/main/BE/src/care-reports/care-reports.service.ts"
click node_calls_api "https://github.com/trandongthanh/sepfa26/blob/main/BE/src/video-calls/video-calls.controller.ts"
click node_calls "https://github.com/trandongthanh/sepfa26/blob/main/BE/src/video-calls/video-calls.service.ts"
click node_uploads "https://github.com/trandongthanh/sepfa26/blob/main/BE/src/uploads/uploads.controller.ts"
click node_upload_service "https://github.com/trandongthanh/sepfa26/blob/main/BE/src/uploads/uploads.service.ts"
click node_database "https://github.com/trandongthanh/sepfa26/blob/main/BE/src/config/typeorm.config.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_service,node_accounts,node_customers toneBlue
class node_providers,node_provider_admin,node_provider_service,node_database toneAmber
class node_orders_api,node_orders_service,node_handover,node_disputes,node_api toneMint
class node_reports_api,node_reports,node_calls_api,node_calls toneRose
class node_payments,node_webhook,node_uploads,node_upload_service,node_customer,node_provider,node_admin,node_sepay,node_getstream,node_cloudinary toneIndigo
```

## Components

### Identity and profiles

- [Authentication API](https://github.com/trandongthanh/sepfa26/blob/main/BE/src/auth/auth.controller.ts): `BE/src/auth/auth.controller.ts`
- [Authentication service](https://github.com/trandongthanh/sepfa26/blob/main/BE/src/auth/auth.service.ts): `BE/src/auth/auth.service.ts`
- [Account management](https://github.com/trandongthanh/sepfa26/blob/main/BE/src/accounts/accounts.controller.ts): `BE/src/accounts/accounts.controller.ts`
- [Customer profiles](https://github.com/trandongthanh/sepfa26/blob/main/BE/src/customers/customers.controller.ts): `BE/src/customers/customers.controller.ts`

### Provider marketplace

- [Provider profiles](https://github.com/trandongthanh/sepfa26/blob/main/BE/src/providers/providers.controller.ts): `BE/src/providers/providers.controller.ts`
- [Provider approval](https://github.com/trandongthanh/sepfa26/blob/main/BE/src/providers/admin-providers.controller.ts): `BE/src/providers/admin-providers.controller.ts`
- [Provider service](https://github.com/trandongthanh/sepfa26/blob/main/BE/src/providers/providers.service.ts): `BE/src/providers/providers.service.ts`

### Order lifecycle

- [Order API](https://github.com/trandongthanh/sepfa26/blob/main/BE/src/orders/orders.controller.ts): `BE/src/orders/orders.controller.ts`
- [Order service](https://github.com/trandongthanh/sepfa26/blob/main/BE/src/orders/orders.service.ts): `BE/src/orders/orders.service.ts`
- [Handover service](https://github.com/trandongthanh/sepfa26/blob/main/BE/src/orders/handover.service.ts): `BE/src/orders/handover.service.ts`
- [Dispute handling](https://github.com/trandongthanh/sepfa26/blob/main/BE/src/orders/disputes.controller.ts): `BE/src/orders/disputes.controller.ts`

### Care and communication

- [Care report API](https://github.com/trandongthanh/sepfa26/blob/main/BE/src/care-reports/care-reports.controller.ts): `BE/src/care-reports/care-reports.controller.ts`
- [Care reports](https://github.com/trandongthanh/sepfa26/blob/main/BE/src/care-reports/care-reports.service.ts): `BE/src/care-reports/care-reports.service.ts`
- [Video call API](https://github.com/trandongthanh/sepfa26/blob/main/BE/src/video-calls/video-calls.controller.ts): `BE/src/video-calls/video-calls.controller.ts`
- [Video call service](https://github.com/trandongthanh/sepfa26/blob/main/BE/src/video-calls/video-calls.service.ts): `BE/src/video-calls/video-calls.service.ts`

### Payments and media

- [Payment processing](https://github.com/trandongthanh/sepfa26/blob/main/BE/src/payments/payments.service.ts): `BE/src/payments/payments.service.ts`
- [SePay webhook](https://github.com/trandongthanh/sepfa26/blob/main/BE/src/payments/webhooks.controller.ts): `BE/src/payments/webhooks.controller.ts`
- [Document uploads](https://github.com/trandongthanh/sepfa26/blob/main/BE/src/uploads/uploads.controller.ts): `BE/src/uploads/uploads.controller.ts`
- [Upload service](https://github.com/trandongthanh/sepfa26/blob/main/BE/src/uploads/uploads.service.ts): `BE/src/uploads/uploads.service.ts`

### Other components

- **Customer**
- **Provider**
- **Administrator**
- [LanCare API](https://github.com/trandongthanh/sepfa26/blob/main/BE/src/main.ts): `BE/src/main.ts`
- **SePay**
- **GetStream**
- **Cloudinary**
- [Application database](https://github.com/trandongthanh/sepfa26/blob/main/BE/src/config/typeorm.config.ts): `BE/src/config/typeorm.config.ts`

## Connections

- Customer → LanCare API: uses
- Provider → LanCare API: uses
- Administrator → LanCare API: uses
- LanCare API → Authentication API: routes
- LanCare API → Account management: routes
- LanCare API → Customer profiles: routes
- LanCare API → Provider profiles: routes
- LanCare API → Provider approval: routes
- LanCare API → Order API: routes
- LanCare API → Dispute handling: routes
- LanCare API → SePay webhook: routes
- LanCare API → Care report API: routes
- LanCare API → Video call API: routes
- LanCare API → Document uploads: routes
- Authentication API → Authentication service: calls
- Account management → Authentication service: calls
- Customer profiles → Application database: reads/writes
- Provider profiles → Provider service: calls
- Provider approval → Provider service: calls
- Provider service → Application database: reads/writes
- Order API → Order service: calls
- Order API → Handover service: calls
- Dispute handling → Application database: reads/writes
- SePay webhook → Payment processing: calls
- SePay → SePay webhook: sends event
- Care report API → Care reports: calls
- Video call API → Video call service: calls
- Video call service → GetStream: integrates
- Document uploads → Upload service: calls
- Upload service → Cloudinary: uploads
