# heruahmadsidik/maxchat-comcen architecture

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

- Interactive diagram: https://gitdiagram.com/heruahmadsidik/maxchat-comcen
- Repository: https://github.com/heruahmadsidik/maxchat-comcen

## Overview

Maxchat Command Center is an internal PLN UP2D Banten application for WhatsApp broadcasts and two-way conversation management. The main workflow is: an operator logs in, uses the in-file web interface to manage templates and send broadcasts through the server to Maxchat, then handles customer replies and delivery updates received by webhook. The server stores conversation and contact state in SQLite and provides dashboard, export, and backup capabilities. The README describes several subsystems whose implementation is not visible in the excerpts; those links are documented relationships, not claims about inspected source details.

Main entry points: [`app.js`](https://github.com/heruahmadsidik/maxchat-comcen/blob/main/app.js) (Web interface)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_access["Access &amp; Settings"]
  node_web_ui["Web interface<br/>[app.js]"]
  node_login_settings["Login &amp; settings<br/>[app.js]"]
end

subgraph group_messaging["Messaging"]
  node_template_manager["Template manager<br/>[app.js]"]
  node_broadcast["Broadcast<br/>[app.js]"]
  node_webhook_sync["Webhook sync<br/>[app.js]"]
end

subgraph group_conversations["Contacts &amp; Chat"]
  node_chat["Two-way chat<br/>[app.js]"]
  node_contact_manager["Contact manager<br/>[app.js]"]
  node_quick_replies["Quick replies<br/>[app.js]"]
  node_search["Contact &amp; history search<br/>[app.js]"]
end

subgraph group_insights["Insights &amp; Storage"]
  node_dashboard["Dashboard &amp; reports<br/>[app.js]"]
  node_exports["XLSX / CSV exports<br/>[app.js]"]
  node_history_management["History management<br/>[app.js]"]
  node_sqlite[("SQLite history &amp; contacts<br/>[app.js]")]
  node_backup["Database backup<br/>[app.js]"]
end

node_operator(("Operator"))
node_maxchat["Maxchat API"]

node_operator -->|"uses"| node_web_ui
node_web_ui -->|"logs in"| node_login_settings
node_web_ui -->|"manages templates"| node_template_manager
node_web_ui -->|"starts broadcast"| node_broadcast
node_broadcast -->|"sends messages"| node_maxchat
node_maxchat -->|"posts updates"| node_webhook_sync
node_webhook_sync -->|"stores updates"| node_sqlite
node_web_ui -->|"handles replies"| node_chat
node_chat -->|"sends replies"| node_maxchat
node_web_ui -->|"manages contacts"| node_contact_manager
node_web_ui -->|"manages replies"| node_quick_replies
node_web_ui -->|"searches history"| node_search
node_search -->|"queries index"| node_sqlite
node_web_ui -->|"views reports"| node_dashboard
node_dashboard -->|"reads records"| node_sqlite
node_web_ui -->|"exports data"| node_exports
node_exports -->|"reads records"| node_sqlite
node_web_ui -->|"manages history"| node_history_management
node_history_management -->|"deletes records"| node_sqlite
node_web_ui -->|"requests backup"| node_backup
node_backup -->|"backs up"| node_sqlite

click node_web_ui "https://github.com/heruahmadsidik/maxchat-comcen/blob/main/app.js"
click node_login_settings "https://github.com/heruahmadsidik/maxchat-comcen/blob/main/app.js"
click node_template_manager "https://github.com/heruahmadsidik/maxchat-comcen/blob/main/app.js"
click node_broadcast "https://github.com/heruahmadsidik/maxchat-comcen/blob/main/app.js"
click node_webhook_sync "https://github.com/heruahmadsidik/maxchat-comcen/blob/main/app.js"
click node_chat "https://github.com/heruahmadsidik/maxchat-comcen/blob/main/app.js"
click node_contact_manager "https://github.com/heruahmadsidik/maxchat-comcen/blob/main/app.js"
click node_quick_replies "https://github.com/heruahmadsidik/maxchat-comcen/blob/main/app.js"
click node_search "https://github.com/heruahmadsidik/maxchat-comcen/blob/main/app.js"
click node_dashboard "https://github.com/heruahmadsidik/maxchat-comcen/blob/main/app.js"
click node_exports "https://github.com/heruahmadsidik/maxchat-comcen/blob/main/app.js"
click node_history_management "https://github.com/heruahmadsidik/maxchat-comcen/blob/main/app.js"
click node_sqlite "https://github.com/heruahmadsidik/maxchat-comcen/blob/main/app.js"
click node_backup "https://github.com/heruahmadsidik/maxchat-comcen/blob/main/app.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_web_ui,node_login_settings toneBlue
class node_template_manager,node_broadcast,node_webhook_sync toneAmber
class node_chat,node_contact_manager,node_quick_replies,node_search,node_maxchat toneMint
class node_dashboard,node_exports,node_history_management,node_sqlite,node_backup toneRose
class node_operator toneIndigo
```

## Components

### Access & Settings

- [Web interface](https://github.com/heruahmadsidik/maxchat-comcen/blob/main/app.js): `app.js`
- [Login & settings](https://github.com/heruahmadsidik/maxchat-comcen/blob/main/app.js): `app.js`

### Messaging

- [Template manager](https://github.com/heruahmadsidik/maxchat-comcen/blob/main/app.js): `app.js`
- [Broadcast](https://github.com/heruahmadsidik/maxchat-comcen/blob/main/app.js): `app.js`
- [Webhook sync](https://github.com/heruahmadsidik/maxchat-comcen/blob/main/app.js): `app.js`

### Contacts & Chat

- [Two-way chat](https://github.com/heruahmadsidik/maxchat-comcen/blob/main/app.js): `app.js`
- [Contact manager](https://github.com/heruahmadsidik/maxchat-comcen/blob/main/app.js): `app.js`
- [Quick replies](https://github.com/heruahmadsidik/maxchat-comcen/blob/main/app.js): `app.js`
- [Contact & history search](https://github.com/heruahmadsidik/maxchat-comcen/blob/main/app.js): `app.js`

### Insights & Storage

- [Dashboard & reports](https://github.com/heruahmadsidik/maxchat-comcen/blob/main/app.js): `app.js`
- [XLSX / CSV exports](https://github.com/heruahmadsidik/maxchat-comcen/blob/main/app.js): `app.js`
- [History management](https://github.com/heruahmadsidik/maxchat-comcen/blob/main/app.js): `app.js`
- [SQLite history & contacts](https://github.com/heruahmadsidik/maxchat-comcen/blob/main/app.js): `app.js`
- [Database backup](https://github.com/heruahmadsidik/maxchat-comcen/blob/main/app.js): `app.js`

### Other components

- **Operator**
- **Maxchat API**

## Connections

- Operator → Web interface: uses (evidence: `README.md`)
- Web interface → Login & settings: logs in (evidence: `README.md`)
- Web interface → Template manager: manages templates (evidence: `README.md`)
- Web interface → Broadcast: starts broadcast (evidence: `README.md`)
- Broadcast → Maxchat API: sends messages (evidence: `README.md`)
- Maxchat API → Webhook sync: posts updates (evidence: `README.md`)
- Webhook sync → SQLite history & contacts: stores updates (evidence: `README.md`)
- Web interface → Two-way chat: handles replies (evidence: `README.md`)
- Two-way chat → Maxchat API: sends replies (evidence: `README.md`)
- Web interface → Contact manager: manages contacts (evidence: `README.md`)
- Web interface → Quick replies: manages replies (evidence: `README.md`)
- Web interface → Contact & history search: searches history (evidence: `README.md`)
- Contact & history search → SQLite history & contacts: queries index (evidence: `README.md`)
- Web interface → Dashboard & reports: views reports (evidence: `README.md`)
- Dashboard & reports → SQLite history & contacts: reads records (evidence: `README.md`)
- Web interface → XLSX / CSV exports: exports data (evidence: `README.md`)
- XLSX / CSV exports → SQLite history & contacts: reads records (evidence: `README.md`)
- Web interface → History management: manages history (evidence: `README.md`)
- History management → SQLite history & contacts: deletes records (evidence: `README.md`)
- Web interface → Database backup: requests backup (evidence: `README.md`)
- Database backup → SQLite history & contacts: backs up (evidence: `README.md`)
