# sethupathy03/grade-report-generator architecture

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

- Interactive diagram: https://gitdiagram.com/sethupathy03/grade-report-generator
- Repository: https://github.com/sethupathy03/grade-report-generator

## Overview

Grade Report Generator is a student-facing React app for building a semester report from course, credit, and grade entries. Its main flow collects subjects, calculates SGPA and totals, presents the result, then downloads a PDF or saves the report for later retrieval. The app also provides grade-scale reference, account sign-in, and report-history features backed by Firebase with local fallback behavior. Some implementation details are unsampled; edges below rely on shown calls, indexed references, or README statements.

Main entry points: [`src/App.jsx`](https://github.com/sethupathy03/grade-report-generator/blob/main/src/App.jsx) (Report workspace), [`src/firebase/historyService.js`](https://github.com/sethupathy03/grade-report-generator/blob/main/src/firebase/historyService.js) (History service), [`src/context/AuthContext.jsx`](https://github.com/sethupathy03/grade-report-generator/blob/main/src/context/AuthContext.jsx) (Auth state), [`src/components/Subject.jsx`](https://github.com/sethupathy03/grade-report-generator/blob/main/src/components/Subject.jsx) (Subject entry)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_reporting["Report workflow"]
  node_app["Report workspace<br/>[App.jsx]"]
  node_subject_entry["Subject entry<br/>[Subject.jsx]"]
  node_subject_list["Subject details<br/>[SubjectDetails.jsx]"]
  node_sgpa["SGPA and totals<br/>[App.jsx]"]
  node_results["Result summary<br/>[ResultCard.jsx]"]
  node_grade_scale["Grade reference<br/>[GradeScale.jsx]"]
  node_report_actions["Report actions<br/>[Header.jsx]"]
  node_pdf_library["PDF generator"]
  node_navbar["Navigation<br/>[Navbar.jsx]"]
  node_toast["Notifications<br/>[Toast.jsx]"]
end

subgraph group_identity["Accounts"]
  node_auth_modal["Sign-in dialog<br/>[AuthModal.jsx]"]
  node_auth_context["Auth state<br/>[AuthContext.jsx]"]
end

subgraph group_history["Report history"]
  node_history_modal["History browser<br/>[HistoryModal.jsx]"]
  node_history_service["History service<br/>[historyService.js]"]
end

subgraph group_platform["Persistence and services"]
  node_firebase_auth["Firebase Auth"]
  node_firebase_config["Firebase setup<br/>[config.js]"]
  node_firestore[("Cloud Firestore")]
  node_local_storage[("Browser storage")]
end

node_student(("Student"))

node_student -->|"edits report"| node_app
node_app -->|"renders"| node_subject_entry
node_subject_entry -->|"adds subjects"| node_app
node_app -->|"renders"| node_subject_list
node_app -->|"calculates"| node_sgpa
node_app -->|"renders"| node_results
node_app -->|"renders"| node_grade_scale
node_app -->|"renders"| node_report_actions
node_report_actions -->|"generates PDF"| node_pdf_library
node_app -->|"renders"| node_navbar
node_app -->|"renders"| node_toast
node_app -->|"renders"| node_auth_modal
node_auth_modal -->|"invokes sign-in"| node_auth_context
node_auth_context -->|"uses credentials"| node_firebase_config
node_auth_context -->|"authenticates"| node_firebase_auth
node_app -->|"renders"| node_history_modal
node_app -->|"saves and subscribes"| node_history_service
node_history_modal -->|"loads and deletes"| node_history_service
node_history_service -->|"uses database setup"| node_firebase_config
node_history_service -->|"reads and writes"| node_firestore
node_history_service -->|"stores fallback"| node_local_storage

click node_app "https://github.com/sethupathy03/grade-report-generator/blob/main/src/App.jsx"
click node_subject_entry "https://github.com/sethupathy03/grade-report-generator/blob/main/src/components/Subject.jsx"
click node_subject_list "https://github.com/sethupathy03/grade-report-generator/blob/main/src/components/SubjectDetails.jsx"
click node_sgpa "https://github.com/sethupathy03/grade-report-generator/blob/main/src/App.jsx"
click node_results "https://github.com/sethupathy03/grade-report-generator/blob/main/src/components/ResultCard.jsx"
click node_grade_scale "https://github.com/sethupathy03/grade-report-generator/blob/main/src/components/GradeScale.jsx"
click node_report_actions "https://github.com/sethupathy03/grade-report-generator/blob/main/src/components/Header.jsx"
click node_navbar "https://github.com/sethupathy03/grade-report-generator/blob/main/src/components/Navbar.jsx"
click node_toast "https://github.com/sethupathy03/grade-report-generator/blob/main/src/components/Toast.jsx"
click node_auth_modal "https://github.com/sethupathy03/grade-report-generator/blob/main/src/components/AuthModal.jsx"
click node_auth_context "https://github.com/sethupathy03/grade-report-generator/blob/main/src/context/AuthContext.jsx"
click node_firebase_config "https://github.com/sethupathy03/grade-report-generator/blob/main/src/firebase/config.js"
click node_history_modal "https://github.com/sethupathy03/grade-report-generator/blob/main/src/components/HistoryModal.jsx"
click node_history_service "https://github.com/sethupathy03/grade-report-generator/blob/main/src/firebase/historyService.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_app,node_subject_entry,node_subject_list,node_sgpa,node_results,node_grade_scale,node_report_actions,node_pdf_library,node_navbar,node_toast toneBlue
class node_auth_modal,node_auth_context toneAmber
class node_history_modal,node_history_service toneMint
class node_firebase_auth,node_firebase_config,node_firestore,node_local_storage toneRose
class node_student toneIndigo
```

## Components

### Report workflow

- [Report workspace](https://github.com/sethupathy03/grade-report-generator/blob/main/src/App.jsx): `src/App.jsx`
- [Subject entry](https://github.com/sethupathy03/grade-report-generator/blob/main/src/components/Subject.jsx): `src/components/Subject.jsx`
- [Subject details](https://github.com/sethupathy03/grade-report-generator/blob/main/src/components/SubjectDetails.jsx): `src/components/SubjectDetails.jsx`
- [SGPA and totals](https://github.com/sethupathy03/grade-report-generator/blob/main/src/App.jsx): `src/App.jsx`
- [Result summary](https://github.com/sethupathy03/grade-report-generator/blob/main/src/components/ResultCard.jsx): `src/components/ResultCard.jsx`
- [Grade reference](https://github.com/sethupathy03/grade-report-generator/blob/main/src/components/GradeScale.jsx): `src/components/GradeScale.jsx`
- [Report actions](https://github.com/sethupathy03/grade-report-generator/blob/main/src/components/Header.jsx): `src/components/Header.jsx`
- **PDF generator**
- [Navigation](https://github.com/sethupathy03/grade-report-generator/blob/main/src/components/Navbar.jsx): `src/components/Navbar.jsx`
- [Notifications](https://github.com/sethupathy03/grade-report-generator/blob/main/src/components/Toast.jsx): `src/components/Toast.jsx`

### Accounts

- [Sign-in dialog](https://github.com/sethupathy03/grade-report-generator/blob/main/src/components/AuthModal.jsx): `src/components/AuthModal.jsx`
- [Auth state](https://github.com/sethupathy03/grade-report-generator/blob/main/src/context/AuthContext.jsx): `src/context/AuthContext.jsx`

### Report history

- [History browser](https://github.com/sethupathy03/grade-report-generator/blob/main/src/components/HistoryModal.jsx): `src/components/HistoryModal.jsx`
- [History service](https://github.com/sethupathy03/grade-report-generator/blob/main/src/firebase/historyService.js): `src/firebase/historyService.js`

### Persistence and services

- **Firebase Auth**
- [Firebase setup](https://github.com/sethupathy03/grade-report-generator/blob/main/src/firebase/config.js): `src/firebase/config.js`
- **Cloud Firestore**
- **Browser storage**

### Other components

- **Student**

## Connections

- Student → Report workspace: edits report (evidence: `README.md`)
- Report workspace → Subject entry: renders (evidence: `src/App.jsx`)
- Subject entry → Report workspace: adds subjects (evidence: `src/App.jsx`)
- Report workspace → Subject details: renders (evidence: `src/App.jsx`)
- Report workspace → SGPA and totals: calculates (evidence: `README.md`)
- Report workspace → Result summary: renders (evidence: `src/App.jsx`)
- Report workspace → Grade reference: renders (evidence: `src/App.jsx`)
- Report workspace → Report actions: renders (evidence: `src/App.jsx`)
- Report actions → PDF generator: generates PDF (evidence: `src/components/Header.jsx`)
- Report workspace → Navigation: renders (evidence: `src/App.jsx`)
- Report workspace → Notifications: renders (evidence: `src/App.jsx`)
- Report workspace → Sign-in dialog: renders (evidence: `src/App.jsx`)
- Sign-in dialog → Auth state: invokes sign-in (evidence: `src/components/AuthModal.jsx`)
- Auth state → Firebase setup: uses credentials (evidence: `src/context/AuthContext.jsx`)
- Auth state → Firebase Auth: authenticates (evidence: `src/context/AuthContext.jsx`)
- Report workspace → History browser: renders (evidence: `src/App.jsx`)
- Report workspace → History service: saves and subscribes (evidence: `src/App.jsx`)
- History browser → History service: loads and deletes (evidence: `src/components/HistoryModal.jsx`)
- History service → Firebase setup: uses database setup (evidence: `src/firebase/historyService.js`)
- History service → Cloud Firestore: reads and writes (evidence: `src/firebase/historyService.js`)
- History service → Browser storage: stores fallback (evidence: `src/firebase/historyService.js`)
