# xanax1990/pomodoro-webapp architecture

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

- Interactive diagram: https://gitdiagram.com/xanax1990/pomodoro-webapp
- Repository: https://github.com/xanax1990/pomodoro-webapp

## Overview

This static Pomodoro app lets users choose a focus preset, manage tasks, and run Pomodoro or break sessions; completion drives alarms, notifications, and optional ADHD movement/reward flows. The main module wires timer, audio, task, and interface modules, with shared state persisting settings and session data in browser storage. The README documents Firebase-backed ratings and PWA/offline support. Some integrations are represented from README documentation because their implementation files were not excerpted.

Main entry points: [`public/js/main.js`](https://github.com/xanax1990/pomodoro-webapp/blob/main/public/js/main.js) (App wiring), [`public/js/state.js`](https://github.com/xanax1990/pomodoro-webapp/blob/main/public/js/state.js) (Shared app state), [`public/js/timer.js`](https://github.com/xanax1990/pomodoro-webapp/blob/main/public/js/timer.js) (Timer engine), [`public/js/tasks.js`](https://github.com/xanax1990/pomodoro-webapp/blob/main/public/js/tasks.js) (Task management)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_session["Focus sessions"]
  node_main["App wiring<br/>[main.js]"]
  node_timer["Timer engine<br/>[timer.js]"]
  node_preset["Presets and elements<br/>[config.js]"]
  node_adhd["ADHD movement<br/>[movement.js]"]
  node_reward["Reward breaks<br/>[reward.js]"]
  node_milestone["Micro-rewards<br/>[milestone.js]"]
end

subgraph group_experience["User experience"]
  node_tasks["Task management<br/>[tasks.js]"]
  node_render["Timer display<br/>[render.js]"]
  node_audio["Music and alarms<br/>[audio.js]"]
  node_theme["Theme controls<br/>[darkmode.js]"]
  node_ui["Interface controls<br/>[ui.js]"]
end

subgraph group_persistence["State and persistence"]
  node_state["Shared app state<br/>[state.js]"]
  node_browserstore[("Browser storage")]
end

subgraph group_platform["Platform integrations"]
  node_rating["Rating flow<br/>[rating.js]"]
  node_firebase[("Firebase<br/>[firebase-config.js]")]
  node_pwa["PWA and notifications<br/>[pwa.js]"]
  node_sw["Service worker<br/>[service-worker.js]"]
end

node_user(("User"))

node_user -.->|"uses app"| node_main
node_main -->|"initializes"| node_timer
node_main -->|"initializes"| node_tasks
node_main -->|"initializes"| node_audio
node_main -->|"initializes"| node_render
node_main -->|"initializes"| node_ui
node_main -->|"initializes"| node_theme
node_main -->|"wires flow"| node_rating
node_main -->|"wires flow"| node_adhd
node_main -->|"wires flow"| node_reward
node_main -->|"wires flow"| node_milestone
node_main -->|"wires flow"| node_pwa
node_timer -->|"saves session"| node_state
node_timer -->|"reads presets"| node_preset
node_timer -->|"requests repaint"| node_render
node_tasks -->|"saves tasks"| node_state
node_tasks -->|"persists tasks"| node_browserstore
node_state -->|"persists state"| node_browserstore
node_audio -->|"saves playback"| node_state
node_audio -->|"reads tracks"| node_preset
node_render -->|"reads state"| node_state
node_theme -->|"reads theme"| node_state
node_adhd -.->|"triggers reward"| node_reward
node_rating -.->|"writes ratings"| node_firebase
node_pwa -->|"registers worker"| node_sw
node_pwa -->|"shows notifications"| node_user

click node_main "https://github.com/xanax1990/pomodoro-webapp/blob/main/public/js/main.js"
click node_timer "https://github.com/xanax1990/pomodoro-webapp/blob/main/public/js/timer.js"
click node_preset "https://github.com/xanax1990/pomodoro-webapp/blob/main/public/js/config.js"
click node_adhd "https://github.com/xanax1990/pomodoro-webapp/blob/main/public/js/movement.js"
click node_reward "https://github.com/xanax1990/pomodoro-webapp/blob/main/public/js/reward.js"
click node_milestone "https://github.com/xanax1990/pomodoro-webapp/blob/main/public/js/milestone.js"
click node_tasks "https://github.com/xanax1990/pomodoro-webapp/blob/main/public/js/tasks.js"
click node_render "https://github.com/xanax1990/pomodoro-webapp/blob/main/public/js/render.js"
click node_audio "https://github.com/xanax1990/pomodoro-webapp/blob/main/public/js/audio.js"
click node_theme "https://github.com/xanax1990/pomodoro-webapp/blob/main/public/js/darkmode.js"
click node_ui "https://github.com/xanax1990/pomodoro-webapp/blob/main/public/js/ui.js"
click node_state "https://github.com/xanax1990/pomodoro-webapp/blob/main/public/js/state.js"
click node_rating "https://github.com/xanax1990/pomodoro-webapp/blob/main/public/js/rating.js"
click node_firebase "https://github.com/xanax1990/pomodoro-webapp/blob/main/public/firebase-config.js"
click node_pwa "https://github.com/xanax1990/pomodoro-webapp/blob/main/public/js/pwa.js"
click node_sw "https://github.com/xanax1990/pomodoro-webapp/blob/main/public/service-worker.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_main,node_timer,node_preset,node_adhd,node_reward,node_milestone,node_user toneBlue
class node_tasks,node_render,node_audio,node_theme,node_ui toneAmber
class node_state,node_browserstore toneMint
class node_rating,node_firebase,node_pwa,node_sw toneRose
```

## Components

### Focus sessions

- [App wiring](https://github.com/xanax1990/pomodoro-webapp/blob/main/public/js/main.js): `public/js/main.js`
- [Timer engine](https://github.com/xanax1990/pomodoro-webapp/blob/main/public/js/timer.js): `public/js/timer.js`
- [Presets and elements](https://github.com/xanax1990/pomodoro-webapp/blob/main/public/js/config.js): `public/js/config.js`
- [ADHD movement](https://github.com/xanax1990/pomodoro-webapp/blob/main/public/js/movement.js): `public/js/movement.js`
- [Reward breaks](https://github.com/xanax1990/pomodoro-webapp/blob/main/public/js/reward.js): `public/js/reward.js`
- [Micro-rewards](https://github.com/xanax1990/pomodoro-webapp/blob/main/public/js/milestone.js): `public/js/milestone.js`

### User experience

- [Task management](https://github.com/xanax1990/pomodoro-webapp/blob/main/public/js/tasks.js): `public/js/tasks.js`
- [Timer display](https://github.com/xanax1990/pomodoro-webapp/blob/main/public/js/render.js): `public/js/render.js`
- [Music and alarms](https://github.com/xanax1990/pomodoro-webapp/blob/main/public/js/audio.js): `public/js/audio.js`
- [Theme controls](https://github.com/xanax1990/pomodoro-webapp/blob/main/public/js/darkmode.js): `public/js/darkmode.js`
- [Interface controls](https://github.com/xanax1990/pomodoro-webapp/blob/main/public/js/ui.js): `public/js/ui.js`

### State and persistence

- [Shared app state](https://github.com/xanax1990/pomodoro-webapp/blob/main/public/js/state.js): `public/js/state.js`
- **Browser storage**

### Platform integrations

- [Rating flow](https://github.com/xanax1990/pomodoro-webapp/blob/main/public/js/rating.js): `public/js/rating.js`
- [Firebase](https://github.com/xanax1990/pomodoro-webapp/blob/main/public/firebase-config.js): `public/firebase-config.js`
- [PWA and notifications](https://github.com/xanax1990/pomodoro-webapp/blob/main/public/js/pwa.js): `public/js/pwa.js`
- [Service worker](https://github.com/xanax1990/pomodoro-webapp/blob/main/public/service-worker.js): `public/service-worker.js`

### Other components

- **User**

## Connections

- User → App wiring: uses app (evidence: `README.md`)
- App wiring → Timer engine: initializes (evidence: `public/js/main.js`)
- App wiring → Task management: initializes (evidence: `public/js/main.js`)
- App wiring → Music and alarms: initializes (evidence: `public/js/main.js`)
- App wiring → Timer display: initializes (evidence: `public/js/main.js`)
- App wiring → Interface controls: initializes (evidence: `public/js/main.js`)
- App wiring → Theme controls: initializes (evidence: `public/js/main.js`)
- App wiring → Rating flow: wires flow (evidence: `README.md`)
- App wiring → ADHD movement: wires flow (evidence: `README.md`)
- App wiring → Reward breaks: wires flow (evidence: `README.md`)
- App wiring → Micro-rewards: wires flow (evidence: `README.md`)
- App wiring → PWA and notifications: wires flow (evidence: `README.md`)
- Timer engine → Shared app state: saves session (evidence: `public/js/timer.js`)
- Timer engine → Presets and elements: reads presets (evidence: `public/js/timer.js`)
- Timer engine → Timer display: requests repaint (evidence: `public/js/timer.js`)
- Task management → Shared app state: saves tasks (evidence: `public/js/tasks.js`)
- Task management → Browser storage: persists tasks (evidence: `README.md`)
- Shared app state → Browser storage: persists state (evidence: `public/js/state.js`)
- Music and alarms → Shared app state: saves playback (evidence: `public/js/audio.js`)
- Music and alarms → Presets and elements: reads tracks (evidence: `public/js/audio.js`)
- Timer display → Shared app state: reads state (evidence: `public/js/render.js`)
- Theme controls → Shared app state: reads theme (evidence: `public/js/darkmode.js`)
- ADHD movement → Reward breaks: triggers reward (evidence: `README.md`)
- Rating flow → Firebase: writes ratings (evidence: `README.md`)
- PWA and notifications → Service worker: registers worker (evidence: `public/js/pwa.js`)
- PWA and notifications → User: shows notifications (evidence: `public/js/pwa.js`)
