# asmitsr/ielts-60-day-app architecture

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

- Interactive diagram: https://gitdiagram.com/asmitsr/ielts-60-day-app
- Repository: https://github.com/asmitsr/ielts-60-day-app

## Overview

IELTS 60-Day is a Bengali study tracker with account-based, cross-device progress, structured learning references, and an AI assistant. The main journey is learner → sign-in → choose a study section → track plan tasks or consult study material → save progress and block times through the Pages API to D1. The graph also preserves the documented account, settings, practice, mock-test, and learning-reference capabilities. Some API handlers and the AI UI are represented at their exact tree paths; their internal details were not sampled.

Main entry points: [`src/App.tsx`](https://github.com/asmitsr/ielts-60-day-app/blob/main/src/App.tsx) (App shell), [`src/lib/api.ts`](https://github.com/asmitsr/ielts-60-day-app/blob/main/src/lib/api.ts) (API client), [`src/sections/PlanSection.tsx`](https://github.com/asmitsr/ielts-60-day-app/blob/main/src/sections/PlanSection.tsx) (60-day plan), [`functions/api/auth`](https://github.com/asmitsr/ielts-60-day-app/tree/main/functions/api/auth) (Account endpoints)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_learning["Study experience"]
  node_plan["60-day plan<br/>[PlanSection.tsx]"]
  node_plan_data["Plan and mocks<br/>[plan.ts]"]
  node_steps["Steps guide<br/>[StepsSection.tsx]"]
  node_steps_data["Step content<br/>[steps.ts]"]
  node_practice["Practice links"]
  node_practice_data["Practice content<br/>[practice.ts]"]
  node_resources["Resource library"]
  node_resource_data["Resource links<br/>[resources.ts]"]
  node_exam_format["Exam format<br/>[FormatSection.tsx]"]
  node_format_data["Format facts<br/>[formatGuide.ts]"]
  node_cuecards["Cue cards"]
  node_techniques["Techniques"]
  node_settings["Settings"]
  node_ai_ui["AI assistant<br/>[AiSection.tsx]"]
end

subgraph group_frontend["App and client"]
  node_app["App shell<br/>[App.tsx]"]
  node_authui["Sign-in UI<br/>[AuthScreen.tsx]"]
  node_api_client["API client<br/>[api.ts]"]
end

subgraph group_backend["Pages API"]
  node_progress_api["Progress API<br/>[progress.ts]"]
  node_block_api["Block-times API<br/>[block-times.ts]"]
  node_auth_api["Account endpoints"]
  node_ai_api["AI chat endpoint<br/>[chat.ts]"]
end

subgraph group_identity["Accounts and security"]
  node_auth_lib["Auth and sessions<br/>[auth.ts]"]
end

subgraph group_storage["Persistence and AI"]
  node_ai_lib["AI context and keys<br/>[ai.ts]"]
  node_d1[("Cloudflare D1")]
end

node_learner(("Learner"))
node_ai_provider(("AI provider"))

node_learner -->|"signs in"| node_authui
node_authui -->|"submits credentials"| node_api_client
node_app -->|"checks session"| node_api_client
node_app -->|"shows gate"| node_authui
node_app -->|"renders section"| node_plan
node_app -->|"renders section"| node_steps
node_app -->|"renders section"| node_practice
node_app -->|"renders section"| node_resources
node_app -->|"renders section"| node_exam_format
node_app -->|"renders section"| node_cuecards
node_app -->|"renders section"| node_techniques
node_app -->|"renders section"| node_settings
node_app -->|"renders section"| node_ai_ui
node_plan -->|"reads plan"| node_plan_data
node_steps -->|"reads guides"| node_steps_data
node_practice -->|"reads links"| node_practice_data
node_resources -->|"reads links"| node_resource_data
node_exam_format -->|"reads facts"| node_format_data
node_plan -.->|"saves progress"| node_api_client
node_plan -.->|"saves block times"| node_api_client
node_settings -->|"updates preferences"| node_api_client
node_ai_ui -->|"sends questions"| node_api_client
node_api_client -->|"requests progress"| node_progress_api
node_api_client -->|"requests block times"| node_block_api
node_api_client -->|"calls account routes"| node_auth_api
node_api_client -.->|"requests AI chat"| node_ai_api
node_progress_api -->|"reads and writes"| node_d1
node_block_api -->|"reads and writes"| node_d1
node_auth_api -.->|"uses auth helpers"| node_auth_lib
node_auth_api -->|"stores accounts and sessions"| node_d1
node_ai_api -->|"checks session"| node_auth_lib
node_ai_api -->|"builds chat context"| node_ai_lib
node_ai_lib -->|"grounds answers"| node_plan_data
node_ai_lib -.->|"invokes model"| node_ai_provider

click node_app "https://github.com/asmitsr/ielts-60-day-app/blob/main/src/App.tsx"
click node_authui "https://github.com/asmitsr/ielts-60-day-app/blob/main/src/components/AuthScreen.tsx"
click node_api_client "https://github.com/asmitsr/ielts-60-day-app/blob/main/src/lib/api.ts"
click node_plan "https://github.com/asmitsr/ielts-60-day-app/blob/main/src/sections/PlanSection.tsx"
click node_plan_data "https://github.com/asmitsr/ielts-60-day-app/blob/main/src/data/plan.ts"
click node_steps "https://github.com/asmitsr/ielts-60-day-app/blob/main/src/sections/StepsSection.tsx"
click node_steps_data "https://github.com/asmitsr/ielts-60-day-app/blob/main/src/data/steps.ts"
click node_practice "https://github.com/asmitsr/ielts-60-day-app/blob/main/src/sections/PracticeSection.tsx"
click node_practice_data "https://github.com/asmitsr/ielts-60-day-app/blob/main/src/data/practice.ts"
click node_resources "https://github.com/asmitsr/ielts-60-day-app/blob/main/src/sections/ResourcesSection.tsx"
click node_resource_data "https://github.com/asmitsr/ielts-60-day-app/blob/main/src/data/resources.ts"
click node_exam_format "https://github.com/asmitsr/ielts-60-day-app/blob/main/src/sections/FormatSection.tsx"
click node_format_data "https://github.com/asmitsr/ielts-60-day-app/blob/main/src/data/formatGuide.ts"
click node_cuecards "https://github.com/asmitsr/ielts-60-day-app/blob/main/src/sections/CueCardsSection.tsx"
click node_techniques "https://github.com/asmitsr/ielts-60-day-app/blob/main/src/sections/TechniquesSection.tsx"
click node_settings "https://github.com/asmitsr/ielts-60-day-app/blob/main/src/sections/SettingsSection.tsx"
click node_ai_ui "https://github.com/asmitsr/ielts-60-day-app/blob/main/src/sections/AiSection.tsx"
click node_progress_api "https://github.com/asmitsr/ielts-60-day-app/blob/main/functions/api/progress.ts"
click node_block_api "https://github.com/asmitsr/ielts-60-day-app/blob/main/functions/api/block-times.ts"
click node_auth_api "https://github.com/asmitsr/ielts-60-day-app/tree/main/functions/api/auth"
click node_auth_lib "https://github.com/asmitsr/ielts-60-day-app/blob/main/functions/_lib/auth.ts"
click node_ai_api "https://github.com/asmitsr/ielts-60-day-app/blob/main/functions/api/ai/chat.ts"
click node_ai_lib "https://github.com/asmitsr/ielts-60-day-app/blob/main/functions/_lib/ai.ts"

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_plan,node_plan_data,node_steps,node_steps_data,node_practice,node_practice_data,node_resources,node_resource_data,node_exam_format,node_format_data,node_cuecards,node_techniques,node_settings,node_ai_ui toneBlue
class node_app,node_authui,node_api_client toneAmber
class node_progress_api,node_block_api,node_auth_api,node_ai_api toneMint
class node_auth_lib toneRose
class node_ai_lib,node_d1,node_learner,node_ai_provider toneIndigo
```

## Components

### Study experience

- [60-day plan](https://github.com/asmitsr/ielts-60-day-app/blob/main/src/sections/PlanSection.tsx): `src/sections/PlanSection.tsx`
- [Plan and mocks](https://github.com/asmitsr/ielts-60-day-app/blob/main/src/data/plan.ts): `src/data/plan.ts`
- [Steps guide](https://github.com/asmitsr/ielts-60-day-app/blob/main/src/sections/StepsSection.tsx): `src/sections/StepsSection.tsx`
- [Step content](https://github.com/asmitsr/ielts-60-day-app/blob/main/src/data/steps.ts): `src/data/steps.ts`
- [Practice links](https://github.com/asmitsr/ielts-60-day-app/blob/main/src/sections/PracticeSection.tsx): `src/sections/PracticeSection.tsx`
- [Practice content](https://github.com/asmitsr/ielts-60-day-app/blob/main/src/data/practice.ts): `src/data/practice.ts`
- [Resource library](https://github.com/asmitsr/ielts-60-day-app/blob/main/src/sections/ResourcesSection.tsx): `src/sections/ResourcesSection.tsx`
- [Resource links](https://github.com/asmitsr/ielts-60-day-app/blob/main/src/data/resources.ts): `src/data/resources.ts`
- [Exam format](https://github.com/asmitsr/ielts-60-day-app/blob/main/src/sections/FormatSection.tsx): `src/sections/FormatSection.tsx`
- [Format facts](https://github.com/asmitsr/ielts-60-day-app/blob/main/src/data/formatGuide.ts): `src/data/formatGuide.ts`
- [Cue cards](https://github.com/asmitsr/ielts-60-day-app/blob/main/src/sections/CueCardsSection.tsx): `src/sections/CueCardsSection.tsx`
- [Techniques](https://github.com/asmitsr/ielts-60-day-app/blob/main/src/sections/TechniquesSection.tsx): `src/sections/TechniquesSection.tsx`
- [Settings](https://github.com/asmitsr/ielts-60-day-app/blob/main/src/sections/SettingsSection.tsx): `src/sections/SettingsSection.tsx`
- [AI assistant](https://github.com/asmitsr/ielts-60-day-app/blob/main/src/sections/AiSection.tsx): `src/sections/AiSection.tsx`

### App and client

- [App shell](https://github.com/asmitsr/ielts-60-day-app/blob/main/src/App.tsx): `src/App.tsx`
- [Sign-in UI](https://github.com/asmitsr/ielts-60-day-app/blob/main/src/components/AuthScreen.tsx): `src/components/AuthScreen.tsx`
- [API client](https://github.com/asmitsr/ielts-60-day-app/blob/main/src/lib/api.ts): `src/lib/api.ts`

### Pages API

- [Progress API](https://github.com/asmitsr/ielts-60-day-app/blob/main/functions/api/progress.ts): `functions/api/progress.ts`
- [Block-times API](https://github.com/asmitsr/ielts-60-day-app/blob/main/functions/api/block-times.ts): `functions/api/block-times.ts`
- [Account endpoints](https://github.com/asmitsr/ielts-60-day-app/tree/main/functions/api/auth): `functions/api/auth`
- [AI chat endpoint](https://github.com/asmitsr/ielts-60-day-app/blob/main/functions/api/ai/chat.ts): `functions/api/ai/chat.ts`

### Accounts and security

- [Auth and sessions](https://github.com/asmitsr/ielts-60-day-app/blob/main/functions/_lib/auth.ts): `functions/_lib/auth.ts`

### Persistence and AI

- [AI context and keys](https://github.com/asmitsr/ielts-60-day-app/blob/main/functions/_lib/ai.ts): `functions/_lib/ai.ts`
- **Cloudflare D1**

### Other components

- **Learner**
- **AI provider**

## Connections

- Learner → Sign-in UI: signs in (evidence: `src/components/AuthScreen.tsx`)
- Sign-in UI → API client: submits credentials (evidence: `src/components/AuthScreen.tsx`)
- App shell → API client: checks session (evidence: `src/App.tsx`)
- App shell → Sign-in UI: shows gate (evidence: `src/App.tsx`)
- App shell → 60-day plan: renders section (evidence: `src/App.tsx`)
- App shell → Steps guide: renders section (evidence: `src/App.tsx`)
- App shell → Practice links: renders section (evidence: `src/App.tsx`)
- App shell → Resource library: renders section (evidence: `src/App.tsx`)
- App shell → Exam format: renders section (evidence: `src/App.tsx`)
- App shell → Cue cards: renders section (evidence: `src/App.tsx`)
- App shell → Techniques: renders section (evidence: `src/App.tsx`)
- App shell → Settings: renders section (evidence: `src/App.tsx`)
- App shell → AI assistant: renders section (evidence: `src/App.tsx`)
- 60-day plan → Plan and mocks: reads plan (evidence: `src/data/plan.ts`)
- Steps guide → Step content: reads guides (evidence: `src/data/steps.ts`)
- Practice links → Practice content: reads links (evidence: `src/sections/PracticeSection.tsx`)
- Resource library → Resource links: reads links (evidence: `src/sections/ResourcesSection.tsx`)
- Exam format → Format facts: reads facts (evidence: `src/sections/FormatSection.tsx`)
- 60-day plan → API client: saves progress
- 60-day plan → API client: saves block times
- Settings → API client: updates preferences (evidence: `src/sections/SettingsSection.tsx`)
- AI assistant → API client: sends questions (evidence: `src/sections/AiSection.tsx`)
- API client → Progress API: requests progress (evidence: `src/lib/api.ts`)
- API client → Block-times API: requests block times (evidence: `src/lib/api.ts`)
- API client → Account endpoints: calls account routes (evidence: `src/lib/api.ts`)
- API client → AI chat endpoint: requests AI chat
- Progress API → Cloudflare D1: reads and writes (evidence: `README.md`)
- Block-times API → Cloudflare D1: reads and writes (evidence: `README.md`)
- Account endpoints → Auth and sessions: uses auth helpers (evidence: `functions/api/auth/sessions.ts`)
- Account endpoints → Cloudflare D1: stores accounts and sessions (evidence: `README.md`)
- AI chat endpoint → Auth and sessions: checks session (evidence: `functions/api/ai/chat.ts`)
- AI chat endpoint → AI context and keys: builds chat context (evidence: `functions/api/ai/chat.ts`)
- AI context and keys → Plan and mocks: grounds answers (evidence: `functions/_lib/ai.ts`)
- AI context and keys → AI provider: invokes model
