# 333ian/weekly-planning-bot architecture

> Architecture diagram of the GitHub repository 333ian/weekly-planning-bot, 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/333ian/weekly-planning-bot
- Repository: https://github.com/333ian/weekly-planning-bot

## Overview

Mission Control lets a user enter a task in the web dashboard, submit it to Google Apps Script, and create a Calendar event with a reminder. Separately, time-based triggers invoke daily and weekly email routines. The README documents the browser-to-script flow; Code.js shows event creation, trigger setup, and email sending. The HTML implementation was not sampled, so frontend internals are not expanded.

Main entry points: [`Code.js`](https://github.com/333ian/weekly-planning-bot/blob/master/Code.js) (POST handler), [`index.html`](https://github.com/333ian/weekly-planning-bot/blob/master/index.html) (Task submission)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_planning["Task planning"]
  node_dashboard["Task dashboard<br/>[index.html]"]
  node_task_submit["Task submission<br/>[index.html]"]
end

subgraph group_calendar["Calendar workflow"]
  node_post_handler["POST handler<br/>[Code.js]"]
  node_task_parse["Parse task<br/>[Code.js]"]
  node_event_create["Create event<br/>[Code.js]"]
  node_event_reminder["Event reminder<br/>[Code.js]"]
  node_post_response["Success response<br/>[Code.js]"]
end

subgraph group_reminders["Email reminders"]
  node_trigger_setup["Trigger setup<br/>[Code.js]"]
  node_daily_email["Daily reminder<br/>[Code.js]"]
  node_weekly_email["Weekend and weekly mail<br/>[Code.js]"]
end

subgraph group_platform["Google services"]
  node_calendar_store[("Google Calendar")]
  node_mail_service["Google MailApp"]
  node_scheduler["Time-based triggers"]
end

node_user(("Planner"))

node_user -->|"uses"| node_dashboard
node_dashboard -->|"enters task"| node_task_submit
node_task_submit -->|"POSTs task"| node_post_handler
node_post_handler -->|"parses payload"| node_task_parse
node_post_handler -->|"creates event"| node_event_create
node_event_create -->|"writes event"| node_calendar_store
node_post_handler -->|"adds reminder"| node_event_reminder
node_event_reminder -->|"sets notification"| node_calendar_store
node_post_handler -->|"returns result"| node_post_response
node_post_response -->|"reports status"| node_task_submit
node_trigger_setup -->|"registers jobs"| node_scheduler
node_scheduler -->|"invokes daily"| node_daily_email
node_scheduler -->|"invokes weekly"| node_weekly_email
node_daily_email -->|"sends email"| node_mail_service
node_weekly_email -->|"sends email"| node_mail_service

click node_dashboard "https://github.com/333ian/weekly-planning-bot/blob/master/index.html"
click node_task_submit "https://github.com/333ian/weekly-planning-bot/blob/master/index.html"
click node_post_handler "https://github.com/333ian/weekly-planning-bot/blob/master/Code.js"
click node_task_parse "https://github.com/333ian/weekly-planning-bot/blob/master/Code.js"
click node_event_create "https://github.com/333ian/weekly-planning-bot/blob/master/Code.js"
click node_event_reminder "https://github.com/333ian/weekly-planning-bot/blob/master/Code.js"
click node_post_response "https://github.com/333ian/weekly-planning-bot/blob/master/Code.js"
click node_trigger_setup "https://github.com/333ian/weekly-planning-bot/blob/master/Code.js"
click node_daily_email "https://github.com/333ian/weekly-planning-bot/blob/master/Code.js"
click node_weekly_email "https://github.com/333ian/weekly-planning-bot/blob/master/Code.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_dashboard,node_task_submit toneBlue
class node_post_handler,node_task_parse,node_event_create,node_event_reminder,node_post_response toneAmber
class node_trigger_setup,node_daily_email,node_weekly_email toneMint
class node_calendar_store,node_mail_service,node_scheduler toneRose
class node_user toneIndigo
```

## Components

### Task planning

- [Task dashboard](https://github.com/333ian/weekly-planning-bot/blob/master/index.html): `index.html`
- [Task submission](https://github.com/333ian/weekly-planning-bot/blob/master/index.html): `index.html`

### Calendar workflow

- [POST handler](https://github.com/333ian/weekly-planning-bot/blob/master/Code.js): `Code.js`
- [Parse task](https://github.com/333ian/weekly-planning-bot/blob/master/Code.js): `Code.js`
- [Create event](https://github.com/333ian/weekly-planning-bot/blob/master/Code.js): `Code.js`
- [Event reminder](https://github.com/333ian/weekly-planning-bot/blob/master/Code.js): `Code.js`
- [Success response](https://github.com/333ian/weekly-planning-bot/blob/master/Code.js): `Code.js`

### Email reminders

- [Trigger setup](https://github.com/333ian/weekly-planning-bot/blob/master/Code.js): `Code.js`
- [Daily reminder](https://github.com/333ian/weekly-planning-bot/blob/master/Code.js): `Code.js`
- [Weekend and weekly mail](https://github.com/333ian/weekly-planning-bot/blob/master/Code.js): `Code.js`

### Google services

- **Google Calendar**
- **Google MailApp**
- **Time-based triggers**

### Other components

- **Planner**

## Connections

- Planner → Task dashboard: uses (evidence: `README.md`)
- Task dashboard → Task submission: enters task (evidence: `README.md`)
- Task submission → POST handler: POSTs task (evidence: `README.md`)
- POST handler → Parse task: parses payload (evidence: `Code.js`)
- POST handler → Create event: creates event (evidence: `Code.js`)
- Create event → Google Calendar: writes event (evidence: `Code.js`)
- POST handler → Event reminder: adds reminder (evidence: `Code.js`)
- Event reminder → Google Calendar: sets notification (evidence: `Code.js`)
- POST handler → Success response: returns result (evidence: `Code.js`)
- Success response → Task submission: reports status (evidence: `README.md`)
- Trigger setup → Time-based triggers: registers jobs (evidence: `Code.js`)
- Time-based triggers → Daily reminder: invokes daily (evidence: `Code.js`)
- Time-based triggers → Weekend and weekly mail: invokes weekly (evidence: `Code.js`)
- Daily reminder → Google MailApp: sends email (evidence: `Code.js`)
- Weekend and weekly mail → Google MailApp: sends email (evidence: `Code.js`)
