# theshivam06/prepwise architecture

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

- Interactive diagram: https://gitdiagram.com/theshivam06/prepwise
- Repository: https://github.com/theshivam06/prepwise

## Overview

Prepwise is a study-planning PWA with local exam, session and schedule management, plus optional Cloudflare-backed Web Push reminders. The main user workflow is to organize study work in the browser, schedule or import sessions, and receive reminders; push setup registers a device and queues reminders for server delivery. The excerpts establish key client storage/import behavior and worker push operations, but not all UI handlers or API routing, so unsupported connections are omitted.

Main entry points: [`universal_exam_prep/app.js`](https://github.com/theshivam06/prepwise/blob/main/universal_exam_prep/app.js) (Import review), [`src/worker.js`](https://github.com/theshivam06/prepwise/blob/main/src/worker.js) (Push API), [`universal_exam_prep/sw.js`](https://github.com/theshivam06/prepwise/blob/main/universal_exam_prep/sw.js) (PWA service worker)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_study["Study planning"]
  node_planner["Study planner<br/>[app.js]"]
  node_localdata[("Browser study data")]
end

subgraph group_import["Schedule import"]
  node_importflow["Import review<br/>[app.js]"]
  node_importdata[("Import drafts/history")]
end

subgraph group_push["Push reminders"]
  node_pushclient["Push setup<br/>[app.js]"]
  node_api["Push API<br/>[worker.js]"]
  node_notificationdb[("Notification database")]
  node_device["Registered device"]
end

subgraph group_platform["Runtime platform"]
  node_serviceworker["PWA service worker<br/>[sw.js]"]
end

node_student(("Student"))
node_pushservice{{"Web Push service"}}

node_student -->|"manages study"| node_planner
node_planner -->|"reads and writes"| node_localdata
node_student -->|"imports schedule"| node_importflow
node_importflow -->|"saves drafts/history"| node_importdata
node_importflow -->|"writes sessions"| node_localdata
node_pushclient -.->|"push requests"| node_api
node_api -->|"queries and updates"| node_notificationdb
node_api -->|"sends encrypted push"| node_pushservice
node_pushservice -.->|"delivers push event"| node_serviceworker
node_serviceworker -->|"shows notification"| node_device

click node_planner "https://github.com/theshivam06/prepwise/blob/main/universal_exam_prep/app.js"
click node_importflow "https://github.com/theshivam06/prepwise/blob/main/universal_exam_prep/app.js"
click node_pushclient "https://github.com/theshivam06/prepwise/blob/main/universal_exam_prep/app.js"
click node_serviceworker "https://github.com/theshivam06/prepwise/blob/main/universal_exam_prep/sw.js"
click node_api "https://github.com/theshivam06/prepwise/blob/main/src/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_planner,node_localdata toneBlue
class node_importflow,node_importdata toneAmber
class node_pushclient,node_api,node_notificationdb,node_device toneMint
class node_serviceworker toneRose
class node_student,node_pushservice toneIndigo
```

## Components

### Study planning

- [Study planner](https://github.com/theshivam06/prepwise/blob/main/universal_exam_prep/app.js): `universal_exam_prep/app.js`
- **Browser study data**

### Schedule import

- [Import review](https://github.com/theshivam06/prepwise/blob/main/universal_exam_prep/app.js): `universal_exam_prep/app.js`
- **Import drafts/history**

### Push reminders

- [Push setup](https://github.com/theshivam06/prepwise/blob/main/universal_exam_prep/app.js): `universal_exam_prep/app.js`
- [Push API](https://github.com/theshivam06/prepwise/blob/main/src/worker.js): `src/worker.js`
- **Notification database**
- **Registered device**

### Runtime platform

- [PWA service worker](https://github.com/theshivam06/prepwise/blob/main/universal_exam_prep/sw.js): `universal_exam_prep/sw.js`

### Other components

- **Student**
- **Web Push service**

## Connections

- Student → Study planner: manages study
- Study planner → Browser study data: reads and writes (evidence: `universal_exam_prep/app.js`)
- Student → Import review: imports schedule
- Import review → Import drafts/history: saves drafts/history (evidence: `universal_exam_prep/app.js`)
- Import review → Browser study data: writes sessions (evidence: `universal_exam_prep/app.js`)
- Push setup → Push API: push requests
- Push API → Notification database: queries and updates (evidence: `src/worker.js`)
- Push API → Web Push service: sends encrypted push (evidence: `src/worker.js`)
- Web Push service → PWA service worker: delivers push event
- PWA service worker → Registered device: shows notification (evidence: `universal_exam_prep/sw.js`)
