# aryan-kr-jha/procrasticure architecture

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

- Interactive diagram: https://gitdiagram.com/aryan-kr-jha/procrasticure
- Repository: https://github.com/aryan-kr-jha/procrasticure

## Overview

ProcrastiCure is a productivity workspace that turns a user’s written or spoken workload into prioritized tasks, then supports planning, focused work, and study. Its browser app also provides calendar views, focus telemetry, habits, recommendations, and study aids; the server exposes AI-backed APIs, while Supabase persists task state. The PWA service worker caches the app shell for offline use. Some client workflows are described in the README but their request code was not excerpted, so those links are shown as unverified rather than asserted as source-confirmed calls.

Main entry points: [`public/app.js`](https://github.com/aryan-kr-jha/procrasticure/blob/main/public/app.js) (Workspace controller), [`public/index.html`](https://github.com/aryan-kr-jha/procrasticure/blob/main/public/index.html) (Web workspace), [`server.js`](https://github.com/aryan-kr-jha/procrasticure/blob/main/server.js) (Task strategy), [`public/sw.js`](https://github.com/aryan-kr-jha/procrasticure/blob/main/public/sw.js) (Service worker)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["User experience"]
  node_webui["Web workspace<br/>[index.html]"]
  node_login["Login screen<br/>[login.html]"]
  node_client["Workspace controller<br/>[app.js]"]
end

subgraph group_planning["Planning and focus"]
  node_panic["Panic input<br/>[app.js]"]
  node_voice["Voice capture<br/>[app.js]"]
  node_calendar["Urgency calendar<br/>[app.js]"]
  node_scheduler["Auto scheduler<br/>[app.js]"]
  node_focus["Focus timer<br/>[app.js]"]
  node_telemetry["Focus telemetry<br/>[app.js]"]
  node_study["Study aids<br/>[app.js]"]
  node_coach["AI companion<br/>[app.js]"]
end

subgraph group_ai["AI services"]
  node_server["API server<br/>[server.js]"]
  node_strategy["Task strategy<br/>[server.js]"]
  node_voiceanalysis["Voice analysis<br/>[server.js]"]
  node_transcription["Audio transcription<br/>[server.js]"]
  node_scheduleapi["Schedule generation<br/>[server.js]"]
  node_studyapi["Study aid generation<br/>[server.js]"]
  node_chatapi["Chat endpoint<br/>[server.js]"]
  node_recommendations["Recommendations<br/>[server.js]"]
end

subgraph group_platform["Persistence and PWA"]
  node_supabase[("Supabase task store")]
  node_sw["Service worker<br/>[sw.js]"]
end

node_user(("Workspace user"))
node_gemini{{"Google Gemini"}}
node_cache[("Browser cache")]

node_user -->|"opens"| node_login
node_user -->|"uses"| node_webui
node_webui -.->|"hosts"| node_client
node_client -->|"captures"| node_panic
node_client -->|"records"| node_voice
node_panic -.->|"submits text"| node_strategy
node_voice -.->|"transcribes"| node_transcription
node_voice -.->|"analyzes audio"| node_voiceanalysis
node_strategy -->|"generates tasks"| node_gemini
node_voiceanalysis -->|"analyzes audio"| node_gemini
node_transcription -->|"transcribes audio"| node_gemini
node_client -->|"renders dates"| node_calendar
node_client -->|"builds schedule"| node_scheduler
node_scheduler -.->|"requests blocks"| node_scheduleapi
node_scheduleapi -->|"generates blocks"| node_gemini
node_client -->|"runs timer"| node_focus
node_client -->|"tracks progress"| node_telemetry
node_client -->|"opens aids"| node_study
node_study -->|"requests aids"| node_studyapi
node_studyapi -->|"generates aids"| node_gemini
node_client -->|"sends message"| node_coach
node_coach -->|"posts chat"| node_chatapi
node_chatapi -->|"generates reply"| node_gemini
node_client -.->|"requests tips"| node_recommendations
node_recommendations -->|"generates tips"| node_gemini
node_client -->|"reads and writes tasks"| node_supabase
node_sw -->|"stores shell"| node_cache

click node_webui "https://github.com/aryan-kr-jha/procrasticure/blob/main/public/index.html"
click node_login "https://github.com/aryan-kr-jha/procrasticure/blob/main/public/login.html"
click node_client "https://github.com/aryan-kr-jha/procrasticure/blob/main/public/app.js"
click node_panic "https://github.com/aryan-kr-jha/procrasticure/blob/main/public/app.js"
click node_voice "https://github.com/aryan-kr-jha/procrasticure/blob/main/public/app.js"
click node_calendar "https://github.com/aryan-kr-jha/procrasticure/blob/main/public/app.js"
click node_scheduler "https://github.com/aryan-kr-jha/procrasticure/blob/main/public/app.js"
click node_focus "https://github.com/aryan-kr-jha/procrasticure/blob/main/public/app.js"
click node_telemetry "https://github.com/aryan-kr-jha/procrasticure/blob/main/public/app.js"
click node_study "https://github.com/aryan-kr-jha/procrasticure/blob/main/public/app.js"
click node_coach "https://github.com/aryan-kr-jha/procrasticure/blob/main/public/app.js"
click node_server "https://github.com/aryan-kr-jha/procrasticure/blob/main/server.js"
click node_strategy "https://github.com/aryan-kr-jha/procrasticure/blob/main/server.js"
click node_voiceanalysis "https://github.com/aryan-kr-jha/procrasticure/blob/main/server.js"
click node_transcription "https://github.com/aryan-kr-jha/procrasticure/blob/main/server.js"
click node_scheduleapi "https://github.com/aryan-kr-jha/procrasticure/blob/main/server.js"
click node_studyapi "https://github.com/aryan-kr-jha/procrasticure/blob/main/server.js"
click node_chatapi "https://github.com/aryan-kr-jha/procrasticure/blob/main/server.js"
click node_recommendations "https://github.com/aryan-kr-jha/procrasticure/blob/main/server.js"
click node_sw "https://github.com/aryan-kr-jha/procrasticure/blob/main/public/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_webui,node_login,node_client,node_user toneBlue
class node_panic,node_voice,node_calendar,node_scheduler,node_focus,node_telemetry,node_study,node_coach,node_cache toneAmber
class node_server,node_strategy,node_voiceanalysis,node_transcription,node_scheduleapi,node_studyapi,node_chatapi,node_recommendations toneMint
class node_supabase,node_sw toneRose
class node_gemini toneIndigo
```

## Components

### User experience

- [Web workspace](https://github.com/aryan-kr-jha/procrasticure/blob/main/public/index.html): `public/index.html`
- [Login screen](https://github.com/aryan-kr-jha/procrasticure/blob/main/public/login.html): `public/login.html`
- [Workspace controller](https://github.com/aryan-kr-jha/procrasticure/blob/main/public/app.js): `public/app.js`

### Planning and focus

- [Panic input](https://github.com/aryan-kr-jha/procrasticure/blob/main/public/app.js): `public/app.js`
- [Voice capture](https://github.com/aryan-kr-jha/procrasticure/blob/main/public/app.js): `public/app.js`
- [Urgency calendar](https://github.com/aryan-kr-jha/procrasticure/blob/main/public/app.js): `public/app.js`
- [Auto scheduler](https://github.com/aryan-kr-jha/procrasticure/blob/main/public/app.js): `public/app.js`
- [Focus timer](https://github.com/aryan-kr-jha/procrasticure/blob/main/public/app.js): `public/app.js`
- [Focus telemetry](https://github.com/aryan-kr-jha/procrasticure/blob/main/public/app.js): `public/app.js`
- [Study aids](https://github.com/aryan-kr-jha/procrasticure/blob/main/public/app.js): `public/app.js`
- [AI companion](https://github.com/aryan-kr-jha/procrasticure/blob/main/public/app.js): `public/app.js`

### AI services

- [API server](https://github.com/aryan-kr-jha/procrasticure/blob/main/server.js): `server.js`
- [Task strategy](https://github.com/aryan-kr-jha/procrasticure/blob/main/server.js): `server.js`
- [Voice analysis](https://github.com/aryan-kr-jha/procrasticure/blob/main/server.js): `server.js`
- [Audio transcription](https://github.com/aryan-kr-jha/procrasticure/blob/main/server.js): `server.js`
- [Schedule generation](https://github.com/aryan-kr-jha/procrasticure/blob/main/server.js): `server.js`
- [Study aid generation](https://github.com/aryan-kr-jha/procrasticure/blob/main/server.js): `server.js`
- [Chat endpoint](https://github.com/aryan-kr-jha/procrasticure/blob/main/server.js): `server.js`
- [Recommendations](https://github.com/aryan-kr-jha/procrasticure/blob/main/server.js): `server.js`

### Persistence and PWA

- **Supabase task store**
- [Service worker](https://github.com/aryan-kr-jha/procrasticure/blob/main/public/sw.js): `public/sw.js`

### Other components

- **Workspace user**
- **Google Gemini**
- **Browser cache**

## Connections

- Workspace user → Login screen: opens (evidence: `README.md`)
- Workspace user → Web workspace: uses (evidence: `README.md`)
- Web workspace → Workspace controller: hosts
- Workspace controller → Panic input: captures (evidence: `README.md`)
- Workspace controller → Voice capture: records (evidence: `README.md`)
- Panic input → Task strategy: submits text
- Voice capture → Audio transcription: transcribes
- Voice capture → Voice analysis: analyzes audio
- Task strategy → Google Gemini: generates tasks (evidence: `server.js`)
- Voice analysis → Google Gemini: analyzes audio (evidence: `server.js`)
- Audio transcription → Google Gemini: transcribes audio (evidence: `server.js`)
- Workspace controller → Urgency calendar: renders dates (evidence: `public/app.js`)
- Workspace controller → Auto scheduler: builds schedule (evidence: `README.md`)
- Auto scheduler → Schedule generation: requests blocks
- Schedule generation → Google Gemini: generates blocks (evidence: `server.js`)
- Workspace controller → Focus timer: runs timer (evidence: `README.md`)
- Workspace controller → Focus telemetry: tracks progress (evidence: `README.md`)
- Workspace controller → Study aids: opens aids (evidence: `public/app.js`)
- Study aids → Study aid generation: requests aids (evidence: `public/app.js`)
- Study aid generation → Google Gemini: generates aids (evidence: `server.js`)
- Workspace controller → AI companion: sends message (evidence: `public/app.js`)
- AI companion → Chat endpoint: posts chat (evidence: `public/app.js`)
- Chat endpoint → Google Gemini: generates reply (evidence: `server.js`)
- Workspace controller → Recommendations: requests tips
- Recommendations → Google Gemini: generates tips (evidence: `server.js`)
- Workspace controller → Supabase task store: reads and writes tasks (evidence: `public/app.js`)
- Service worker → Browser cache: stores shell (evidence: `public/sw.js`)
