# badugusivalokesh-code/mini-crs architecture

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

- Interactive diagram: https://gitdiagram.com/badugusivalokesh-code/mini-crs
- Repository: https://github.com/badugusivalokesh-code/mini-crs

## Overview

Clientra is a full-stack CRM for authenticated, user-scoped customer, deal, and follow-up task management. Users sign in, work with these records, and view dashboard metrics and pipeline values; the React frontend communicates with an Express API backed by MongoDB. The graph preserves the documented feature areas and the sampled backend’s route-to-service-to-repository structure. Several frontend connections and unsampled service internals are shown only as unverified links; source excerpts do not establish their exact runtime calls.

Main entry points: [`frontend/src/App.tsx`](https://github.com/badugusivalokesh-code/mini-crs/blob/main/frontend/src/App.tsx) (SPA and routing), [`backend/src/app.ts`](https://github.com/badugusivalokesh-code/mini-crs/blob/main/backend/src/app.ts) (API application), [`frontend/src/lib/apiClient.ts`](https://github.com/badugusivalokesh-code/mini-crs/blob/main/frontend/src/lib/apiClient.ts) (HTTP client), [`backend/src/services/customerService.ts`](https://github.com/badugusivalokesh-code/mini-crs/blob/main/backend/src/services/customerService.ts) (Customer logic)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["React frontend"]
  node_client["SPA and routing<br/>[App.tsx]"]
  node_auth_ui["Auth experience<br/>[LoginPage.tsx]"]
  node_customer_ui["Customer workspace<br/>[CustomersPage.tsx]"]
  node_deal_ui["Deal pipeline<br/>[DealsPage.tsx]"]
  node_task_ui["Task workspace<br/>[TasksPage.tsx]"]
  node_dashboard_ui["Dashboard views"]
  node_api_client["HTTP client<br/>[apiClient.ts]"]
end

subgraph group_api["Express API"]
  node_server_app["API application<br/>[app.ts]"]
  node_auth_routes["Authentication routes<br/>[auth.routes.ts]"]
  node_customer_routes["Customer routes"]
  node_deal_routes["Deal routes<br/>[deals.routes.ts]"]
  node_task_routes["Task routes<br/>[tasks.routes.ts]"]
  node_dashboard_routes["Dashboard route"]
end

subgraph group_domain["CRM services"]
  node_auth_service["Authentication logic<br/>[authService.ts]"]
  node_customer_service["Customer logic<br/>[customerService.ts]"]
  node_deal_service["Deal logic<br/>[dealService.ts]"]
  node_task_service["Task logic<br/>[taskService.ts]"]
  node_dashboard_service["Dashboard logic"]
end

subgraph group_data["MongoDB persistence"]
  node_users[("User records<br/>[User.ts]")]
  node_customers[("Customer records<br/>[Customer.ts]")]
  node_deals[("Deal records<br/>[Deal.ts]")]
  node_tasks[("Task records<br/>[Task.ts]")]
  node_dashboard_data[("Dashboard aggregation<br/>[Dashboard.ts]")]
end

node_user(("CRM user"))

node_user -.->|"uses"| node_client
node_client -.->|"routes to"| node_auth_ui
node_client -.->|"routes to"| node_customer_ui
node_client -.->|"routes to"| node_deal_ui
node_client -.->|"routes to"| node_task_ui
node_client -.->|"routes to"| node_dashboard_ui
node_auth_ui -.->|"requests through"| node_api_client
node_customer_ui -.->|"requests through"| node_api_client
node_deal_ui -.->|"requests through"| node_api_client
node_task_ui -.->|"requests through"| node_api_client
node_dashboard_ui -.->|"requests through"| node_api_client
node_api_client -.->|"sends API requests"| node_server_app
node_server_app -->|"mounts"| node_auth_routes
node_server_app -->|"mounts"| node_customer_routes
node_server_app -->|"mounts"| node_deal_routes
node_server_app -->|"mounts"| node_task_routes
node_server_app -->|"mounts"| node_dashboard_routes
node_auth_routes -->|"calls"| node_auth_service
node_customer_routes -->|"calls"| node_customer_service
node_deal_routes -->|"calls"| node_deal_service
node_task_routes -->|"calls"| node_task_service
node_dashboard_routes -->|"uses"| node_dashboard_service
node_auth_service -->|"reads and writes"| node_users
node_customer_service -->|"uses repository"| node_customers
node_deal_service -->|"uses repository"| node_deals
node_task_service -->|"uses repository"| node_tasks
node_dashboard_service -.->|"uses repository"| node_dashboard_data
node_customer_service -->|"loads related deals"| node_deals
node_customer_service -->|"loads related tasks"| node_tasks

click node_client "https://github.com/badugusivalokesh-code/mini-crs/blob/main/frontend/src/App.tsx"
click node_auth_ui "https://github.com/badugusivalokesh-code/mini-crs/blob/main/frontend/src/pages/LoginPage.tsx"
click node_customer_ui "https://github.com/badugusivalokesh-code/mini-crs/blob/main/frontend/src/pages/CustomersPage.tsx"
click node_deal_ui "https://github.com/badugusivalokesh-code/mini-crs/blob/main/frontend/src/pages/DealsPage.tsx"
click node_task_ui "https://github.com/badugusivalokesh-code/mini-crs/blob/main/frontend/src/pages/TasksPage.tsx"
click node_dashboard_ui "https://github.com/badugusivalokesh-code/mini-crs/blob/main/frontend/src/components/dashboard/PipelineValueChart.tsx"
click node_api_client "https://github.com/badugusivalokesh-code/mini-crs/blob/main/frontend/src/lib/apiClient.ts"
click node_server_app "https://github.com/badugusivalokesh-code/mini-crs/blob/main/backend/src/app.ts"
click node_auth_routes "https://github.com/badugusivalokesh-code/mini-crs/blob/main/backend/src/routes/auth.routes.ts"
click node_customer_routes "https://github.com/badugusivalokesh-code/mini-crs/blob/main/backend/src/routes/customers.routes.ts"
click node_deal_routes "https://github.com/badugusivalokesh-code/mini-crs/blob/main/backend/src/routes/deals.routes.ts"
click node_task_routes "https://github.com/badugusivalokesh-code/mini-crs/blob/main/backend/src/routes/tasks.routes.ts"
click node_dashboard_routes "https://github.com/badugusivalokesh-code/mini-crs/blob/main/backend/src/routes/dashboard.routes.ts"
click node_auth_service "https://github.com/badugusivalokesh-code/mini-crs/blob/main/backend/src/services/authService.ts"
click node_customer_service "https://github.com/badugusivalokesh-code/mini-crs/blob/main/backend/src/services/customerService.ts"
click node_deal_service "https://github.com/badugusivalokesh-code/mini-crs/blob/main/backend/src/services/dealService.ts"
click node_task_service "https://github.com/badugusivalokesh-code/mini-crs/blob/main/backend/src/services/taskService.ts"
click node_dashboard_service "https://github.com/badugusivalokesh-code/mini-crs/blob/main/backend/src/services/dashboardService.ts"
click node_users "https://github.com/badugusivalokesh-code/mini-crs/blob/main/backend/src/models/User.ts"
click node_customers "https://github.com/badugusivalokesh-code/mini-crs/blob/main/backend/src/models/Customer.ts"
click node_deals "https://github.com/badugusivalokesh-code/mini-crs/blob/main/backend/src/models/Deal.ts"
click node_tasks "https://github.com/badugusivalokesh-code/mini-crs/blob/main/backend/src/models/Task.ts"
click node_dashboard_data "https://github.com/badugusivalokesh-code/mini-crs/blob/main/backend/src/models/Dashboard.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_client,node_auth_ui,node_customer_ui,node_deal_ui,node_task_ui,node_dashboard_ui,node_api_client,node_user toneBlue
class node_server_app,node_auth_routes,node_customer_routes,node_deal_routes,node_task_routes,node_dashboard_routes toneAmber
class node_auth_service,node_customer_service,node_deal_service,node_task_service,node_dashboard_service toneMint
class node_users,node_customers,node_deals,node_tasks,node_dashboard_data toneRose
```

## Components

### React frontend

- [SPA and routing](https://github.com/badugusivalokesh-code/mini-crs/blob/main/frontend/src/App.tsx): `frontend/src/App.tsx`
- [Auth experience](https://github.com/badugusivalokesh-code/mini-crs/blob/main/frontend/src/pages/LoginPage.tsx): `frontend/src/pages/LoginPage.tsx`
- [Customer workspace](https://github.com/badugusivalokesh-code/mini-crs/blob/main/frontend/src/pages/CustomersPage.tsx): `frontend/src/pages/CustomersPage.tsx`
- [Deal pipeline](https://github.com/badugusivalokesh-code/mini-crs/blob/main/frontend/src/pages/DealsPage.tsx): `frontend/src/pages/DealsPage.tsx`
- [Task workspace](https://github.com/badugusivalokesh-code/mini-crs/blob/main/frontend/src/pages/TasksPage.tsx): `frontend/src/pages/TasksPage.tsx`
- [Dashboard views](https://github.com/badugusivalokesh-code/mini-crs/blob/main/frontend/src/components/dashboard/PipelineValueChart.tsx): `frontend/src/components/dashboard/PipelineValueChart.tsx`
- [HTTP client](https://github.com/badugusivalokesh-code/mini-crs/blob/main/frontend/src/lib/apiClient.ts): `frontend/src/lib/apiClient.ts`

### Express API

- [API application](https://github.com/badugusivalokesh-code/mini-crs/blob/main/backend/src/app.ts): `backend/src/app.ts`
- [Authentication routes](https://github.com/badugusivalokesh-code/mini-crs/blob/main/backend/src/routes/auth.routes.ts): `backend/src/routes/auth.routes.ts`
- [Customer routes](https://github.com/badugusivalokesh-code/mini-crs/blob/main/backend/src/routes/customers.routes.ts): `backend/src/routes/customers.routes.ts`
- [Deal routes](https://github.com/badugusivalokesh-code/mini-crs/blob/main/backend/src/routes/deals.routes.ts): `backend/src/routes/deals.routes.ts`
- [Task routes](https://github.com/badugusivalokesh-code/mini-crs/blob/main/backend/src/routes/tasks.routes.ts): `backend/src/routes/tasks.routes.ts`
- [Dashboard route](https://github.com/badugusivalokesh-code/mini-crs/blob/main/backend/src/routes/dashboard.routes.ts): `backend/src/routes/dashboard.routes.ts`

### CRM services

- [Authentication logic](https://github.com/badugusivalokesh-code/mini-crs/blob/main/backend/src/services/authService.ts): `backend/src/services/authService.ts`
- [Customer logic](https://github.com/badugusivalokesh-code/mini-crs/blob/main/backend/src/services/customerService.ts): `backend/src/services/customerService.ts`
- [Deal logic](https://github.com/badugusivalokesh-code/mini-crs/blob/main/backend/src/services/dealService.ts): `backend/src/services/dealService.ts`
- [Task logic](https://github.com/badugusivalokesh-code/mini-crs/blob/main/backend/src/services/taskService.ts): `backend/src/services/taskService.ts`
- [Dashboard logic](https://github.com/badugusivalokesh-code/mini-crs/blob/main/backend/src/services/dashboardService.ts): `backend/src/services/dashboardService.ts`

### MongoDB persistence

- [User records](https://github.com/badugusivalokesh-code/mini-crs/blob/main/backend/src/models/User.ts): `backend/src/models/User.ts`
- [Customer records](https://github.com/badugusivalokesh-code/mini-crs/blob/main/backend/src/models/Customer.ts): `backend/src/models/Customer.ts`
- [Deal records](https://github.com/badugusivalokesh-code/mini-crs/blob/main/backend/src/models/Deal.ts): `backend/src/models/Deal.ts`
- [Task records](https://github.com/badugusivalokesh-code/mini-crs/blob/main/backend/src/models/Task.ts): `backend/src/models/Task.ts`
- [Dashboard aggregation](https://github.com/badugusivalokesh-code/mini-crs/blob/main/backend/src/models/Dashboard.ts): `backend/src/models/Dashboard.ts`

### Other components

- **CRM user**

## Connections

- CRM user → SPA and routing: uses
- SPA and routing → Auth experience: routes to
- SPA and routing → Customer workspace: routes to
- SPA and routing → Deal pipeline: routes to
- SPA and routing → Task workspace: routes to
- SPA and routing → Dashboard views: routes to
- Auth experience → HTTP client: requests through
- Customer workspace → HTTP client: requests through
- Deal pipeline → HTTP client: requests through
- Task workspace → HTTP client: requests through
- Dashboard views → HTTP client: requests through
- HTTP client → API application: sends API requests
- API application → Authentication routes: mounts (evidence: `backend/src/app.ts`)
- API application → Customer routes: mounts (evidence: `backend/src/app.ts`)
- API application → Deal routes: mounts (evidence: `backend/src/app.ts`)
- API application → Task routes: mounts (evidence: `backend/src/app.ts`)
- API application → Dashboard route: mounts (evidence: `backend/src/app.ts`)
- Authentication routes → Authentication logic: calls (evidence: `backend/src/routes/auth.routes.ts`)
- Customer routes → Customer logic: calls (evidence: `backend/src/routes/customers.routes.ts`)
- Deal routes → Deal logic: calls (evidence: `backend/src/routes/deals.routes.ts`)
- Task routes → Task logic: calls (evidence: `backend/src/routes/tasks.routes.ts`)
- Dashboard route → Dashboard logic: uses (evidence: `backend/src/routes/dashboard.routes.ts`)
- Authentication logic → User records: reads and writes (evidence: `backend/src/services/authService.ts`)
- Customer logic → Customer records: uses repository (evidence: `backend/src/services/customerService.ts`)
- Deal logic → Deal records: uses repository (evidence: `backend/src/services/dealService.ts`)
- Task logic → Task records: uses repository (evidence: `backend/src/services/taskService.ts`)
- Dashboard logic → Dashboard aggregation: uses repository
- Customer logic → Deal records: loads related deals (evidence: `backend/src/services/customerService.ts`)
- Customer logic → Task records: loads related tasks (evidence: `backend/src/services/customerService.ts`)
