# frappe/crm architecture

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

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

## Overview

Frappe CRM is a sales-team CRM built on Frappe, with a Vue interface for managing leads, deals, contacts and their activities. A central workflow is navigating CRM views and working a lead or deal through its details and related activity; the README also highlights Kanban and customizable views. Separate capabilities include website-based domain enrichment, service-level tracking, telephony, WhatsApp and ERPNext integration. The enrichment flow is visible in sampled source; several other links reflect README-described capabilities, since their runtime wiring was not sampled.

Main entry points: [`frontend/src/App.vue`](https://github.com/frappe/crm/blob/develop/frontend/src/App.vue) (CRM interface), [`crm/domain_enrichment/tasks.py`](https://github.com/frappe/crm/blob/develop/crm/domain_enrichment/tasks.py) (Enrichment jobs), [`crm/domain_enrichment/pipeline.py`](https://github.com/frappe/crm/blob/develop/crm/domain_enrichment/pipeline.py) (Enrichment pipeline), [`frontend/src/components/Kanban/KanbanView.vue`](https://github.com/frappe/crm/blob/develop/frontend/src/components/Kanban/KanbanView.vue) (Views and Kanban)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["CRM experience"]
  node_frontend["CRM interface<br/>[App.vue]"]
  node_views["Views and Kanban<br/>[KanbanView.vue]"]
  node_activity["Record activity<br/>[Activities.vue]"]
end

subgraph group_sales["Sales records"]
  node_form_api["Record forms API<br/>[form.py]"]
  node_lead[("Lead records<br/>[crm_lead.py]")]
  node_deal[("Deal records<br/>[crm_deal.py]")]
  node_contact[("Contact records<br/>[crm_contacts.py]")]
end

subgraph group_enrichment["Website enrichment"]
  node_enrich_settings[("Enrichment config<br/>[config.py]")]
  node_enrich_tasks["Enrichment jobs<br/>[tasks.py]"]
  node_enrich_pipeline["Enrichment pipeline<br/>[pipeline.py]"]
  node_crawler["Website crawler<br/>[crawler.py]"]
  node_extractors["Data extraction<br/>[extractors.py]"]
  node_mapper["Field mapper<br/>[mapper.py]"]
  node_run_history[("Enrichment history")]
end

subgraph group_operations["Sales operations"]
  node_dashboard["Sales dashboard<br/>[crm_dashboard.py]"]
  node_sla["Service-level tracking"]
end

subgraph group_integrations["Integrations"]
  node_twilio["Twilio calls<br/>[twilio_handler.py]"]
  node_exotel["Exotel calls<br/>[handler.py]"]
  node_whatsapp["WhatsApp messaging<br/>[whatsapp.py]"]
  node_erpnext["ERPNext bridge<br/>[mirror_sync.py]"]
end

node_user(("Sales team"))
node_website(("Company website"))
node_telephony_services{{"Telephony providers"}}
node_erp_system{{"ERPNext"}}
node_whatsapp_service{{"Frappe WhatsApp"}}

node_user -->|"uses"| node_frontend
node_frontend -.->|"shows views"| node_views
node_frontend -.->|"shows activity"| node_activity
node_views -.->|"organizes"| node_lead
node_views -.->|"organizes"| node_deal
node_activity -.->|"supports"| node_lead
node_activity -.->|"supports"| node_deal
node_frontend -.->|"submits forms"| node_form_api
node_form_api -->|"references"| node_deal
node_user -.->|"starts enrichment"| node_enrich_tasks
node_enrich_tasks -->|"runs pipeline"| node_enrich_pipeline
node_enrich_pipeline -.->|"loads config"| node_enrich_settings
node_enrich_pipeline -->|"crawls site"| node_crawler
node_enrich_pipeline -->|"extracts data"| node_extractors
node_enrich_tasks -->|"maps fields"| node_mapper
node_enrich_tasks -->|"writes history"| node_run_history
node_website -.->|"provides pages"| node_crawler
node_extractors -.->|"supplies results"| node_mapper
node_user -.->|"reviews metrics"| node_dashboard
node_user -.->|"configures tracking"| node_sla
node_user -.->|"places calls"| node_twilio
node_user -.->|"places calls"| node_exotel
node_twilio -.->|"connects to"| node_telephony_services
node_exotel -.->|"connects to"| node_telephony_services
node_user -.->|"sends messages"| node_whatsapp
node_whatsapp -.->|"integrates with"| node_whatsapp_service
node_user -.->|"uses integration"| node_erpnext
node_erpnext -.->|"syncs records"| node_erp_system

click node_frontend "https://github.com/frappe/crm/blob/develop/frontend/src/App.vue"
click node_views "https://github.com/frappe/crm/blob/develop/frontend/src/components/Kanban/KanbanView.vue"
click node_activity "https://github.com/frappe/crm/blob/develop/frontend/src/components/Activities/Activities.vue"
click node_form_api "https://github.com/frappe/crm/blob/develop/crm/api/form.py"
click node_lead "https://github.com/frappe/crm/blob/develop/crm/fcrm/doctype/crm_lead/crm_lead.py"
click node_deal "https://github.com/frappe/crm/blob/develop/crm/fcrm/doctype/crm_deal/crm_deal.py"
click node_contact "https://github.com/frappe/crm/blob/develop/crm/fcrm/doctype/crm_contacts/crm_contacts.py"
click node_dashboard "https://github.com/frappe/crm/blob/develop/crm/fcrm/doctype/crm_dashboard/crm_dashboard.py"
click node_enrich_settings "https://github.com/frappe/crm/blob/develop/crm/domain_enrichment/config.py"
click node_enrich_tasks "https://github.com/frappe/crm/blob/develop/crm/domain_enrichment/tasks.py"
click node_enrich_pipeline "https://github.com/frappe/crm/blob/develop/crm/domain_enrichment/pipeline.py"
click node_crawler "https://github.com/frappe/crm/blob/develop/crm/domain_enrichment/crawler.py"
click node_extractors "https://github.com/frappe/crm/blob/develop/crm/domain_enrichment/extractors.py"
click node_mapper "https://github.com/frappe/crm/blob/develop/crm/domain_enrichment/mapper.py"
click node_run_history "https://github.com/frappe/crm/blob/develop/crm/domain_enrichment/doctype/crm_enrichment_run/crm_enrichment_run.py"
click node_sla "https://github.com/frappe/crm/blob/develop/crm/fcrm/doctype/crm_service_level_agreement/crm_service_level_agreement.py"
click node_twilio "https://github.com/frappe/crm/blob/develop/crm/integrations/twilio/twilio_handler.py"
click node_exotel "https://github.com/frappe/crm/blob/develop/crm/integrations/exotel/handler.py"
click node_whatsapp "https://github.com/frappe/crm/blob/develop/crm/api/whatsapp.py"
click node_erpnext "https://github.com/frappe/crm/blob/develop/crm/integrations/erpnext/mirror_sync.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_views,node_activity toneBlue
class node_form_api,node_lead,node_deal,node_contact toneAmber
class node_enrich_settings,node_enrich_tasks,node_enrich_pipeline,node_crawler,node_extractors,node_mapper,node_run_history toneMint
class node_dashboard,node_sla toneRose
class node_twilio,node_exotel,node_whatsapp,node_erpnext,node_user,node_website,node_telephony_services,node_erp_system,node_whatsapp_service toneIndigo
```

## Components

### CRM experience

- [CRM interface](https://github.com/frappe/crm/blob/develop/frontend/src/App.vue): `frontend/src/App.vue`
- [Views and Kanban](https://github.com/frappe/crm/blob/develop/frontend/src/components/Kanban/KanbanView.vue): `frontend/src/components/Kanban/KanbanView.vue`
- [Record activity](https://github.com/frappe/crm/blob/develop/frontend/src/components/Activities/Activities.vue): `frontend/src/components/Activities/Activities.vue`

### Sales records

- [Record forms API](https://github.com/frappe/crm/blob/develop/crm/api/form.py): `crm/api/form.py`
- [Lead records](https://github.com/frappe/crm/blob/develop/crm/fcrm/doctype/crm_lead/crm_lead.py): `crm/fcrm/doctype/crm_lead/crm_lead.py`
- [Deal records](https://github.com/frappe/crm/blob/develop/crm/fcrm/doctype/crm_deal/crm_deal.py): `crm/fcrm/doctype/crm_deal/crm_deal.py`
- [Contact records](https://github.com/frappe/crm/blob/develop/crm/fcrm/doctype/crm_contacts/crm_contacts.py): `crm/fcrm/doctype/crm_contacts/crm_contacts.py`

### Website enrichment

- [Enrichment config](https://github.com/frappe/crm/blob/develop/crm/domain_enrichment/config.py): `crm/domain_enrichment/config.py`
- [Enrichment jobs](https://github.com/frappe/crm/blob/develop/crm/domain_enrichment/tasks.py): `crm/domain_enrichment/tasks.py`
- [Enrichment pipeline](https://github.com/frappe/crm/blob/develop/crm/domain_enrichment/pipeline.py): `crm/domain_enrichment/pipeline.py`
- [Website crawler](https://github.com/frappe/crm/blob/develop/crm/domain_enrichment/crawler.py): `crm/domain_enrichment/crawler.py`
- [Data extraction](https://github.com/frappe/crm/blob/develop/crm/domain_enrichment/extractors.py): `crm/domain_enrichment/extractors.py`
- [Field mapper](https://github.com/frappe/crm/blob/develop/crm/domain_enrichment/mapper.py): `crm/domain_enrichment/mapper.py`
- [Enrichment history](https://github.com/frappe/crm/blob/develop/crm/domain_enrichment/doctype/crm_enrichment_run/crm_enrichment_run.py): `crm/domain_enrichment/doctype/crm_enrichment_run/crm_enrichment_run.py`

### Sales operations

- [Sales dashboard](https://github.com/frappe/crm/blob/develop/crm/fcrm/doctype/crm_dashboard/crm_dashboard.py): `crm/fcrm/doctype/crm_dashboard/crm_dashboard.py`
- [Service-level tracking](https://github.com/frappe/crm/blob/develop/crm/fcrm/doctype/crm_service_level_agreement/crm_service_level_agreement.py): `crm/fcrm/doctype/crm_service_level_agreement/crm_service_level_agreement.py`

### Integrations

- [Twilio calls](https://github.com/frappe/crm/blob/develop/crm/integrations/twilio/twilio_handler.py): `crm/integrations/twilio/twilio_handler.py`
- [Exotel calls](https://github.com/frappe/crm/blob/develop/crm/integrations/exotel/handler.py): `crm/integrations/exotel/handler.py`
- [WhatsApp messaging](https://github.com/frappe/crm/blob/develop/crm/api/whatsapp.py): `crm/api/whatsapp.py`
- [ERPNext bridge](https://github.com/frappe/crm/blob/develop/crm/integrations/erpnext/mirror_sync.py): `crm/integrations/erpnext/mirror_sync.py`

### Other components

- **Sales team**
- **Company website**
- **Telephony providers**
- **ERPNext**
- **Frappe WhatsApp**

## Connections

- Sales team → CRM interface: uses (evidence: `README.md`)
- CRM interface → Views and Kanban: shows views
- CRM interface → Record activity: shows activity
- Views and Kanban → Lead records: organizes
- Views and Kanban → Deal records: organizes
- Record activity → Lead records: supports
- Record activity → Deal records: supports
- CRM interface → Record forms API: submits forms
- Record forms API → Deal records: references (evidence: `crm/api/form.py`)
- Sales team → Enrichment jobs: starts enrichment
- Enrichment jobs → Enrichment pipeline: runs pipeline (evidence: `crm/domain_enrichment/tasks.py`)
- Enrichment pipeline → Enrichment config: loads config (evidence: `crm/domain_enrichment/pipeline.py`)
- Enrichment pipeline → Website crawler: crawls site (evidence: `crm/domain_enrichment/pipeline.py`)
- Enrichment pipeline → Data extraction: extracts data (evidence: `crm/domain_enrichment/pipeline.py`)
- Enrichment jobs → Field mapper: maps fields (evidence: `crm/domain_enrichment/tasks.py`)
- Enrichment jobs → Enrichment history: writes history (evidence: `crm/domain_enrichment/tasks.py`)
- Company website → Website crawler: provides pages
- Data extraction → Field mapper: supplies results
- Sales team → Sales dashboard: reviews metrics
- Sales team → Service-level tracking: configures tracking
- Sales team → Twilio calls: places calls (evidence: `README.md`)
- Sales team → Exotel calls: places calls (evidence: `README.md`)
- Twilio calls → Telephony providers: connects to (evidence: `README.md`)
- Exotel calls → Telephony providers: connects to (evidence: `README.md`)
- Sales team → WhatsApp messaging: sends messages (evidence: `README.md`)
- WhatsApp messaging → Frappe WhatsApp: integrates with (evidence: `README.md`)
- Sales team → ERPNext bridge: uses integration (evidence: `README.md`)
- ERPNext bridge → ERPNext: syncs records (evidence: `README.md`)
