# freescout-help-desk/freescout architecture

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

- Interactive diagram: https://gitdiagram.com/freescout-help-desk/freescout
- Repository: https://github.com/freescout-help-desk/freescout

## Overview

FreeScout is a self-hosted help desk and shared inbox. Agents work in mailboxes to review and update conversations, reply to customers, and coordinate with other agents; incoming email and other channels feed that work, while notifications and live updates keep users informed. The tree and excerpts establish the main conversation, mailbox, and email model areas, plus controller and IMAP responsibilities. Many README-listed capabilities are documented but their implementation was not sampled, so those branches are shown as documented rather than as verified internal call chains.

Main entry points: [`app/Http/Controllers/ConversationsController.php`](https://github.com/freescout-help-desk/freescout/blob/dist/app/Http/Controllers/ConversationsController.php) (Conversation handling), [`app/Conversation.php`](https://github.com/freescout-help-desk/freescout/blob/dist/app/Conversation.php) (Conversation domain), [`app/Http/Controllers/MailboxesController.php`](https://github.com/freescout-help-desk/freescout/blob/dist/app/Http/Controllers/MailboxesController.php) (Mailbox management), [`app/Mailbox.php`](https://github.com/freescout-help-desk/freescout/blob/dist/app/Mailbox.php) (Mailbox domain)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_inbox["Inbox and conversations"]
  node_conversation_ui["Conversation handling"]
  node_conversation["Conversation domain<br/>[Conversation.php]"]
  node_thread["Threads and replies<br/>[Thread.php]"]
  node_customer_records["Customer records<br/>[Customer.php]"]
end

subgraph group_channels["Mail and channels"]
  node_mailbox_ui["Mailbox management"]
  node_mailbox["Mailbox domain<br/>[Mailbox.php]"]
  node_email["Email addresses<br/>[Email.php]"]
  node_imap["IMAP client<br/>[Client.php]"]
  node_mail_sending["Mail services<br/>[Mail.php]"]
end

subgraph group_coordination["Agent coordination"]
  node_users["Agents and access<br/>[User.php]"]
  node_mailbox_access["Mailbox membership<br/>[MailboxUser.php]"]
  node_realtime["Live updates"]
  node_notifications["User notifications"]
end

subgraph group_platform["Identity and administration"]
  node_login["Authentication"]
  node_settings["Settings"]
  node_modules["Modules<br/>[Module.php]"]
end

subgraph group_state["Application state"]
  node_sql[("SQL database")]
end

node_agent(("Support agent"))
node_customer(("Customer"))

node_agent -->|"manages"| node_conversation_ui
node_conversation_ui -->|"uses domain"| node_conversation
node_conversation -->|"loads threads"| node_thread
node_conversation_ui -->|"uses records"| node_customer_records
node_customer -->|"contacts by"| node_email
node_agent -->|"configures"| node_mailbox_ui
node_mailbox_ui -->|"uses domain"| node_mailbox
node_mailbox_ui -->|"connects mailbox"| node_imap
node_mailbox -->|"uses addresses"| node_email
node_mail_sending -.->|"sends email"| node_customer
node_agent -->|"signs in"| node_users
node_users -->|"has membership"| node_mailbox_access
node_agent -->|"receives updates"| node_realtime
node_agent -->|"receives alerts"| node_notifications
node_agent -.->|"configures service"| node_settings
node_agent -->|"extends service"| node_modules
node_conversation -.->|"persists records"| node_sql
node_mailbox -.->|"persists records"| node_sql
node_users -.->|"persists records"| node_sql

click node_conversation_ui "https://github.com/freescout-help-desk/freescout/blob/dist/app/Http/Controllers/ConversationsController.php"
click node_conversation "https://github.com/freescout-help-desk/freescout/blob/dist/app/Conversation.php"
click node_thread "https://github.com/freescout-help-desk/freescout/blob/dist/app/Thread.php"
click node_customer_records "https://github.com/freescout-help-desk/freescout/blob/dist/app/Customer.php"
click node_mailbox_ui "https://github.com/freescout-help-desk/freescout/blob/dist/app/Http/Controllers/MailboxesController.php"
click node_mailbox "https://github.com/freescout-help-desk/freescout/blob/dist/app/Mailbox.php"
click node_email "https://github.com/freescout-help-desk/freescout/blob/dist/app/Email.php"
click node_imap "https://github.com/freescout-help-desk/freescout/blob/dist/overrides/webklex/php-imap/src/Client.php"
click node_mail_sending "https://github.com/freescout-help-desk/freescout/blob/dist/app/Misc/Mail.php"
click node_users "https://github.com/freescout-help-desk/freescout/blob/dist/app/User.php"
click node_mailbox_access "https://github.com/freescout-help-desk/freescout/blob/dist/app/MailboxUser.php"
click node_realtime "https://github.com/freescout-help-desk/freescout/blob/dist/app/Events/RealtimeConvList.php"
click node_notifications "https://github.com/freescout-help-desk/freescout/blob/dist/app/Notifications/WebsiteNotification.php"
click node_login "https://github.com/freescout-help-desk/freescout/blob/dist/app/Http/Controllers/Auth/LoginController.php"
click node_settings "https://github.com/freescout-help-desk/freescout/blob/dist/app/Http/Controllers/SettingsController.php"
click node_modules "https://github.com/freescout-help-desk/freescout/blob/dist/app/Module.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_conversation_ui,node_conversation,node_thread,node_customer_records toneBlue
class node_mailbox_ui,node_mailbox,node_email,node_imap,node_mail_sending toneAmber
class node_users,node_mailbox_access,node_realtime,node_notifications toneMint
class node_login,node_settings,node_modules toneRose
class node_sql,node_agent,node_customer toneIndigo
```

## Components

### Inbox and conversations

- [Conversation handling](https://github.com/freescout-help-desk/freescout/blob/dist/app/Http/Controllers/ConversationsController.php): `app/Http/Controllers/ConversationsController.php`
- [Conversation domain](https://github.com/freescout-help-desk/freescout/blob/dist/app/Conversation.php): `app/Conversation.php`
- [Threads and replies](https://github.com/freescout-help-desk/freescout/blob/dist/app/Thread.php): `app/Thread.php`
- [Customer records](https://github.com/freescout-help-desk/freescout/blob/dist/app/Customer.php): `app/Customer.php`

### Mail and channels

- [Mailbox management](https://github.com/freescout-help-desk/freescout/blob/dist/app/Http/Controllers/MailboxesController.php): `app/Http/Controllers/MailboxesController.php`
- [Mailbox domain](https://github.com/freescout-help-desk/freescout/blob/dist/app/Mailbox.php): `app/Mailbox.php`
- [Email addresses](https://github.com/freescout-help-desk/freescout/blob/dist/app/Email.php): `app/Email.php`
- [IMAP client](https://github.com/freescout-help-desk/freescout/blob/dist/overrides/webklex/php-imap/src/Client.php): `overrides/webklex/php-imap/src/Client.php`
- [Mail services](https://github.com/freescout-help-desk/freescout/blob/dist/app/Misc/Mail.php): `app/Misc/Mail.php`

### Agent coordination

- [Agents and access](https://github.com/freescout-help-desk/freescout/blob/dist/app/User.php): `app/User.php`
- [Mailbox membership](https://github.com/freescout-help-desk/freescout/blob/dist/app/MailboxUser.php): `app/MailboxUser.php`
- [Live updates](https://github.com/freescout-help-desk/freescout/blob/dist/app/Events/RealtimeConvList.php): `app/Events/RealtimeConvList.php`
- [User notifications](https://github.com/freescout-help-desk/freescout/blob/dist/app/Notifications/WebsiteNotification.php): `app/Notifications/WebsiteNotification.php`

### Identity and administration

- [Authentication](https://github.com/freescout-help-desk/freescout/blob/dist/app/Http/Controllers/Auth/LoginController.php): `app/Http/Controllers/Auth/LoginController.php`
- [Settings](https://github.com/freescout-help-desk/freescout/blob/dist/app/Http/Controllers/SettingsController.php): `app/Http/Controllers/SettingsController.php`
- [Modules](https://github.com/freescout-help-desk/freescout/blob/dist/app/Module.php): `app/Module.php`

### Application state

- **SQL database**

### Other components

- **Support agent**
- **Customer**

## Connections

- Support agent → Conversation handling: manages (evidence: `README.md`)
- Conversation handling → Conversation domain: uses domain (evidence: `app/Http/Controllers/ConversationsController.php`)
- Conversation domain → Threads and replies: loads threads (evidence: `app/Conversation.php`)
- Conversation handling → Customer records: uses records (evidence: `app/Http/Controllers/ConversationsController.php`)
- Customer → Email addresses: contacts by (evidence: `README.md`)
- Support agent → Mailbox management: configures (evidence: `README.md`)
- Mailbox management → Mailbox domain: uses domain (evidence: `app/Http/Controllers/MailboxesController.php`)
- Mailbox management → IMAP client: connects mailbox (evidence: `app/Http/Controllers/MailboxesController.php`)
- Mailbox domain → Email addresses: uses addresses (evidence: `app/Mailbox.php`)
- Mail services → Customer: sends email (evidence: `README.md`)
- Support agent → Agents and access: signs in
- Agents and access → Mailbox membership: has membership (evidence: `app/User.php`)
- Support agent → Live updates: receives updates (evidence: `README.md`)
- Support agent → User notifications: receives alerts (evidence: `README.md`)
- Support agent → Settings: configures service (evidence: `README.md`)
- Support agent → Modules: extends service (evidence: `README.md`)
- Conversation domain → SQL database: persists records
- Mailbox domain → SQL database: persists records
- Agents and access → SQL database: persists records
