# nithinmanayilghub/sevadesk architecture

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

- Interactive diagram: https://gitdiagram.com/nithinmanayilghub/sevadesk
- Repository: https://github.com/nithinmanayilghub/sevadesk

## Overview

SevaDesk is a multi-tenant SaaS for Indian home-service businesses. Its product spans account and team access, business setup, customer chat and staff inbox, and booking management. The documented request path starts in a browser, reaches FastAPI, accesses Postgres, and returns a response; the sampled backend also shows tenant-scoped persistence and distinct service-layer workflows. The tree and README establish broader UI and operational capabilities, but many frontend and backend routes were not sampled, so their internal call relationships are not inferred here.

Main entry points: [`backend/app/main.py`](https://github.com/nithinmanayilghub/sevadesk/blob/main/backend/app/main.py) (FastAPI app), [`backend/app/modules/business/service.py`](https://github.com/nithinmanayilghub/sevadesk/blob/main/backend/app/modules/business/service.py) (Business setup), [`backend/app/modules/bookings/service.py`](https://github.com/nithinmanayilghub/sevadesk/blob/main/backend/app/modules/bookings/service.py) (Booking management), [`backend/app/core/repository.py`](https://github.com/nithinmanayilghub/sevadesk/blob/main/backend/app/core/repository.py) (Tenant repositories)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Customer and Staff UI"]
  node_frontend["Web app"]
  node_api_client["API client<br/>[client.ts]"]
end

subgraph group_api["API and Domain"]
  node_api_entry["FastAPI app<br/>[main.py]"]
  node_accounts["Accounts and teams<br/>[service.py]"]
  node_business["Business setup<br/>[service.py]"]
  node_bookings["Booking management<br/>[service.py]"]
  node_inbox["Customer inbox<br/>[service.py]"]
  node_business_routes["Business routes<br/>[router.py]"]
end

subgraph group_runtime["Persistence and Runtime"]
  node_tenant_context["Tenant context<br/>[tenancy.py]"]
  node_repository["Tenant repositories<br/>[repository.py]"]
  node_postgres[("Postgres")]
  node_redis[("Valkey / Redis")]
  node_worker["Background worker<br/>[worker.py]"]
  node_telemetry["Telemetry and masking<br/>[telemetry.py]"]
end

node_browser(("Customers and staff"))

node_browser -->|"uses"| node_frontend
node_frontend -.->|"requests API"| node_api_client
node_api_client -.->|"sends requests"| node_api_entry
node_api_entry -->|"mounts routes"| node_business_routes
node_business_routes -->|"delegates"| node_business
node_business -->|"creates owner"| node_accounts
node_bookings -->|"checks roles"| node_accounts
node_bookings -->|"reads services"| node_business
node_api_entry -->|"request path"| node_postgres
node_repository -->|"reads tenant"| node_tenant_context
node_repository -->|"queries"| node_postgres
node_worker -->|"sets up tracing"| node_telemetry
node_api_entry -->|"configures tracing"| node_telemetry
node_api_entry -->|"health checks"| node_redis

click node_frontend "https://github.com/nithinmanayilghub/sevadesk/tree/main/frontend/src/app"
click node_api_client "https://github.com/nithinmanayilghub/sevadesk/blob/main/frontend/src/api/client.ts"
click node_api_entry "https://github.com/nithinmanayilghub/sevadesk/blob/main/backend/app/main.py"
click node_accounts "https://github.com/nithinmanayilghub/sevadesk/blob/main/backend/app/modules/accounts/service.py"
click node_business "https://github.com/nithinmanayilghub/sevadesk/blob/main/backend/app/modules/business/service.py"
click node_bookings "https://github.com/nithinmanayilghub/sevadesk/blob/main/backend/app/modules/bookings/service.py"
click node_inbox "https://github.com/nithinmanayilghub/sevadesk/blob/main/backend/app/modules/inbox/service.py"
click node_business_routes "https://github.com/nithinmanayilghub/sevadesk/blob/main/backend/app/modules/business/router.py"
click node_tenant_context "https://github.com/nithinmanayilghub/sevadesk/blob/main/backend/app/core/tenancy.py"
click node_repository "https://github.com/nithinmanayilghub/sevadesk/blob/main/backend/app/core/repository.py"
click node_worker "https://github.com/nithinmanayilghub/sevadesk/blob/main/backend/app/worker.py"
click node_telemetry "https://github.com/nithinmanayilghub/sevadesk/blob/main/backend/app/core/telemetry.py"

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_frontend,node_api_client toneBlue
class node_api_entry,node_accounts,node_business,node_bookings,node_inbox,node_business_routes toneAmber
class node_tenant_context,node_repository,node_postgres,node_redis,node_worker,node_telemetry toneMint
class node_browser toneIndigo
```

## Components

### Customer and Staff UI

- [Web app](https://github.com/nithinmanayilghub/sevadesk/tree/main/frontend/src/app): `frontend/src/app`
- [API client](https://github.com/nithinmanayilghub/sevadesk/blob/main/frontend/src/api/client.ts): `frontend/src/api/client.ts`

### API and Domain

- [FastAPI app](https://github.com/nithinmanayilghub/sevadesk/blob/main/backend/app/main.py): `backend/app/main.py`
- [Accounts and teams](https://github.com/nithinmanayilghub/sevadesk/blob/main/backend/app/modules/accounts/service.py): `backend/app/modules/accounts/service.py`
- [Business setup](https://github.com/nithinmanayilghub/sevadesk/blob/main/backend/app/modules/business/service.py): `backend/app/modules/business/service.py`
- [Booking management](https://github.com/nithinmanayilghub/sevadesk/blob/main/backend/app/modules/bookings/service.py): `backend/app/modules/bookings/service.py`
- [Customer inbox](https://github.com/nithinmanayilghub/sevadesk/blob/main/backend/app/modules/inbox/service.py): `backend/app/modules/inbox/service.py`
- [Business routes](https://github.com/nithinmanayilghub/sevadesk/blob/main/backend/app/modules/business/router.py): `backend/app/modules/business/router.py`

### Persistence and Runtime

- [Tenant context](https://github.com/nithinmanayilghub/sevadesk/blob/main/backend/app/core/tenancy.py): `backend/app/core/tenancy.py`
- [Tenant repositories](https://github.com/nithinmanayilghub/sevadesk/blob/main/backend/app/core/repository.py): `backend/app/core/repository.py`
- **Postgres**
- **Valkey / Redis**
- [Background worker](https://github.com/nithinmanayilghub/sevadesk/blob/main/backend/app/worker.py): `backend/app/worker.py`
- [Telemetry and masking](https://github.com/nithinmanayilghub/sevadesk/blob/main/backend/app/core/telemetry.py): `backend/app/core/telemetry.py`

### Other components

- **Customers and staff**

## Connections

- Customers and staff → Web app: uses (evidence: `README.md`)
- Web app → API client: requests API
- API client → FastAPI app: sends requests
- FastAPI app → Business routes: mounts routes (evidence: `backend/app/main.py`)
- Business routes → Business setup: delegates (evidence: `backend/app/modules/business/router.py`)
- Business setup → Accounts and teams: creates owner (evidence: `backend/app/modules/business/service.py`)
- Booking management → Accounts and teams: checks roles (evidence: `backend/app/modules/bookings/service.py`)
- Booking management → Business setup: reads services (evidence: `backend/app/modules/bookings/service.py`)
- FastAPI app → Postgres: request path (evidence: `README.md`)
- Tenant repositories → Tenant context: reads tenant (evidence: `backend/app/core/repository.py`)
- Tenant repositories → Postgres: queries (evidence: `backend/app/core/repository.py`)
- Background worker → Telemetry and masking: sets up tracing (evidence: `backend/app/worker.py`)
- FastAPI app → Telemetry and masking: configures tracing (evidence: `backend/app/main.py`)
- FastAPI app → Valkey / Redis: health checks
