# mohebhemaya/fastcrm architecture

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

- Interactive diagram: https://gitdiagram.com/mohebhemaya/fastcrm
- Repository: https://github.com/mohebhemaya/fastcrm

## Overview

Fastcrm is a driver-operations CRM with a frontend and Laravel API. Staff manage drivers, imports, questionnaires, work orders, exports, and WhatsApp communications; the central dispatch workflow matches drivers to an order, sends offers, and tracks responses and follow-up. The graph reflects documented and indexed backend relationships. The README provides no capability detail, and several frontend and backend subsystems are unsampled, so their links are shown only where evidence supports them or omitted.

Main entry points: [`backend/app/Http/Controllers/Api/WorkOrderController.php`](https://github.com/mohebhemaya/fastcrm/blob/main/backend/app/Http/Controllers/Api/WorkOrderController.php) (Work order management), [`backend/app/Services/DriverMatcher.php`](https://github.com/mohebhemaya/fastcrm/blob/main/backend/app/Services/DriverMatcher.php) (Driver matching), [`backend/app/Jobs/ProcessWebhookEventJob.php`](https://github.com/mohebhemaya/fastcrm/blob/main/backend/app/Jobs/ProcessWebhookEventJob.php) (Webhook processing), [`backend/app/Services/WorkOrderFollowUpService.php`](https://github.com/mohebhemaya/fastcrm/blob/main/backend/app/Services/WorkOrderFollowUpService.php) (Outcomes and follow-up)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["Staff interface"]
  node_frontend["CRM frontend<br/>[App.tsx]"]
end

subgraph group_ops["Driver operations"]
  node_api["Laravel API<br/>[api.php]"]
  node_drivers[("Driver records<br/>[Driver.php]")]
  node_imports["Driver imports<br/>[ParseImportJob.php]"]
  node_questionnaire[("Questionnaires<br/>[Question.php]")]
  node_exports["Exports and reports<br/>[ExportService.php]"]
end

subgraph group_dispatch["Orders and dispatch"]
  node_workorders["Work order management"]
  node_matching["Driver matching<br/>[DriverMatcher.php]"]
  node_orderflow["Order lifecycle"]
  node_followup["Outcomes and follow-up"]
  node_recipients[("Order recipients")]
end

subgraph group_messaging["WhatsApp messaging"]
  node_webhook["Webhook intake"]
  node_webhookjob["Webhook processing"]
  node_inbound["Inbound routing"]
  node_status["Delivery status updates"]
  node_sender["Message sending<br/>[MessageSender.php]"]
  node_sendjob["Queued message delivery"]
  node_provider["WhatsApp provider"]
end

node_staff(("Operations staff"))
node_whatsapp(("WhatsApp"))

node_staff -.->|"uses"| node_frontend
node_frontend -.->|"requests data"| node_api
node_workorders -->|"delegates"| node_orderflow
node_workorders -->|"requests matches"| node_matching
node_workorders -->|"sends offers"| node_sender
node_matching -->|"queries"| node_drivers
node_matching -->|"filters by answers"| node_questionnaire
node_orderflow -.->|"assigns drivers"| node_recipients
node_followup -->|"updates outcomes"| node_recipients
node_followup -->|"updates status"| node_drivers
node_webhook -->|"queues events"| node_webhookjob
node_webhookjob -->|"routes messages"| node_inbound
node_webhookjob -->|"updates statuses"| node_status
node_sender -->|"dispatches"| node_sendjob
node_sendjob -.->|"delivers through"| node_provider
node_whatsapp -.->|"posts events"| node_webhook
node_provider -.->|"connects to"| node_whatsapp

click node_frontend "https://github.com/mohebhemaya/fastcrm/blob/main/frontend/src/App.tsx"
click node_api "https://github.com/mohebhemaya/fastcrm/blob/main/backend/routes/api.php"
click node_drivers "https://github.com/mohebhemaya/fastcrm/blob/main/backend/app/Models/Driver.php"
click node_imports "https://github.com/mohebhemaya/fastcrm/blob/main/backend/app/Jobs/ParseImportJob.php"
click node_questionnaire "https://github.com/mohebhemaya/fastcrm/blob/main/backend/app/Models/Question.php"
click node_workorders "https://github.com/mohebhemaya/fastcrm/blob/main/backend/app/Http/Controllers/Api/WorkOrderController.php"
click node_matching "https://github.com/mohebhemaya/fastcrm/blob/main/backend/app/Services/DriverMatcher.php"
click node_orderflow "https://github.com/mohebhemaya/fastcrm/blob/main/backend/app/Services/WorkOrderService.php"
click node_followup "https://github.com/mohebhemaya/fastcrm/blob/main/backend/app/Services/WorkOrderFollowUpService.php"
click node_recipients "https://github.com/mohebhemaya/fastcrm/blob/main/backend/app/Models/WorkOrderRecipient.php"
click node_webhook "https://github.com/mohebhemaya/fastcrm/blob/main/backend/app/Http/Controllers/WebhookController.php"
click node_webhookjob "https://github.com/mohebhemaya/fastcrm/blob/main/backend/app/Jobs/ProcessWebhookEventJob.php"
click node_inbound "https://github.com/mohebhemaya/fastcrm/blob/main/backend/app/Services/InboundMessageRouter.php"
click node_status "https://github.com/mohebhemaya/fastcrm/blob/main/backend/app/Services/WebhookStatusUpdater.php"
click node_sender "https://github.com/mohebhemaya/fastcrm/blob/main/backend/app/Services/MessageSender.php"
click node_sendjob "https://github.com/mohebhemaya/fastcrm/blob/main/backend/app/Jobs/SendWhatsAppMessageJob.php"
click node_provider "https://github.com/mohebhemaya/fastcrm/blob/main/backend/app/Contracts/WhatsAppProvider.php"
click node_exports "https://github.com/mohebhemaya/fastcrm/blob/main/backend/app/Services/ExportService.php"

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 toneBlue
class node_api,node_drivers,node_imports,node_questionnaire,node_exports toneAmber
class node_workorders,node_matching,node_orderflow,node_followup,node_recipients toneMint
class node_webhook,node_webhookjob,node_inbound,node_status,node_sender,node_sendjob,node_provider toneRose
class node_staff,node_whatsapp toneIndigo
```

## Components

### Staff interface

- [CRM frontend](https://github.com/mohebhemaya/fastcrm/blob/main/frontend/src/App.tsx): `frontend/src/App.tsx`

### Driver operations

- [Laravel API](https://github.com/mohebhemaya/fastcrm/blob/main/backend/routes/api.php): `backend/routes/api.php`
- [Driver records](https://github.com/mohebhemaya/fastcrm/blob/main/backend/app/Models/Driver.php): `backend/app/Models/Driver.php`
- [Driver imports](https://github.com/mohebhemaya/fastcrm/blob/main/backend/app/Jobs/ParseImportJob.php): `backend/app/Jobs/ParseImportJob.php`
- [Questionnaires](https://github.com/mohebhemaya/fastcrm/blob/main/backend/app/Models/Question.php): `backend/app/Models/Question.php`
- [Exports and reports](https://github.com/mohebhemaya/fastcrm/blob/main/backend/app/Services/ExportService.php): `backend/app/Services/ExportService.php`

### Orders and dispatch

- [Work order management](https://github.com/mohebhemaya/fastcrm/blob/main/backend/app/Http/Controllers/Api/WorkOrderController.php): `backend/app/Http/Controllers/Api/WorkOrderController.php`
- [Driver matching](https://github.com/mohebhemaya/fastcrm/blob/main/backend/app/Services/DriverMatcher.php): `backend/app/Services/DriverMatcher.php`
- [Order lifecycle](https://github.com/mohebhemaya/fastcrm/blob/main/backend/app/Services/WorkOrderService.php): `backend/app/Services/WorkOrderService.php`
- [Outcomes and follow-up](https://github.com/mohebhemaya/fastcrm/blob/main/backend/app/Services/WorkOrderFollowUpService.php): `backend/app/Services/WorkOrderFollowUpService.php`
- [Order recipients](https://github.com/mohebhemaya/fastcrm/blob/main/backend/app/Models/WorkOrderRecipient.php): `backend/app/Models/WorkOrderRecipient.php`

### WhatsApp messaging

- [Webhook intake](https://github.com/mohebhemaya/fastcrm/blob/main/backend/app/Http/Controllers/WebhookController.php): `backend/app/Http/Controllers/WebhookController.php`
- [Webhook processing](https://github.com/mohebhemaya/fastcrm/blob/main/backend/app/Jobs/ProcessWebhookEventJob.php): `backend/app/Jobs/ProcessWebhookEventJob.php`
- [Inbound routing](https://github.com/mohebhemaya/fastcrm/blob/main/backend/app/Services/InboundMessageRouter.php): `backend/app/Services/InboundMessageRouter.php`
- [Delivery status updates](https://github.com/mohebhemaya/fastcrm/blob/main/backend/app/Services/WebhookStatusUpdater.php): `backend/app/Services/WebhookStatusUpdater.php`
- [Message sending](https://github.com/mohebhemaya/fastcrm/blob/main/backend/app/Services/MessageSender.php): `backend/app/Services/MessageSender.php`
- [Queued message delivery](https://github.com/mohebhemaya/fastcrm/blob/main/backend/app/Jobs/SendWhatsAppMessageJob.php): `backend/app/Jobs/SendWhatsAppMessageJob.php`
- [WhatsApp provider](https://github.com/mohebhemaya/fastcrm/blob/main/backend/app/Contracts/WhatsAppProvider.php): `backend/app/Contracts/WhatsAppProvider.php`

### Other components

- **Operations staff**
- **WhatsApp**

## Connections

- Operations staff → CRM frontend: uses
- CRM frontend → Laravel API: requests data
- Work order management → Order lifecycle: delegates (evidence: `backend/app/Http/Controllers/Api/WorkOrderController.php`)
- Work order management → Driver matching: requests matches (evidence: `backend/app/Http/Controllers/Api/WorkOrderController.php`)
- Work order management → Message sending: sends offers (evidence: `backend/app/Http/Controllers/Api/WorkOrderController.php`)
- Driver matching → Driver records: queries (evidence: `backend/app/Services/DriverMatcher.php`)
- Driver matching → Questionnaires: filters by answers (evidence: `backend/app/Services/DriverMatcher.php`)
- Order lifecycle → Order recipients: assigns drivers
- Outcomes and follow-up → Order recipients: updates outcomes (evidence: `backend/app/Services/WorkOrderFollowUpService.php`)
- Outcomes and follow-up → Driver records: updates status (evidence: `backend/app/Services/WorkOrderFollowUpService.php`)
- Webhook intake → Webhook processing: queues events (evidence: `backend/app/Http/Controllers/WebhookController.php`)
- Webhook processing → Inbound routing: routes messages (evidence: `backend/app/Jobs/ProcessWebhookEventJob.php`)
- Webhook processing → Delivery status updates: updates statuses (evidence: `backend/app/Jobs/ProcessWebhookEventJob.php`)
- Message sending → Queued message delivery: dispatches (evidence: `backend/app/Services/MessageSender.php`)
- Queued message delivery → WhatsApp provider: delivers through
- WhatsApp → Webhook intake: posts events
- WhatsApp provider → WhatsApp: connects to
