# mkmanthra/countdown architecture

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

- Interactive diagram: https://gitdiagram.com/mkmanthra/countdown
- Repository: https://github.com/mkmanthra/countdown

## Overview

Countdown is a browser-only event countdown and reminder app. Users create and manage dated events, then view remaining or elapsed time; pinning and repeat rules affect event presentation and dates, while reminders use browser notifications. The graph separates the documented product stages from the single JavaScript implementation file. Source excerpts show countdown rendering, recurrence logic, notification scheduling, and service-worker caching; persistence and broader UI wiring are documented in the README but not shown in source excerpts.

Main entry points: [`script.js`](https://github.com/mkmanthra/countdown/blob/main/script.js) (Event management), [`index.html`](https://github.com/mkmanthra/countdown/blob/main/index.html) (App page), [`service-worker.js`](https://github.com/mkmanthra/countdown/blob/main/service-worker.js) (Service worker), [`style.css`](https://github.com/mkmanthra/countdown/blob/main/style.css) (Responsive styles)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["User interface"]
  node_page["App page<br/>[index.html]"]
  node_styles["Responsive styles<br/>[style.css]"]
end

subgraph group_events["Event lifecycle"]
  node_event_controller["Event management<br/>[script.js]"]
  node_event_list["Event cards<br/>[script.js]"]
  node_countdown["Countdown calculation<br/>[script.js]"]
  node_recurrence["Repeat dates<br/>[script.js]"]
  node_persistence["Event persistence<br/>[script.js]"]
  node_local_storage[("Local Storage")]
end

subgraph group_reminders["Reminders"]
  node_reminder_scheduler["Reminder scheduling<br/>[script.js]"]
  node_notifications["Notifications API"]
  node_popup["Reminder pop-ups<br/>[script.js]"]
end

subgraph group_offline["Offline support"]
  node_service_worker["Service worker<br/>[service-worker.js]"]
  node_cache_storage[("Cache Storage")]
  node_web_assets["Cached app assets"]
end

node_user(("User"))

node_user -->|"uses"| node_page
node_page -->|"runs app"| node_event_controller
node_styles -->|"styles"| node_page
node_event_controller -->|"renders"| node_event_list
node_event_list -->|"calculates days"| node_countdown
node_event_controller -->|"advances dates"| node_recurrence
node_event_controller -->|"saves events"| node_persistence
node_persistence -->|"stores data"| node_local_storage
node_event_controller -->|"schedules reminders"| node_reminder_scheduler
node_reminder_scheduler -->|"sends notification"| node_notifications
node_event_controller -.->|"shows pop-up"| node_popup
node_service_worker -->|"opens cache"| node_cache_storage
node_service_worker -->|"caches assets"| node_web_assets

click node_page "https://github.com/mkmanthra/countdown/blob/main/index.html"
click node_styles "https://github.com/mkmanthra/countdown/blob/main/style.css"
click node_event_controller "https://github.com/mkmanthra/countdown/blob/main/script.js"
click node_event_list "https://github.com/mkmanthra/countdown/blob/main/script.js"
click node_countdown "https://github.com/mkmanthra/countdown/blob/main/script.js"
click node_recurrence "https://github.com/mkmanthra/countdown/blob/main/script.js"
click node_persistence "https://github.com/mkmanthra/countdown/blob/main/script.js"
click node_reminder_scheduler "https://github.com/mkmanthra/countdown/blob/main/script.js"
click node_popup "https://github.com/mkmanthra/countdown/blob/main/script.js"
click node_service_worker "https://github.com/mkmanthra/countdown/blob/main/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_page,node_styles,node_user toneBlue
class node_event_controller,node_event_list,node_countdown,node_recurrence,node_persistence,node_local_storage toneAmber
class node_reminder_scheduler,node_notifications,node_popup toneMint
class node_service_worker,node_cache_storage,node_web_assets toneRose
```

## Components

### User interface

- [App page](https://github.com/mkmanthra/countdown/blob/main/index.html): `index.html`
- [Responsive styles](https://github.com/mkmanthra/countdown/blob/main/style.css): `style.css`

### Event lifecycle

- [Event management](https://github.com/mkmanthra/countdown/blob/main/script.js): `script.js`
- [Event cards](https://github.com/mkmanthra/countdown/blob/main/script.js): `script.js`
- [Countdown calculation](https://github.com/mkmanthra/countdown/blob/main/script.js): `script.js`
- [Repeat dates](https://github.com/mkmanthra/countdown/blob/main/script.js): `script.js`
- [Event persistence](https://github.com/mkmanthra/countdown/blob/main/script.js): `script.js`
- **Local Storage**

### Reminders

- [Reminder scheduling](https://github.com/mkmanthra/countdown/blob/main/script.js): `script.js`
- **Notifications API**
- [Reminder pop-ups](https://github.com/mkmanthra/countdown/blob/main/script.js): `script.js`

### Offline support

- [Service worker](https://github.com/mkmanthra/countdown/blob/main/service-worker.js): `service-worker.js`
- **Cache Storage**
- **Cached app assets**

### Other components

- **User**

## Connections

- User → App page: uses (evidence: `README.md`)
- App page → Event management: runs app (evidence: `README.md`)
- Responsive styles → App page: styles (evidence: `README.md`)
- Event management → Event cards: renders (evidence: `script.js`)
- Event cards → Countdown calculation: calculates days (evidence: `script.js`)
- Event management → Repeat dates: advances dates (evidence: `script.js`)
- Event management → Event persistence: saves events (evidence: `README.md`)
- Event persistence → Local Storage: stores data (evidence: `README.md`)
- Event management → Reminder scheduling: schedules reminders (evidence: `script.js`)
- Reminder scheduling → Notifications API: sends notification (evidence: `script.js`)
- Event management → Reminder pop-ups: shows pop-up (evidence: `script.js`)
- Service worker → Cache Storage: opens cache (evidence: `service-worker.js`)
- Service worker → Cached app assets: caches assets (evidence: `service-worker.js`)
