# carrummobility/frappe-core architecture

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

- Interactive diagram: https://gitdiagram.com/carrummobility/frappe-core
- Repository: https://github.com/carrummobility/frappe-core

## Overview

Core is a Frappe app supporting Carrum’s CRM operations, especially lead management, telephony, payment and messaging integrations, and operational reporting. The visible workflow spans lead synchronization, call-session handling and agent performance tracking; separate capabilities include WhatsApp through Chatwoot, Carrum account/configuration APIs, and optional S3 file storage. The README describes the app as a dependency for Frappe CRM and Chatwoot Integration. Source excerpts are partial, so connections between unsampled API routes and services are not inferred.

Main entry points: [`core/integrations/chatwoot/client.py`](https://github.com/carrummobility/frappe-core/blob/main/core/integrations/chatwoot/client.py) (Chatwoot Client), [`core/services/apihit_service.py`](https://github.com/carrummobility/frappe-core/blob/main/core/services/apihit_service.py) (API Hit Logging), [`core/integrations/smartflo/client.py`](https://github.com/carrummobility/frappe-core/blob/main/core/integrations/smartflo/client.py) (Smartflo Client), [`core/integrations/callmatic/client.py`](https://github.com/carrummobility/frappe-core/blob/main/core/integrations/callmatic/client.py) (Callmatic Client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_crm["CRM Operations"]
  node_lead_service["Lead Service<br/>[lead_service.py]"]
  node_crm_leads[("CRM Leads")]
  node_payment_api["Payment API<br/>[carrum_payment.py]"]
  node_agent_performance["Agent Performance"]
  node_performance_dashboard["Performance Dashboard"]
  node_payment_logs[("Payment Logs<br/>[payment_logs.py]")]
end

subgraph group_telephony["Telephony"]
  node_call_api["Call API<br/>[call.py]"]
  node_call_service["Call Service<br/>[call_service.py]"]
  node_call_sessions[("Call Sessions<br/>[call_session.py]")]
  node_smartflo["Smartflo Client<br/>[client.py]"]
  node_callmatic["Callmatic Client<br/>[client.py]"]
end

subgraph group_messaging["Messaging"]
  node_whatsapp_service["WhatsApp Service"]
  node_chatwoot_client["Chatwoot Client<br/>[client.py]"]
  node_carrum_whatsapp["Carrum WhatsApp API<br/>[carrum_whatsapp.py]"]
end

subgraph group_platform["Platform Services"]
  node_carrum_accounts["Carrum Accounts API<br/>[carrum_accounts.py]"]
  node_api_hit_service["API Hit Logging<br/>[apihit_service.py]"]
  node_api_hit_logs[("API Hit Logs<br/>[api_hit_log.py]")]
  node_s3_storage["S3 File Storage<br/>[s3_file_storage.py]"]
end

node_user(("CRM User"))
node_call_vendor{{"Call Providers"}}
node_chatwoot{{"Chatwoot"}}
node_carrum_services{{"Carrum APIs"}}
node_s3[("S3 Object Store")]

node_user -->|"requests calls"| node_call_api
node_lead_service -->|"reads and writes"| node_crm_leads
node_whatsapp_service -->|"sends messages"| node_chatwoot_client
node_whatsapp_service -->|"fetches templates"| node_carrum_whatsapp
node_chatwoot_client -->|"loads user config"| node_carrum_accounts
node_chatwoot_client -->|"sends and fetches"| node_chatwoot
node_carrum_accounts -->|"requests account data"| node_carrum_services
node_carrum_whatsapp -->|"requests templates"| node_carrum_services
node_callmatic -->|"triggers calls"| node_call_vendor
node_smartflo -->|"requests telephony"| node_call_vendor
node_callmatic -->|"logs request"| node_api_hit_service
node_smartflo -->|"logs request"| node_api_hit_service
node_api_hit_service -->|"records hits"| node_api_hit_logs
node_s3_storage -.->|"reads and writes"| node_s3

click node_lead_service "https://github.com/carrummobility/frappe-core/blob/main/core/services/crm_lead/lead_service.py"
click node_payment_api "https://github.com/carrummobility/frappe-core/blob/main/core/api/carrum_payment.py"
click node_agent_performance "https://github.com/carrummobility/frappe-core/blob/main/core/services/agent_performance.py"
click node_performance_dashboard "https://github.com/carrummobility/frappe-core/blob/main/core/services/agent_performance_dashboard.py"
click node_call_api "https://github.com/carrummobility/frappe-core/blob/main/core/api/call.py"
click node_call_service "https://github.com/carrummobility/frappe-core/blob/main/core/services/call_service.py"
click node_call_sessions "https://github.com/carrummobility/frappe-core/blob/main/core/platform/doctype/call_session/call_session.py"
click node_smartflo "https://github.com/carrummobility/frappe-core/blob/main/core/integrations/smartflo/client.py"
click node_callmatic "https://github.com/carrummobility/frappe-core/blob/main/core/integrations/callmatic/client.py"
click node_whatsapp_service "https://github.com/carrummobility/frappe-core/blob/main/core/services/whatsapp/whatsapp_service.py"
click node_chatwoot_client "https://github.com/carrummobility/frappe-core/blob/main/core/integrations/chatwoot/client.py"
click node_carrum_whatsapp "https://github.com/carrummobility/frappe-core/blob/main/core/api/carrum_whatsapp.py"
click node_carrum_accounts "https://github.com/carrummobility/frappe-core/blob/main/core/api/carrum_accounts.py"
click node_api_hit_service "https://github.com/carrummobility/frappe-core/blob/main/core/services/apihit_service.py"
click node_api_hit_logs "https://github.com/carrummobility/frappe-core/blob/main/core/platform/doctype/api_hit_log/api_hit_log.py"
click node_s3_storage "https://github.com/carrummobility/frappe-core/blob/main/core/s3_file_storage.py"
click node_payment_logs "https://github.com/carrummobility/frappe-core/blob/main/core/platform/doctype/payment_logs/payment_logs.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_lead_service,node_crm_leads,node_payment_api,node_agent_performance,node_performance_dashboard,node_payment_logs,node_user toneBlue
class node_call_api,node_call_service,node_call_sessions,node_smartflo,node_callmatic,node_s3 toneAmber
class node_whatsapp_service,node_chatwoot_client,node_carrum_whatsapp,node_carrum_services toneMint
class node_carrum_accounts,node_api_hit_service,node_api_hit_logs,node_s3_storage toneRose
class node_call_vendor,node_chatwoot toneIndigo
```

## Components

### CRM Operations

- [Lead Service](https://github.com/carrummobility/frappe-core/blob/main/core/services/crm_lead/lead_service.py): `core/services/crm_lead/lead_service.py`
- **CRM Leads**
- [Payment API](https://github.com/carrummobility/frappe-core/blob/main/core/api/carrum_payment.py): `core/api/carrum_payment.py`
- [Agent Performance](https://github.com/carrummobility/frappe-core/blob/main/core/services/agent_performance.py): `core/services/agent_performance.py`
- [Performance Dashboard](https://github.com/carrummobility/frappe-core/blob/main/core/services/agent_performance_dashboard.py): `core/services/agent_performance_dashboard.py`
- [Payment Logs](https://github.com/carrummobility/frappe-core/blob/main/core/platform/doctype/payment_logs/payment_logs.py): `core/platform/doctype/payment_logs/payment_logs.py`

### Telephony

- [Call API](https://github.com/carrummobility/frappe-core/blob/main/core/api/call.py): `core/api/call.py`
- [Call Service](https://github.com/carrummobility/frappe-core/blob/main/core/services/call_service.py): `core/services/call_service.py`
- [Call Sessions](https://github.com/carrummobility/frappe-core/blob/main/core/platform/doctype/call_session/call_session.py): `core/platform/doctype/call_session/call_session.py`
- [Smartflo Client](https://github.com/carrummobility/frappe-core/blob/main/core/integrations/smartflo/client.py): `core/integrations/smartflo/client.py`
- [Callmatic Client](https://github.com/carrummobility/frappe-core/blob/main/core/integrations/callmatic/client.py): `core/integrations/callmatic/client.py`

### Messaging

- [WhatsApp Service](https://github.com/carrummobility/frappe-core/blob/main/core/services/whatsapp/whatsapp_service.py): `core/services/whatsapp/whatsapp_service.py`
- [Chatwoot Client](https://github.com/carrummobility/frappe-core/blob/main/core/integrations/chatwoot/client.py): `core/integrations/chatwoot/client.py`
- [Carrum WhatsApp API](https://github.com/carrummobility/frappe-core/blob/main/core/api/carrum_whatsapp.py): `core/api/carrum_whatsapp.py`

### Platform Services

- [Carrum Accounts API](https://github.com/carrummobility/frappe-core/blob/main/core/api/carrum_accounts.py): `core/api/carrum_accounts.py`
- [API Hit Logging](https://github.com/carrummobility/frappe-core/blob/main/core/services/apihit_service.py): `core/services/apihit_service.py`
- [API Hit Logs](https://github.com/carrummobility/frappe-core/blob/main/core/platform/doctype/api_hit_log/api_hit_log.py): `core/platform/doctype/api_hit_log/api_hit_log.py`
- [S3 File Storage](https://github.com/carrummobility/frappe-core/blob/main/core/s3_file_storage.py): `core/s3_file_storage.py`

### Other components

- **CRM User**
- **Call Providers**
- **Chatwoot**
- **Carrum APIs**
- **S3 Object Store**

## Connections

- CRM User → Call API: requests calls
- Lead Service → CRM Leads: reads and writes
- WhatsApp Service → Chatwoot Client: sends messages
- WhatsApp Service → Carrum WhatsApp API: fetches templates
- Chatwoot Client → Carrum Accounts API: loads user config
- Chatwoot Client → Chatwoot: sends and fetches
- Carrum Accounts API → Carrum APIs: requests account data
- Carrum WhatsApp API → Carrum APIs: requests templates
- Callmatic Client → Call Providers: triggers calls
- Smartflo Client → Call Providers: requests telephony
- Callmatic Client → API Hit Logging: logs request
- Smartflo Client → API Hit Logging: logs request
- API Hit Logging → API Hit Logs: records hits
- S3 File Storage → S3 Object Store: reads and writes
