# supitta/omnichannel architecture

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

- Interactive diagram: https://gitdiagram.com/supitta/omnichannel
- Repository: https://github.com/supitta/omnichannel

## Overview

OmniDesk is a shared customer-support inbox for LINE, Facebook Messenger, Instagram, Web Chat and Gmail. Staff use the React workspace to review conversations, reply, manage contacts and tickets, and view reports; the Express backend receives webhooks and syncs channels, then persists conversations. AI-assisted replies, file handling and backups support that core workflow. Edges are limited to relationships visible in excerpts or explicitly described in the README; some unsampled frontend and channel internals are represented at subsystem level.

Main entry points: [`src/App.jsx`](https://github.com/supitta/omnichannel/blob/main/src/App.jsx) (Inbox workspace), [`server/src/platforms.js`](https://github.com/supitta/omnichannel/blob/main/server/src/platforms.js) (Channel sync and messaging), [`server/src/server.js`](https://github.com/supitta/omnichannel/blob/main/server/src/server.js) (HTTP and webhook routes), [`server/src/bot.js`](https://github.com/supitta/omnichannel/blob/main/server/src/bot.js) (AI reply automation)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_workspace["Staff workspace"]
  node_workspace["Inbox workspace<br/>[App.jsx]"]
  node_api["Frontend API client<br/>[api.js]"]
  node_chatview["Chat timeline<br/>[chatTime.js]"]
  node_contactpanel["Contact insights<br/>[ProfilePanel.jsx]"]
  node_contactdialogs["Contact dialogs<br/>[Modals.jsx]"]
  node_tickets["Ticket management<br/>[Tickets.jsx]"]
  node_reports["Reports<br/>[Report.jsx]"]
end

subgraph group_backend["Conversation backend"]
  node_server["HTTP and webhook routes<br/>[server.js]"]
  node_contacts["Contact extraction<br/>[extract-contact.js]"]
end

subgraph group_channels["Channels and automation"]
  node_platforms["Channel sync and messaging<br/>[platforms.js]"]
  node_line{{"LINE Official Account"}}
  node_meta{{"Meta messaging"}}
  node_webchat["Website chat<br/>[webchat.js]"]
  node_gmail["Gmail integration<br/>[gmail.js]"]
  node_bot["AI reply automation<br/>[bot.js]"]
  node_aihub["AI Hub client<br/>[ai-hub.js]"]
end

subgraph group_data["Persistence and files"]
  node_store["Store driver selector<br/>[store.js]"]
  node_sqlite[("SQLite store<br/>[store-sqlite.js]")]
  node_jsonstore[("JSON store<br/>[store-json.js]")]
  node_files["File handling<br/>[files.js]"]
  node_backup["Database backups<br/>[backup.js]"]
end

node_staff(("Support staff"))

node_staff -->|"uses"| node_workspace
node_workspace -->|"requests data"| node_api
node_workspace -->|"formats timeline"| node_chatview
node_workspace -->|"shows profile"| node_contactpanel
node_workspace -->|"opens dialogs"| node_contactdialogs
node_workspace -->|"manages tickets"| node_tickets
node_workspace -->|"shows reports"| node_reports
node_api -.->|"calls API"| node_server
node_server -->|"dispatches sync"| node_platforms
node_server -->|"reads and writes"| node_store
node_server -->|"extracts details"| node_contacts
node_server -->|"controls handoff"| node_bot
node_platforms -->|"syncs and sends"| node_line
node_platforms -->|"syncs and sends"| node_meta
node_platforms -->|"routes chat"| node_webchat
node_platforms -->|"syncs and sends"| node_gmail
node_platforms -->|"handles incoming"| node_bot
node_bot -->|"requests replies"| node_aihub
node_bot -->|"saves replies"| node_store
node_store -->|"loads driver"| node_sqlite
node_store -->|"loads driver"| node_jsonstore
node_platforms -->|"stores attachments"| node_files
node_server -->|"starts schedule"| node_backup
node_backup -->|"backs up database"| node_sqlite

click node_workspace "https://github.com/supitta/omnichannel/blob/main/src/App.jsx"
click node_api "https://github.com/supitta/omnichannel/blob/main/src/api.js"
click node_chatview "https://github.com/supitta/omnichannel/blob/main/src/chatTime.js"
click node_contactpanel "https://github.com/supitta/omnichannel/blob/main/src/components/ProfilePanel.jsx"
click node_contactdialogs "https://github.com/supitta/omnichannel/blob/main/src/components/Modals.jsx"
click node_tickets "https://github.com/supitta/omnichannel/blob/main/src/components/Tickets.jsx"
click node_reports "https://github.com/supitta/omnichannel/blob/main/src/components/Report.jsx"
click node_server "https://github.com/supitta/omnichannel/blob/main/server/src/server.js"
click node_platforms "https://github.com/supitta/omnichannel/blob/main/server/src/platforms.js"
click node_webchat "https://github.com/supitta/omnichannel/blob/main/server/src/webchat.js"
click node_gmail "https://github.com/supitta/omnichannel/blob/main/server/src/gmail.js"
click node_bot "https://github.com/supitta/omnichannel/blob/main/server/src/bot.js"
click node_aihub "https://github.com/supitta/omnichannel/blob/main/server/src/ai-hub.js"
click node_contacts "https://github.com/supitta/omnichannel/blob/main/server/src/extract-contact.js"
click node_store "https://github.com/supitta/omnichannel/blob/main/server/src/store.js"
click node_sqlite "https://github.com/supitta/omnichannel/blob/main/server/src/store-sqlite.js"
click node_jsonstore "https://github.com/supitta/omnichannel/blob/main/server/src/store-json.js"
click node_files "https://github.com/supitta/omnichannel/blob/main/server/src/files.js"
click node_backup "https://github.com/supitta/omnichannel/blob/main/server/src/backup.js"

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_workspace,node_api,node_chatview,node_contactpanel,node_contactdialogs,node_tickets,node_reports toneBlue
class node_server,node_contacts toneAmber
class node_platforms,node_line,node_meta,node_webchat,node_gmail,node_bot,node_aihub toneMint
class node_store,node_sqlite,node_jsonstore,node_files,node_backup toneRose
class node_staff toneIndigo
```

## Components

### Staff workspace

- [Inbox workspace](https://github.com/supitta/omnichannel/blob/main/src/App.jsx): `src/App.jsx`
- [Frontend API client](https://github.com/supitta/omnichannel/blob/main/src/api.js): `src/api.js`
- [Chat timeline](https://github.com/supitta/omnichannel/blob/main/src/chatTime.js): `src/chatTime.js`
- [Contact insights](https://github.com/supitta/omnichannel/blob/main/src/components/ProfilePanel.jsx): `src/components/ProfilePanel.jsx`
- [Contact dialogs](https://github.com/supitta/omnichannel/blob/main/src/components/Modals.jsx): `src/components/Modals.jsx`
- [Ticket management](https://github.com/supitta/omnichannel/blob/main/src/components/Tickets.jsx): `src/components/Tickets.jsx`
- [Reports](https://github.com/supitta/omnichannel/blob/main/src/components/Report.jsx): `src/components/Report.jsx`

### Conversation backend

- [HTTP and webhook routes](https://github.com/supitta/omnichannel/blob/main/server/src/server.js): `server/src/server.js`
- [Contact extraction](https://github.com/supitta/omnichannel/blob/main/server/src/extract-contact.js): `server/src/extract-contact.js`

### Channels and automation

- [Channel sync and messaging](https://github.com/supitta/omnichannel/blob/main/server/src/platforms.js): `server/src/platforms.js`
- **LINE Official Account**
- **Meta messaging**
- [Website chat](https://github.com/supitta/omnichannel/blob/main/server/src/webchat.js): `server/src/webchat.js`
- [Gmail integration](https://github.com/supitta/omnichannel/blob/main/server/src/gmail.js): `server/src/gmail.js`
- [AI reply automation](https://github.com/supitta/omnichannel/blob/main/server/src/bot.js): `server/src/bot.js`
- [AI Hub client](https://github.com/supitta/omnichannel/blob/main/server/src/ai-hub.js): `server/src/ai-hub.js`

### Persistence and files

- [Store driver selector](https://github.com/supitta/omnichannel/blob/main/server/src/store.js): `server/src/store.js`
- [SQLite store](https://github.com/supitta/omnichannel/blob/main/server/src/store-sqlite.js): `server/src/store-sqlite.js`
- [JSON store](https://github.com/supitta/omnichannel/blob/main/server/src/store-json.js): `server/src/store-json.js`
- [File handling](https://github.com/supitta/omnichannel/blob/main/server/src/files.js): `server/src/files.js`
- [Database backups](https://github.com/supitta/omnichannel/blob/main/server/src/backup.js): `server/src/backup.js`

### Other components

- **Support staff**

## Connections

- Support staff → Inbox workspace: uses (evidence: `README.md`)
- Inbox workspace → Frontend API client: requests data (evidence: `src/App.jsx`)
- Inbox workspace → Chat timeline: formats timeline (evidence: `src/App.jsx`)
- Inbox workspace → Contact insights: shows profile (evidence: `src/App.jsx`)
- Inbox workspace → Contact dialogs: opens dialogs (evidence: `src/App.jsx`)
- Inbox workspace → Ticket management: manages tickets (evidence: `src/App.jsx`)
- Inbox workspace → Reports: shows reports (evidence: `README.md`)
- Frontend API client → HTTP and webhook routes: calls API
- HTTP and webhook routes → Channel sync and messaging: dispatches sync (evidence: `server/src/server.js`)
- HTTP and webhook routes → Store driver selector: reads and writes (evidence: `server/src/server.js`)
- HTTP and webhook routes → Contact extraction: extracts details (evidence: `server/src/server.js`)
- HTTP and webhook routes → AI reply automation: controls handoff (evidence: `server/src/server.js`)
- Channel sync and messaging → LINE Official Account: syncs and sends (evidence: `README.md`)
- Channel sync and messaging → Meta messaging: syncs and sends (evidence: `README.md`)
- Channel sync and messaging → Website chat: routes chat (evidence: `server/src/platforms.js`)
- Channel sync and messaging → Gmail integration: syncs and sends (evidence: `server/src/platforms.js`)
- Channel sync and messaging → AI reply automation: handles incoming (evidence: `server/src/platforms.js`)
- AI reply automation → AI Hub client: requests replies (evidence: `server/src/bot.js`)
- AI reply automation → Store driver selector: saves replies (evidence: `server/src/bot.js`)
- Store driver selector → SQLite store: loads driver (evidence: `server/src/store.js`)
- Store driver selector → JSON store: loads driver (evidence: `server/src/store.js`)
- Channel sync and messaging → File handling: stores attachments (evidence: `server/src/platforms.js`)
- HTTP and webhook routes → Database backups: starts schedule (evidence: `server/src/server.js`)
- Database backups → SQLite store: backs up database (evidence: `server/src/backup.js`)
