# fazer-ai/chatwoot architecture

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

- Interactive diagram: https://gitdiagram.com/fazer-ai/chatwoot
- Repository: https://github.com/fazer-ai/chatwoot

## Overview

Chatwoot fazer.ai is a customer-support platform fork with WhatsApp-focused additions. The main workflow is an agent using the dashboard to manage contacts and conversations, exchange messages through connected channels, and review outcomes in reports. Separate branches cover customer-facing widget conversations, agent-to-agent internal chat, automation and webhooks, and help-center/AI capabilities. The README documents these capabilities; routes and source excerpts show selected entry points, but most controllers and channel implementations were not sampled, so their internal calls are not asserted.

Main entry points: [`app/controllers/api/v1/accounts`](https://github.com/fazer-ai/chatwoot/tree/main/app/controllers/api/v1/accounts) (Account APIs), [`app/javascript/dashboard/App.vue`](https://github.com/fazer-ai/chatwoot/blob/main/app/javascript/dashboard/App.vue) (Dashboard UI), [`app/controllers/api/v1/widget`](https://github.com/fazer-ai/chatwoot/tree/main/app/controllers/api/v1/widget) (Customer widget), [`app/jobs/webhook_job.rb`](https://github.com/fazer-ai/chatwoot/blob/main/app/jobs/webhook_job.rb) (Webhook delivery)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_workspace["Agent workspace"]
  node_dashboard["Dashboard UI<br/>[App.vue]"]
  node_account_api["Account APIs"]
  node_contacts["Contacts"]
  node_conversations["Conversations"]
  node_internal_chat["Agent internal chat"]
end

subgraph group_messaging["Messaging channels"]
  node_channels["Channel integrations"]
  node_whatsapp["WhatsApp messaging"]
  node_widget["Customer widget"]
end

subgraph group_automation["Automation and AI"]
  node_webhook_events["Webhook events"]
  node_webhook_jobs["Webhook delivery<br/>[webhook_job.rb]"]
  node_automation_rules["Automation rules"]
  node_captain["AI assistant tasks"]
  node_llm_service["LLM requests"]
end

subgraph group_insights["Insights and content"]
  node_search["Search<br/>[search_service.rb]"]
  node_reports["Reports"]
  node_year_review["Year in review"]
  node_help_center["Help center"]
end

subgraph group_platform["Platform services"]
  node_database[("Application database<br/>[schema.rb]")]
  node_redis[("Redis storage<br/>[secure_storage.rb]")]
end

node_agents(("Support agents"))
node_whatsapp_connector["WhatsApp connector"]
node_customers(("Customers"))
node_external_channels(("Messaging providers"))

node_agents -->|"use"| node_dashboard
node_dashboard -.->|"request APIs"| node_account_api
node_account_api -->|"routes contact requests"| node_contacts
node_account_api -->|"routes conversation requests"| node_conversations
node_agents -->|"chat internally"| node_internal_chat
node_customers -->|"start conversations"| node_widget
node_widget -.->|"supports conversations"| node_conversations
node_whatsapp_connector -.->|"connects WhatsApp"| node_whatsapp
node_external_channels -.->|"deliver messages"| node_channels
node_agents -->|"configure rules"| node_automation_rules
node_webhook_events -.->|"dispatch delivery"| node_webhook_jobs
node_agents -.->|"use AI agents"| node_captain
node_captain -.->|"request LLM work"| node_llm_service
node_agents -->|"search records"| node_search
node_agents -->|"review reports"| node_reports
node_agents -->|"view annual review"| node_year_review
node_customers -->|"browse articles"| node_help_center
node_account_api -.->|"access records"| node_database
node_webhook_jobs -.->|"send webhooks"| node_external_channels
node_llm_service -->|"cache responses"| node_redis

click node_dashboard "https://github.com/fazer-ai/chatwoot/blob/main/app/javascript/dashboard/App.vue"
click node_account_api "https://github.com/fazer-ai/chatwoot/tree/main/app/controllers/api/v1/accounts"
click node_contacts "https://github.com/fazer-ai/chatwoot/blob/main/app/controllers/api/v1/accounts/contacts_controller.rb"
click node_conversations "https://github.com/fazer-ai/chatwoot/blob/main/app/controllers/api/v1/accounts/conversations_controller.rb"
click node_internal_chat "https://github.com/fazer-ai/chatwoot/tree/main/app/controllers/api/v1/accounts/internal_chat"
click node_channels "https://github.com/fazer-ai/chatwoot/tree/main/app/controllers/webhooks"
click node_whatsapp "https://github.com/fazer-ai/chatwoot/blob/main/app/controllers/webhooks/whatsapp_controller.rb"
click node_widget "https://github.com/fazer-ai/chatwoot/tree/main/app/controllers/api/v1/widget"
click node_webhook_events "https://github.com/fazer-ai/chatwoot/blob/main/app/listeners/webhook_listener.rb"
click node_webhook_jobs "https://github.com/fazer-ai/chatwoot/blob/main/app/jobs/webhook_job.rb"
click node_automation_rules "https://github.com/fazer-ai/chatwoot/blob/main/app/controllers/api/v1/accounts/automation_rules_controller.rb"
click node_captain "https://github.com/fazer-ai/chatwoot/blob/main/lib/captain/base_task_service.rb"
click node_llm_service "https://github.com/fazer-ai/chatwoot/blob/main/lib/integrations/llm_base_service.rb"
click node_search "https://github.com/fazer-ai/chatwoot/blob/main/app/services/search_service.rb"
click node_reports "https://github.com/fazer-ai/chatwoot/blob/main/app/controllers/api/v2/accounts/reports_controller.rb"
click node_year_review "https://github.com/fazer-ai/chatwoot/blob/main/app/controllers/api/v2/accounts/year_in_reviews_controller.rb"
click node_help_center "https://github.com/fazer-ai/chatwoot/tree/main/app/controllers/public/api/v1/portals"
click node_database "https://github.com/fazer-ai/chatwoot/blob/main/db/schema.rb"
click node_redis "https://github.com/fazer-ai/chatwoot/blob/main/lib/redis/secure_storage.rb"

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_account_api,node_contacts,node_conversations,node_internal_chat toneBlue
class node_channels,node_whatsapp,node_widget toneAmber
class node_webhook_events,node_webhook_jobs,node_automation_rules,node_captain,node_llm_service toneMint
class node_search,node_reports,node_year_review,node_help_center toneRose
class node_database,node_redis,node_agents,node_whatsapp_connector,node_customers,node_external_channels toneIndigo
```

## Components

### Agent workspace

- [Dashboard UI](https://github.com/fazer-ai/chatwoot/blob/main/app/javascript/dashboard/App.vue): `app/javascript/dashboard/App.vue`
- [Account APIs](https://github.com/fazer-ai/chatwoot/tree/main/app/controllers/api/v1/accounts): `app/controllers/api/v1/accounts`
- [Contacts](https://github.com/fazer-ai/chatwoot/blob/main/app/controllers/api/v1/accounts/contacts_controller.rb): `app/controllers/api/v1/accounts/contacts_controller.rb`
- [Conversations](https://github.com/fazer-ai/chatwoot/blob/main/app/controllers/api/v1/accounts/conversations_controller.rb): `app/controllers/api/v1/accounts/conversations_controller.rb`
- [Agent internal chat](https://github.com/fazer-ai/chatwoot/tree/main/app/controllers/api/v1/accounts/internal_chat): `app/controllers/api/v1/accounts/internal_chat`

### Messaging channels

- [Channel integrations](https://github.com/fazer-ai/chatwoot/tree/main/app/controllers/webhooks): `app/controllers/webhooks`
- [WhatsApp messaging](https://github.com/fazer-ai/chatwoot/blob/main/app/controllers/webhooks/whatsapp_controller.rb): `app/controllers/webhooks/whatsapp_controller.rb`
- [Customer widget](https://github.com/fazer-ai/chatwoot/tree/main/app/controllers/api/v1/widget): `app/controllers/api/v1/widget`

### Automation and AI

- [Webhook events](https://github.com/fazer-ai/chatwoot/blob/main/app/listeners/webhook_listener.rb): `app/listeners/webhook_listener.rb`
- [Webhook delivery](https://github.com/fazer-ai/chatwoot/blob/main/app/jobs/webhook_job.rb): `app/jobs/webhook_job.rb`
- [Automation rules](https://github.com/fazer-ai/chatwoot/blob/main/app/controllers/api/v1/accounts/automation_rules_controller.rb): `app/controllers/api/v1/accounts/automation_rules_controller.rb`
- [AI assistant tasks](https://github.com/fazer-ai/chatwoot/blob/main/lib/captain/base_task_service.rb): `lib/captain/base_task_service.rb`
- [LLM requests](https://github.com/fazer-ai/chatwoot/blob/main/lib/integrations/llm_base_service.rb): `lib/integrations/llm_base_service.rb`

### Insights and content

- [Search](https://github.com/fazer-ai/chatwoot/blob/main/app/services/search_service.rb): `app/services/search_service.rb`
- [Reports](https://github.com/fazer-ai/chatwoot/blob/main/app/controllers/api/v2/accounts/reports_controller.rb): `app/controllers/api/v2/accounts/reports_controller.rb`
- [Year in review](https://github.com/fazer-ai/chatwoot/blob/main/app/controllers/api/v2/accounts/year_in_reviews_controller.rb): `app/controllers/api/v2/accounts/year_in_reviews_controller.rb`
- [Help center](https://github.com/fazer-ai/chatwoot/tree/main/app/controllers/public/api/v1/portals): `app/controllers/public/api/v1/portals`

### Platform services

- [Application database](https://github.com/fazer-ai/chatwoot/blob/main/db/schema.rb): `db/schema.rb`
- [Redis storage](https://github.com/fazer-ai/chatwoot/blob/main/lib/redis/secure_storage.rb): `lib/redis/secure_storage.rb`

### Other components

- **Support agents**
- **WhatsApp connector**
- **Customers**
- **Messaging providers**

## Connections

- Support agents → Dashboard UI: use
- Dashboard UI → Account APIs: request APIs
- Account APIs → Contacts: routes contact requests
- Account APIs → Conversations: routes conversation requests
- Support agents → Agent internal chat: chat internally (evidence: `README.md`)
- Customers → Customer widget: start conversations
- Customer widget → Conversations: supports conversations
- WhatsApp connector → WhatsApp messaging: connects WhatsApp (evidence: `README.md`)
- Messaging providers → Channel integrations: deliver messages (evidence: `README.md`)
- Support agents → Automation rules: configure rules
- Webhook events → Webhook delivery: dispatch delivery (evidence: `README.md`)
- Support agents → AI assistant tasks: use AI agents (evidence: `README.md`)
- AI assistant tasks → LLM requests: request LLM work
- Support agents → Search: search records
- Support agents → Reports: review reports
- Support agents → Year in review: view annual review (evidence: `app/controllers/api/v2/accounts/year_in_reviews_controller.rb`)
- Customers → Help center: browse articles
- Account APIs → Application database: access records
- Webhook delivery → Messaging providers: send webhooks (evidence: `README.md`)
- LLM requests → Redis storage: cache responses (evidence: `lib/integrations/llm_base_service.rb`)
