# obra/morning-routine-board architecture

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

- Interactive diagram: https://gitdiagram.com/obra/morning-routine-board
- Repository: https://github.com/obra/morning-routine-board

## Overview

Morning Board is an offline-capable, single-device checklist for two children. A child taps a task tile; the app updates that day’s check-offs, saves them in browser storage, and redraws the board. At 3 a.m. local time, the board advances to a new day. A parent opens settings with a two-second gear press to edit children and weekday-specific tasks or reset data. The graph follows the sampled app wiring and module references; the README documents offline use and local-only storage, while unsampled page markup and styling are omitted.

Main entry points: [`src/app.js`](https://github.com/obra/morning-routine-board/blob/main/src/app.js) (App coordinator), [`src/settings.js`](https://github.com/obra/morning-routine-board/blob/main/src/settings.js) (Parent settings), [`src/view.js`](https://github.com/obra/morning-routine-board/blob/main/src/view.js) (Board view model), [`src/store.js`](https://github.com/obra/morning-routine-board/blob/main/src/store.js) (State store)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interaction["Board and settings"]
  node_app["App coordinator<br/>[app.js]"]
  node_board["Board renderer<br/>[board.js]"]
  node_settings["Parent settings<br/>[settings.js]"]
end

subgraph group_domain["Routine domain"]
  node_view["Board view model<br/>[view.js]"]
  node_model["Kids and tasks<br/>[model.js]"]
  node_day["Board-day logic<br/>[day.js]"]
  node_emoji["Emoji palette<br/>[emoji.js]"]
end

subgraph group_runtime["Persistence and offline"]
  node_store["State store<br/>[store.js]"]
  node_browserstorage[("Browser storage")]
  node_worker["Offline service worker<br/>[sw.js]"]
  node_cache[("Browser cache")]
end

node_family(("Children and parent"))

node_family -.->|"uses board"| node_app
node_family -.->|"edits routines"| node_settings
node_app -->|"loads and saves"| node_store
node_store -->|"reads and writes"| node_browserstorage
node_app -->|"checks rollover"| node_day
node_app -->|"builds columns"| node_view
node_view -->|"selects tasks"| node_model
node_view -->|"gets weekday"| node_day
node_app -->|"renders board"| node_board
node_app -->|"renders settings"| node_settings
node_settings -->|"edits routines"| node_model
node_settings -->|"offers palette"| node_emoji
node_app -->|"registers worker"| node_worker
node_worker -->|"caches app assets"| node_cache

click node_app "https://github.com/obra/morning-routine-board/blob/main/src/app.js"
click node_board "https://github.com/obra/morning-routine-board/blob/main/src/board.js"
click node_settings "https://github.com/obra/morning-routine-board/blob/main/src/settings.js"
click node_view "https://github.com/obra/morning-routine-board/blob/main/src/view.js"
click node_model "https://github.com/obra/morning-routine-board/blob/main/src/model.js"
click node_day "https://github.com/obra/morning-routine-board/blob/main/src/day.js"
click node_emoji "https://github.com/obra/morning-routine-board/blob/main/src/emoji.js"
click node_store "https://github.com/obra/morning-routine-board/blob/main/src/store.js"
click node_worker "https://github.com/obra/morning-routine-board/blob/main/sw.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_board,node_settings toneBlue
class node_view,node_model,node_day,node_emoji toneAmber
class node_store,node_browserstorage,node_worker,node_cache toneMint
class node_family toneIndigo
```

## Components

### Board and settings

- [App coordinator](https://github.com/obra/morning-routine-board/blob/main/src/app.js): `src/app.js`
- [Board renderer](https://github.com/obra/morning-routine-board/blob/main/src/board.js): `src/board.js`
- [Parent settings](https://github.com/obra/morning-routine-board/blob/main/src/settings.js): `src/settings.js`

### Routine domain

- [Board view model](https://github.com/obra/morning-routine-board/blob/main/src/view.js): `src/view.js`
- [Kids and tasks](https://github.com/obra/morning-routine-board/blob/main/src/model.js): `src/model.js`
- [Board-day logic](https://github.com/obra/morning-routine-board/blob/main/src/day.js): `src/day.js`
- [Emoji palette](https://github.com/obra/morning-routine-board/blob/main/src/emoji.js): `src/emoji.js`

### Persistence and offline

- [State store](https://github.com/obra/morning-routine-board/blob/main/src/store.js): `src/store.js`
- **Browser storage**
- [Offline service worker](https://github.com/obra/morning-routine-board/blob/main/sw.js): `sw.js`
- **Browser cache**

### Other components

- **Children and parent**

## Connections

- Children and parent → App coordinator: uses board (evidence: `README.md`)
- Children and parent → Parent settings: edits routines (evidence: `README.md`)
- App coordinator → State store: loads and saves (evidence: `src/app.js`)
- State store → Browser storage: reads and writes (evidence: `src/store.js`)
- App coordinator → Board-day logic: checks rollover (evidence: `src/app.js`)
- App coordinator → Board view model: builds columns (evidence: `src/app.js`)
- Board view model → Kids and tasks: selects tasks (evidence: `src/view.js`)
- Board view model → Board-day logic: gets weekday (evidence: `src/view.js`)
- App coordinator → Board renderer: renders board (evidence: `src/app.js`)
- App coordinator → Parent settings: renders settings (evidence: `src/app.js`)
- Parent settings → Kids and tasks: edits routines (evidence: `src/settings.js`)
- Parent settings → Emoji palette: offers palette (evidence: `src/settings.js`)
- App coordinator → Offline service worker: registers worker (evidence: `src/app.js`)
- Offline service worker → Browser cache: caches app assets (evidence: `sw.js`)
