# deekshasharma7/crm-coder architecture

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

- Interactive diagram: https://gitdiagram.com/deekshasharma7/crm-coder
- Repository: https://github.com/deekshasharma7/crm-coder

## Overview

This is a web-based CRM for managing leads and their sales-to-payment lifecycle, alongside operational records such as meetings, tasks, reminders, users, and bills. A lead can progress through quotation, invoice, payment, final-invoice, and completion stages; the dashboard also exposes lead summaries and other CRM areas. The tree documents broad client and server capabilities, while sampled source confirms authentication, lead and reminder handling, invoice summaries/PDF generation, and route mounting. Several unsampled client-to-API connections are therefore not drawn.

Main entry points: [`server/index.js`](https://github.com/deekshasharma7/crm-coder/blob/main/server/index.js) (API application), [`server/controllers/invoiceController.js`](https://github.com/deekshasharma7/crm-coder/blob/main/server/controllers/invoiceController.js) (Invoice operations), [`server/models`](https://github.com/deekshasharma7/crm-coder/tree/main/server/models) (CRM models), [`client/src/app/dashboard/page.tsx`](https://github.com/deekshasharma7/crm-coder/blob/main/client/src/app/dashboard/page.tsx) (Dashboard and CRM)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["CRM client"]
  node_dashboard["Dashboard and CRM<br/>[page.tsx]"]
  node_lead_ui["Lead workspace<br/>[page.tsx]"]
  node_pipeline["Sales pipeline"]
  node_resource_ui["CRM resource pages"]
  node_auth_state["Auth state<br/>[useAuth.ts]"]
  node_auth_client["Auth API client<br/>[authService.ts]"]
end

subgraph group_api["API runtime"]
  node_server["API application<br/>[index.js]"]
  node_lead_routes["Lead routes<br/>[leadRoutes.js]"]
  node_reminder_routes["Reminder routes<br/>[reminderRoutes.js]"]
  node_invoice_routes["Invoice routes<br/>[invoiceRoutes.js]"]
  node_auth_routes["Auth routes<br/>[authRoutes.js]"]
  node_lead_controller["Lead operations<br/>[leadController.js]"]
  node_reminder_controller["Reminder operations"]
  node_invoice_controller["Invoice operations"]
  node_auth_controller["Auth operations<br/>[authController.js]"]
end

subgraph group_domain["CRM domain data"]
  node_data_models["CRM models"]
  node_mongo[("MongoDB<br/>[db.js]")]
end

subgraph group_outputs["Documents and services"]
  node_invoice_pdf["Invoice PDF builders"]
  node_final_pdf["Final invoice PDF"]
end

node_user(("CRM user"))
node_api_service["CRM API"]

node_user -->|"uses"| node_dashboard
node_dashboard -->|"opens"| node_lead_ui
node_lead_ui -->|"shows stages"| node_pipeline
node_user -->|"manages records"| node_resource_ui
node_auth_state -->|"verifies token"| node_auth_client
node_auth_client -->|"sends auth requests"| node_api_service
node_api_service -->|"receives requests"| node_server
node_server -->|"mounts"| node_lead_routes
node_server -->|"mounts"| node_reminder_routes
node_server -->|"mounts"| node_invoice_routes
node_server -->|"mounts"| node_auth_routes
node_lead_routes -->|"dispatches"| node_lead_controller
node_reminder_routes -->|"dispatches"| node_reminder_controller
node_invoice_routes -->|"dispatches"| node_invoice_controller
node_auth_routes -->|"dispatches"| node_auth_controller
node_lead_controller -->|"reads/writes leads"| node_data_models
node_reminder_controller -->|"reads/writes reminders"| node_data_models
node_invoice_controller -->|"reads/writes invoices"| node_data_models
node_server -->|"connects"| node_mongo
node_invoice_controller -->|"builds invoice PDF"| node_invoice_pdf
node_invoice_controller -->|"builds final PDF"| node_final_pdf

click node_dashboard "https://github.com/deekshasharma7/crm-coder/blob/main/client/src/app/dashboard/page.tsx"
click node_lead_ui "https://github.com/deekshasharma7/crm-coder/blob/main/client/src/app/dashboard/leads/page.tsx"
click node_pipeline "https://github.com/deekshasharma7/crm-coder/blob/main/client/src/components/ui/PipelineStepper.tsx"
click node_resource_ui "https://github.com/deekshasharma7/crm-coder/tree/main/client/src/app/dashboard"
click node_auth_state "https://github.com/deekshasharma7/crm-coder/blob/main/client/src/hooks/useAuth.ts"
click node_auth_client "https://github.com/deekshasharma7/crm-coder/blob/main/client/src/services/authService.ts"
click node_server "https://github.com/deekshasharma7/crm-coder/blob/main/server/index.js"
click node_lead_routes "https://github.com/deekshasharma7/crm-coder/blob/main/server/routes/leadRoutes.js"
click node_reminder_routes "https://github.com/deekshasharma7/crm-coder/blob/main/server/routes/reminderRoutes.js"
click node_invoice_routes "https://github.com/deekshasharma7/crm-coder/blob/main/server/routes/invoiceRoutes.js"
click node_auth_routes "https://github.com/deekshasharma7/crm-coder/blob/main/server/routes/authRoutes.js"
click node_lead_controller "https://github.com/deekshasharma7/crm-coder/blob/main/server/controllers/leadController.js"
click node_reminder_controller "https://github.com/deekshasharma7/crm-coder/blob/main/server/controllers/reminderController.js"
click node_invoice_controller "https://github.com/deekshasharma7/crm-coder/blob/main/server/controllers/invoiceController.js"
click node_auth_controller "https://github.com/deekshasharma7/crm-coder/blob/main/server/controllers/authController.js"
click node_data_models "https://github.com/deekshasharma7/crm-coder/tree/main/server/models"
click node_mongo "https://github.com/deekshasharma7/crm-coder/blob/main/server/config/db.js"
click node_invoice_pdf "https://github.com/deekshasharma7/crm-coder/blob/main/server/utils/pdfInvoiceGenerator.js"
click node_final_pdf "https://github.com/deekshasharma7/crm-coder/blob/main/server/utils/pdfFinalInvoiceGenerator.js"

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_dashboard,node_lead_ui,node_pipeline,node_resource_ui,node_auth_state,node_auth_client,node_user toneBlue
class node_server,node_lead_routes,node_reminder_routes,node_invoice_routes,node_auth_routes,node_lead_controller,node_reminder_controller,node_invoice_controller,node_auth_controller toneAmber
class node_data_models,node_mongo,node_api_service toneMint
class node_invoice_pdf,node_final_pdf toneRose
```

## Components

### CRM client

- [Dashboard and CRM](https://github.com/deekshasharma7/crm-coder/blob/main/client/src/app/dashboard/page.tsx): `client/src/app/dashboard/page.tsx`
- [Lead workspace](https://github.com/deekshasharma7/crm-coder/blob/main/client/src/app/dashboard/leads/page.tsx): `client/src/app/dashboard/leads/page.tsx`
- [Sales pipeline](https://github.com/deekshasharma7/crm-coder/blob/main/client/src/components/ui/PipelineStepper.tsx): `client/src/components/ui/PipelineStepper.tsx`
- [CRM resource pages](https://github.com/deekshasharma7/crm-coder/tree/main/client/src/app/dashboard): `client/src/app/dashboard`
- [Auth state](https://github.com/deekshasharma7/crm-coder/blob/main/client/src/hooks/useAuth.ts): `client/src/hooks/useAuth.ts`
- [Auth API client](https://github.com/deekshasharma7/crm-coder/blob/main/client/src/services/authService.ts): `client/src/services/authService.ts`

### API runtime

- [API application](https://github.com/deekshasharma7/crm-coder/blob/main/server/index.js): `server/index.js`
- [Lead routes](https://github.com/deekshasharma7/crm-coder/blob/main/server/routes/leadRoutes.js): `server/routes/leadRoutes.js`
- [Reminder routes](https://github.com/deekshasharma7/crm-coder/blob/main/server/routes/reminderRoutes.js): `server/routes/reminderRoutes.js`
- [Invoice routes](https://github.com/deekshasharma7/crm-coder/blob/main/server/routes/invoiceRoutes.js): `server/routes/invoiceRoutes.js`
- [Auth routes](https://github.com/deekshasharma7/crm-coder/blob/main/server/routes/authRoutes.js): `server/routes/authRoutes.js`
- [Lead operations](https://github.com/deekshasharma7/crm-coder/blob/main/server/controllers/leadController.js): `server/controllers/leadController.js`
- [Reminder operations](https://github.com/deekshasharma7/crm-coder/blob/main/server/controllers/reminderController.js): `server/controllers/reminderController.js`
- [Invoice operations](https://github.com/deekshasharma7/crm-coder/blob/main/server/controllers/invoiceController.js): `server/controllers/invoiceController.js`
- [Auth operations](https://github.com/deekshasharma7/crm-coder/blob/main/server/controllers/authController.js): `server/controllers/authController.js`

### CRM domain data

- [CRM models](https://github.com/deekshasharma7/crm-coder/tree/main/server/models): `server/models`
- [MongoDB](https://github.com/deekshasharma7/crm-coder/blob/main/server/config/db.js): `server/config/db.js`

### Documents and services

- [Invoice PDF builders](https://github.com/deekshasharma7/crm-coder/blob/main/server/utils/pdfInvoiceGenerator.js): `server/utils/pdfInvoiceGenerator.js`
- [Final invoice PDF](https://github.com/deekshasharma7/crm-coder/blob/main/server/utils/pdfFinalInvoiceGenerator.js): `server/utils/pdfFinalInvoiceGenerator.js`

### Other components

- **CRM user**
- **CRM API**

## Connections

- CRM user → Dashboard and CRM: uses
- Dashboard and CRM → Lead workspace: opens
- Lead workspace → Sales pipeline: shows stages
- CRM user → CRM resource pages: manages records
- Auth state → Auth API client: verifies token
- Auth API client → CRM API: sends auth requests
- CRM API → API application: receives requests
- API application → Lead routes: mounts
- API application → Reminder routes: mounts
- API application → Invoice routes: mounts
- API application → Auth routes: mounts
- Lead routes → Lead operations: dispatches
- Reminder routes → Reminder operations: dispatches
- Invoice routes → Invoice operations: dispatches
- Auth routes → Auth operations: dispatches
- Lead operations → CRM models: reads/writes leads
- Reminder operations → CRM models: reads/writes reminders
- Invoice operations → CRM models: reads/writes invoices
- API application → MongoDB: connects
- Invoice operations → Invoice PDF builders: builds invoice PDF
- Invoice operations → Final invoice PDF: builds final PDF
