# priyanshujha4/gate-2027-dashboard-offline- architecture

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

- Interactive diagram: https://gitdiagram.com/priyanshujha4/gate-2027-dashboard-offline-
- Repository: https://github.com/priyanshujha4/gate-2027-dashboard-offline-

## Overview

GATE 2027 is an offline exam-preparation dashboard backed by local SQLite, with PDFs stored separately. The principal workflow is tracking study progress and plans, then reviewing weak areas through error logs, mock-test analysis, and revision tools. The graph preserves the README’s major feature areas and sampled domain logic; many routes and screens are indexed but unsampled, so their internal behavior and connections are omitted unless documented or shown by the source index.

Main entry points: [`lib/db.ts`](https://github.com/priyanshujha4/gate-2027-dashboard-offline-/blob/main/lib/db.ts) (SQLite database), [`app/api/error-logs/route.ts`](https://github.com/priyanshujha4/gate-2027-dashboard-offline-/blob/main/app/api/error-logs/route.ts) (Error log API), [`lib/weakTopics.ts`](https://github.com/priyanshujha4/gate-2027-dashboard-offline-/blob/main/lib/weakTopics.ts) (Weak-topic analysis), [`lib/topics.ts`](https://github.com/priyanshujha4/gate-2027-dashboard-offline-/blob/main/lib/topics.ts) (Topic catalog)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_screens["Study screens"]
  node_dashboard["Dashboard<br/>[page.tsx]"]
  node_syllabus["Syllabus tracker<br/>[page.tsx]"]
  node_roadmap["Study roadmap<br/>[page.tsx]"]
  node_library["Study library<br/>[page.tsx]"]
  node_notes["PDF notes viewer<br/>[NotesViewer.tsx]"]
  node_flashcards["Flashcards<br/>[CardBrowser.tsx]"]
  node_errorlog["Error log<br/>[ErrorLog.tsx]"]
  node_analytics["Mock analytics"]
  node_studytools["Study tools<br/>[page.tsx]"]
end

subgraph group_services["API routes"]
  node_syllabusapi["Syllabus progress API<br/>[route.ts]"]
  node_roadmapapi["Roadmap API<br/>[route.ts]"]
  node_errorsapi["Error log API<br/>[route.ts]"]
  node_mockapi["Mock tests API<br/>[route.ts]"]
  node_revisionapi["Revision API<br/>[route.ts]"]
  node_weakapi["Weak topics API<br/>[route.ts]"]
end

subgraph group_domain["Study domain"]
  node_catalog["Topic catalog<br/>[topics.ts]"]
  node_weaklogic["Weak-topic analysis<br/>[weakTopics.ts]"]
  node_mocklogic["Mock scoring<br/>[mockScoring.ts]"]
  node_reviewlogic["Review scheduling<br/>[errorReview.ts]"]
  node_shots["Screenshot storage<br/>[shots.ts]"]
end

subgraph group_storage["Local persistence"]
  node_sqlite[("SQLite database<br/>[db.ts]")]
  node_pdfstorage[("PDF files<br/>[paths.ts]")]
  node_notesdb[("Notes and cards data<br/>[notesDb.ts]")]
  node_backup["Backup and restore<br/>[backupClient.ts]"]
end

node_student(("Student"))

node_student -->|"uses"| node_dashboard
node_student -->|"tracks progress"| node_syllabus
node_student -->|"plans study"| node_roadmap
node_student -->|"browses materials"| node_library
node_student -->|"reads PDFs"| node_notes
node_student -->|"reviews cards"| node_flashcards
node_student -->|"logs mistakes"| node_errorlog
node_student -->|"reviews trends"| node_analytics
node_student -->|"uses tools"| node_studytools
node_syllabus -->|"reads and writes"| node_syllabusapi
node_syllabusapi -.->|"persists progress"| node_sqlite
node_roadmap -->|"reads and saves"| node_roadmapapi
node_errorsapi -->|"queries and updates"| node_sqlite
node_errorsapi -->|"converts images"| node_shots
node_errorsapi -->|"resolves topics"| node_catalog
node_errorsapi -->|"sets review dates"| node_reviewlogic
node_mockapi -->|"reads and writes"| node_sqlite
node_mockapi -->|"parses payload"| node_mocklogic
node_mockapi -->|"validates topics"| node_catalog
node_revisionapi -->|"queries revision data"| node_sqlite
node_revisionapi -->|"formats images"| node_shots
node_weakapi -.->|"loads topic records"| node_sqlite
node_weakapi -.->|"computes weak topics"| node_weaklogic
node_weakapi -->|"looks up topic"| node_catalog
node_weaklogic -->|"uses topic catalog"| node_catalog
node_weaklogic -->|"uses review status"| node_reviewlogic
node_weaklogic -->|"uses mock scores"| node_mocklogic
node_notes -->|"reads and writes annotations"| node_notesdb
node_flashcards -.->|"reads card data"| node_notesdb
node_student -->|"manages backups"| node_backup
node_backup -.->|"backs up database"| node_sqlite
node_student -->|"stores PDFs"| node_pdfstorage

click node_dashboard "https://github.com/priyanshujha4/gate-2027-dashboard-offline-/blob/main/app/page.tsx"
click node_syllabus "https://github.com/priyanshujha4/gate-2027-dashboard-offline-/blob/main/app/syllabus/page.tsx"
click node_roadmap "https://github.com/priyanshujha4/gate-2027-dashboard-offline-/blob/main/app/roadmap/page.tsx"
click node_library "https://github.com/priyanshujha4/gate-2027-dashboard-offline-/blob/main/app/library/page.tsx"
click node_notes "https://github.com/priyanshujha4/gate-2027-dashboard-offline-/blob/main/components/notes/NotesViewer.tsx"
click node_flashcards "https://github.com/priyanshujha4/gate-2027-dashboard-offline-/blob/main/components/flashcards/CardBrowser.tsx"
click node_errorlog "https://github.com/priyanshujha4/gate-2027-dashboard-offline-/blob/main/components/ErrorLog.tsx"
click node_analytics "https://github.com/priyanshujha4/gate-2027-dashboard-offline-/blob/main/components/ScoreTrendChart.tsx"
click node_studytools "https://github.com/priyanshujha4/gate-2027-dashboard-offline-/blob/main/app/today/page.tsx"
click node_syllabusapi "https://github.com/priyanshujha4/gate-2027-dashboard-offline-/blob/main/app/api/syllabus-progress/route.ts"
click node_roadmapapi "https://github.com/priyanshujha4/gate-2027-dashboard-offline-/blob/main/app/api/roadmap/route.ts"
click node_errorsapi "https://github.com/priyanshujha4/gate-2027-dashboard-offline-/blob/main/app/api/error-logs/route.ts"
click node_mockapi "https://github.com/priyanshujha4/gate-2027-dashboard-offline-/blob/main/app/api/mock-tests/route.ts"
click node_revisionapi "https://github.com/priyanshujha4/gate-2027-dashboard-offline-/blob/main/app/api/one-shot-revision/route.ts"
click node_weakapi "https://github.com/priyanshujha4/gate-2027-dashboard-offline-/blob/main/app/api/weak-topics/route.ts"
click node_catalog "https://github.com/priyanshujha4/gate-2027-dashboard-offline-/blob/main/lib/topics.ts"
click node_weaklogic "https://github.com/priyanshujha4/gate-2027-dashboard-offline-/blob/main/lib/weakTopics.ts"
click node_mocklogic "https://github.com/priyanshujha4/gate-2027-dashboard-offline-/blob/main/lib/mockScoring.ts"
click node_reviewlogic "https://github.com/priyanshujha4/gate-2027-dashboard-offline-/blob/main/lib/errorReview.ts"
click node_shots "https://github.com/priyanshujha4/gate-2027-dashboard-offline-/blob/main/lib/shots.ts"
click node_sqlite "https://github.com/priyanshujha4/gate-2027-dashboard-offline-/blob/main/lib/db.ts"
click node_pdfstorage "https://github.com/priyanshujha4/gate-2027-dashboard-offline-/blob/main/lib/paths.ts"
click node_notesdb "https://github.com/priyanshujha4/gate-2027-dashboard-offline-/blob/main/lib/notesDb.ts"
click node_backup "https://github.com/priyanshujha4/gate-2027-dashboard-offline-/blob/main/lib/backupClient.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_dashboard,node_syllabus,node_roadmap,node_library,node_notes,node_flashcards,node_errorlog,node_analytics,node_studytools toneBlue
class node_syllabusapi,node_roadmapapi,node_errorsapi,node_mockapi,node_revisionapi,node_weakapi toneAmber
class node_catalog,node_weaklogic,node_mocklogic,node_reviewlogic,node_shots toneMint
class node_sqlite,node_pdfstorage,node_notesdb,node_backup toneRose
class node_student toneIndigo
```

## Components

### Study screens

- [Dashboard](https://github.com/priyanshujha4/gate-2027-dashboard-offline-/blob/main/app/page.tsx): `app/page.tsx`
- [Syllabus tracker](https://github.com/priyanshujha4/gate-2027-dashboard-offline-/blob/main/app/syllabus/page.tsx): `app/syllabus/page.tsx`
- [Study roadmap](https://github.com/priyanshujha4/gate-2027-dashboard-offline-/blob/main/app/roadmap/page.tsx): `app/roadmap/page.tsx`
- [Study library](https://github.com/priyanshujha4/gate-2027-dashboard-offline-/blob/main/app/library/page.tsx): `app/library/page.tsx`
- [PDF notes viewer](https://github.com/priyanshujha4/gate-2027-dashboard-offline-/blob/main/components/notes/NotesViewer.tsx): `components/notes/NotesViewer.tsx`
- [Flashcards](https://github.com/priyanshujha4/gate-2027-dashboard-offline-/blob/main/components/flashcards/CardBrowser.tsx): `components/flashcards/CardBrowser.tsx`
- [Error log](https://github.com/priyanshujha4/gate-2027-dashboard-offline-/blob/main/components/ErrorLog.tsx): `components/ErrorLog.tsx`
- [Mock analytics](https://github.com/priyanshujha4/gate-2027-dashboard-offline-/blob/main/components/ScoreTrendChart.tsx): `components/ScoreTrendChart.tsx`
- [Study tools](https://github.com/priyanshujha4/gate-2027-dashboard-offline-/blob/main/app/today/page.tsx): `app/today/page.tsx`

### API routes

- [Syllabus progress API](https://github.com/priyanshujha4/gate-2027-dashboard-offline-/blob/main/app/api/syllabus-progress/route.ts): `app/api/syllabus-progress/route.ts`
- [Roadmap API](https://github.com/priyanshujha4/gate-2027-dashboard-offline-/blob/main/app/api/roadmap/route.ts): `app/api/roadmap/route.ts`
- [Error log API](https://github.com/priyanshujha4/gate-2027-dashboard-offline-/blob/main/app/api/error-logs/route.ts): `app/api/error-logs/route.ts`
- [Mock tests API](https://github.com/priyanshujha4/gate-2027-dashboard-offline-/blob/main/app/api/mock-tests/route.ts): `app/api/mock-tests/route.ts`
- [Revision API](https://github.com/priyanshujha4/gate-2027-dashboard-offline-/blob/main/app/api/one-shot-revision/route.ts): `app/api/one-shot-revision/route.ts`
- [Weak topics API](https://github.com/priyanshujha4/gate-2027-dashboard-offline-/blob/main/app/api/weak-topics/route.ts): `app/api/weak-topics/route.ts`

### Study domain

- [Topic catalog](https://github.com/priyanshujha4/gate-2027-dashboard-offline-/blob/main/lib/topics.ts): `lib/topics.ts`
- [Weak-topic analysis](https://github.com/priyanshujha4/gate-2027-dashboard-offline-/blob/main/lib/weakTopics.ts): `lib/weakTopics.ts`
- [Mock scoring](https://github.com/priyanshujha4/gate-2027-dashboard-offline-/blob/main/lib/mockScoring.ts): `lib/mockScoring.ts`
- [Review scheduling](https://github.com/priyanshujha4/gate-2027-dashboard-offline-/blob/main/lib/errorReview.ts): `lib/errorReview.ts`
- [Screenshot storage](https://github.com/priyanshujha4/gate-2027-dashboard-offline-/blob/main/lib/shots.ts): `lib/shots.ts`

### Local persistence

- [SQLite database](https://github.com/priyanshujha4/gate-2027-dashboard-offline-/blob/main/lib/db.ts): `lib/db.ts`
- [PDF files](https://github.com/priyanshujha4/gate-2027-dashboard-offline-/blob/main/lib/paths.ts): `lib/paths.ts`
- [Notes and cards data](https://github.com/priyanshujha4/gate-2027-dashboard-offline-/blob/main/lib/notesDb.ts): `lib/notesDb.ts`
- [Backup and restore](https://github.com/priyanshujha4/gate-2027-dashboard-offline-/blob/main/lib/backupClient.ts): `lib/backupClient.ts`

### Other components

- **Student**

## Connections

- Student → Dashboard: uses (evidence: `README.md`)
- Student → Syllabus tracker: tracks progress (evidence: `README.md`)
- Student → Study roadmap: plans study (evidence: `README.md`)
- Student → Study library: browses materials (evidence: `README.md`)
- Student → PDF notes viewer: reads PDFs (evidence: `README.md`)
- Student → Flashcards: reviews cards (evidence: `README.md`)
- Student → Error log: logs mistakes (evidence: `README.md`)
- Student → Mock analytics: reviews trends (evidence: `README.md`)
- Student → Study tools: uses tools (evidence: `README.md`)
- Syllabus tracker → Syllabus progress API: reads and writes (evidence: `app/syllabus/page.tsx`)
- Syllabus progress API → SQLite database: persists progress
- Study roadmap → Roadmap API: reads and saves (evidence: `app/roadmap/page.tsx`)
- Error log API → SQLite database: queries and updates (evidence: `app/api/error-logs/route.ts`)
- Error log API → Screenshot storage: converts images (evidence: `app/api/error-logs/route.ts`)
- Error log API → Topic catalog: resolves topics (evidence: `app/api/error-logs/route.ts`)
- Error log API → Review scheduling: sets review dates (evidence: `app/api/error-logs/route.ts`)
- Mock tests API → SQLite database: reads and writes (evidence: `app/api/mock-tests/route.ts`)
- Mock tests API → Mock scoring: parses payload (evidence: `app/api/mock-tests/route.ts`)
- Mock tests API → Topic catalog: validates topics (evidence: `app/api/mock-tests/route.ts`)
- Revision API → SQLite database: queries revision data (evidence: `app/api/one-shot-revision/route.ts`)
- Revision API → Screenshot storage: formats images (evidence: `app/api/one-shot-revision/route.ts`)
- Weak topics API → SQLite database: loads topic records (evidence: `app/api/weak-topics/route.ts`)
- Weak topics API → Weak-topic analysis: computes weak topics (evidence: `app/api/weak-topics/route.ts`)
- Weak topics API → Topic catalog: looks up topic (evidence: `app/api/weak-topics/route.ts`)
- Weak-topic analysis → Topic catalog: uses topic catalog (evidence: `lib/weakTopics.ts`)
- Weak-topic analysis → Review scheduling: uses review status (evidence: `lib/weakTopics.ts`)
- Weak-topic analysis → Mock scoring: uses mock scores (evidence: `lib/weakTopics.ts`)
- PDF notes viewer → Notes and cards data: reads and writes annotations (evidence: `components/notes/NotesViewer.tsx`)
- Flashcards → Notes and cards data: reads card data
- Student → Backup and restore: manages backups (evidence: `README.md`)
- Backup and restore → SQLite database: backs up database
- Student → PDF files: stores PDFs (evidence: `README.md`)
