# danielistyo/pm-wa architecture

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

- Interactive diagram: https://gitdiagram.com/danielistyo/pm-wa
- Repository: https://github.com/danielistyo/pm-wa

## Overview

PM-WA manages WhatsApp group task lists through private-message commands, group replies, scheduled reminders, and an optional authenticated web interface. The principal workflow is to create and populate a list, publish its summary to a group, accept authorized done/todo replies, and send reminders for due tasks. The database persists lists, tasks, assignees, and message mappings; formatting supports group summaries and reminder messages. The README is empty, so capability coverage and relationships are based on the sampled source and source index; unsampled command and web behaviors are represented only where their paths are clear.

Main entry points: [`bot/client.go`](https://github.com/danielistyo/pm-wa/blob/master/bot/client.go) (WhatsApp client), [`db/db.go`](https://github.com/danielistyo/pm-wa/blob/master/db/db.go) (SQLite database), [`reply/handler.go`](https://github.com/danielistyo/pm-wa/blob/master/reply/handler.go) (Reply processing), [`scheduler/pulse.go`](https://github.com/danielistyo/pm-wa/blob/master/scheduler/pulse.go) (Reminder scheduler)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Event entry"]
  node_app["Event dispatcher<br/>[main.go]"]
  node_wa_client["WhatsApp client<br/>[client.go]"]
end

subgraph group_commands["List management"]
  node_commands["Private commands<br/>[handler.go]"]
  node_list_ops["List and task operations"]
end

subgraph group_responses["Group updates"]
  node_reply_handler["Reply processing<br/>[handler.go]"]
  node_reply_parser["Reply parser<br/>[parser.go]"]
  node_summary_format["Summary formatting<br/>[summary.go]"]
end

subgraph group_reminders["Reminders"]
  node_scheduler["Reminder scheduler<br/>[pulse.go]"]
  node_pulse_format["Pulse formatting<br/>[pulse.go]"]
end

subgraph group_persistence["Persistence"]
  node_database[("SQLite database<br/>[db.go]")]
  node_task_store["Task storage<br/>[task.go]"]
  node_list_store["Task-list storage<br/>[tasklist.go]"]
  node_message_map["Message mappings<br/>[message_map.go]"]
end

subgraph group_webui["Web interface"]
  node_web_server["Web server<br/>[server.go]"]
  node_web_handlers["List web handlers<br/>[handlers.go]"]
  node_web_auth["Web authentication<br/>[auth.go]"]
  node_reminder_picker["Reminder picker<br/>[reminder-picker.js]"]
  node_assignee_picker["Assignee picker<br/>[assignee-picker.js]"]
end

node_whatsapp_user(("WhatsApp user"))
node_whatsapp_group(("WhatsApp group"))
node_web_user(("Web user"))
node_wa_service(("WhatsApp service"))

node_whatsapp_user -->|"sends messages"| node_wa_client
node_wa_client -->|"emits events"| node_app
node_app -->|"routes private messages"| node_commands
node_app -->|"routes group replies"| node_reply_handler
node_app -->|"starts scheduler"| node_scheduler
node_commands -->|"dispatches commands"| node_list_ops
node_commands -.->|"reads and writes"| node_database
node_commands -->|"sends responses"| node_wa_client
node_reply_handler -->|"parses reply"| node_reply_parser
node_reply_handler -->|"reads and updates"| node_database
node_reply_handler -->|"formats summary"| node_summary_format
node_reply_handler -->|"posts group update"| node_wa_client
node_wa_client -.->|"sends messages"| node_whatsapp_group
node_scheduler -->|"loads due tasks"| node_database
node_scheduler -->|"formats reminders"| node_pulse_format
node_scheduler -->|"sends reminders"| node_wa_client
node_scheduler -->|"saves sent mapping"| node_message_map
node_database -.->|"uses task queries"| node_task_store
node_database -.->|"uses list queries"| node_list_store
node_database -.->|"uses mapping queries"| node_message_map
node_web_user -->|"requests pages"| node_web_server
node_web_server -->|"guards routes"| node_web_auth
node_web_server -->|"routes requests"| node_web_handlers
node_web_handlers -->|"reads and writes"| node_database
node_web_handlers -->|"publishes summaries"| node_wa_client
node_web_handlers -.->|"serves static assets"| node_reminder_picker
node_web_handlers -.->|"serves static assets"| node_assignee_picker
node_web_user -.->|"edits schedules"| node_reminder_picker
node_wa_client -->|"connects to"| node_wa_service

click node_app "https://github.com/danielistyo/pm-wa/blob/master/main.go"
click node_wa_client "https://github.com/danielistyo/pm-wa/blob/master/bot/client.go"
click node_commands "https://github.com/danielistyo/pm-wa/blob/master/cmd/handler.go"
click node_list_ops "https://github.com/danielistyo/pm-wa/tree/master/cmd"
click node_reply_handler "https://github.com/danielistyo/pm-wa/blob/master/reply/handler.go"
click node_reply_parser "https://github.com/danielistyo/pm-wa/blob/master/reply/parser.go"
click node_summary_format "https://github.com/danielistyo/pm-wa/blob/master/format/summary.go"
click node_scheduler "https://github.com/danielistyo/pm-wa/blob/master/scheduler/pulse.go"
click node_pulse_format "https://github.com/danielistyo/pm-wa/blob/master/format/pulse.go"
click node_database "https://github.com/danielistyo/pm-wa/blob/master/db/db.go"
click node_task_store "https://github.com/danielistyo/pm-wa/blob/master/db/task.go"
click node_list_store "https://github.com/danielistyo/pm-wa/blob/master/db/tasklist.go"
click node_message_map "https://github.com/danielistyo/pm-wa/blob/master/db/message_map.go"
click node_web_server "https://github.com/danielistyo/pm-wa/blob/master/web/server.go"
click node_web_handlers "https://github.com/danielistyo/pm-wa/blob/master/web/handlers.go"
click node_web_auth "https://github.com/danielistyo/pm-wa/blob/master/web/auth.go"
click node_reminder_picker "https://github.com/danielistyo/pm-wa/blob/master/web/static/reminder-picker.js"
click node_assignee_picker "https://github.com/danielistyo/pm-wa/blob/master/web/static/assignee-picker.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_app,node_wa_client,node_whatsapp_user,node_web_user toneBlue
class node_commands,node_list_ops toneAmber
class node_reply_handler,node_reply_parser,node_summary_format toneMint
class node_scheduler,node_pulse_format toneRose
class node_database,node_task_store,node_list_store,node_message_map,node_whatsapp_group,node_wa_service toneIndigo
class node_web_server,node_web_handlers,node_web_auth,node_reminder_picker,node_assignee_picker toneTeal
```

## Components

### Event entry

- [Event dispatcher](https://github.com/danielistyo/pm-wa/blob/master/main.go): `main.go`
- [WhatsApp client](https://github.com/danielistyo/pm-wa/blob/master/bot/client.go): `bot/client.go`

### List management

- [Private commands](https://github.com/danielistyo/pm-wa/blob/master/cmd/handler.go): `cmd/handler.go`
- [List and task operations](https://github.com/danielistyo/pm-wa/tree/master/cmd): `cmd`

### Group updates

- [Reply processing](https://github.com/danielistyo/pm-wa/blob/master/reply/handler.go): `reply/handler.go`
- [Reply parser](https://github.com/danielistyo/pm-wa/blob/master/reply/parser.go): `reply/parser.go`
- [Summary formatting](https://github.com/danielistyo/pm-wa/blob/master/format/summary.go): `format/summary.go`

### Reminders

- [Reminder scheduler](https://github.com/danielistyo/pm-wa/blob/master/scheduler/pulse.go): `scheduler/pulse.go`
- [Pulse formatting](https://github.com/danielistyo/pm-wa/blob/master/format/pulse.go): `format/pulse.go`

### Persistence

- [SQLite database](https://github.com/danielistyo/pm-wa/blob/master/db/db.go): `db/db.go`
- [Task storage](https://github.com/danielistyo/pm-wa/blob/master/db/task.go): `db/task.go`
- [Task-list storage](https://github.com/danielistyo/pm-wa/blob/master/db/tasklist.go): `db/tasklist.go`
- [Message mappings](https://github.com/danielistyo/pm-wa/blob/master/db/message_map.go): `db/message_map.go`

### Web interface

- [Web server](https://github.com/danielistyo/pm-wa/blob/master/web/server.go): `web/server.go`
- [List web handlers](https://github.com/danielistyo/pm-wa/blob/master/web/handlers.go): `web/handlers.go`
- [Web authentication](https://github.com/danielistyo/pm-wa/blob/master/web/auth.go): `web/auth.go`
- [Reminder picker](https://github.com/danielistyo/pm-wa/blob/master/web/static/reminder-picker.js): `web/static/reminder-picker.js`
- [Assignee picker](https://github.com/danielistyo/pm-wa/blob/master/web/static/assignee-picker.js): `web/static/assignee-picker.js`

### Other components

- **WhatsApp user**
- **WhatsApp group**
- **Web user**
- **WhatsApp service**

## Connections

- WhatsApp user → WhatsApp client: sends messages
- WhatsApp client → Event dispatcher: emits events (evidence: `main.go`)
- Event dispatcher → Private commands: routes private messages (evidence: `main.go`)
- Event dispatcher → Reply processing: routes group replies (evidence: `main.go`)
- Event dispatcher → Reminder scheduler: starts scheduler (evidence: `main.go`)
- Private commands → List and task operations: dispatches commands (evidence: `cmd/handler.go`)
- Private commands → SQLite database: reads and writes
- Private commands → WhatsApp client: sends responses (evidence: `cmd/handler.go`)
- Reply processing → Reply parser: parses reply (evidence: `reply/handler.go`)
- Reply processing → SQLite database: reads and updates (evidence: `reply/handler.go`)
- Reply processing → Summary formatting: formats summary (evidence: `reply/handler.go`)
- Reply processing → WhatsApp client: posts group update (evidence: `reply/handler.go`)
- WhatsApp client → WhatsApp group: sends messages
- Reminder scheduler → SQLite database: loads due tasks (evidence: `scheduler/pulse.go`)
- Reminder scheduler → Pulse formatting: formats reminders (evidence: `scheduler/pulse.go`)
- Reminder scheduler → WhatsApp client: sends reminders (evidence: `scheduler/pulse.go`)
- Reminder scheduler → Message mappings: saves sent mapping (evidence: `scheduler/pulse.go`)
- SQLite database → Task storage: uses task queries
- SQLite database → Task-list storage: uses list queries
- SQLite database → Message mappings: uses mapping queries
- Web user → Web server: requests pages (evidence: `web/server.go`)
- Web server → Web authentication: guards routes (evidence: `web/server.go`)
- Web server → List web handlers: routes requests (evidence: `web/server.go`)
- List web handlers → SQLite database: reads and writes (evidence: `web/handlers.go`)
- List web handlers → WhatsApp client: publishes summaries (evidence: `web/handlers.go`)
- List web handlers → Reminder picker: serves static assets
- List web handlers → Assignee picker: serves static assets
- Web user → Reminder picker: edits schedules
- WhatsApp client → WhatsApp service: connects to (evidence: `bot/client.go`)
