# sivagnanamani-1/ktc architecture

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

- Interactive diagram: https://gitdiagram.com/sivagnanamani-1/ktc
- Repository: https://github.com/sivagnanamani-1/ktc

## Overview

This is an admin-facing tuition-management application. The main workflow is an administrator logging in, selecting a class and student, recording attendance or marks, and reviewing attendance, progress, and fee status; staff and financial management are parallel workflows. React routes expose these screens, while shared context holds operational data and persists it to Firestore. The repository also includes a Netlify progress-sharing function that retrieves student records and sends a document through WhatsApp. Some modules were not sampled, so their links are limited to route and import references in the source index.

Main entry points: [`src/context/DataContext.jsx`](https://github.com/sivagnanamani-1/ktc/blob/master/src/context/DataContext.jsx) (Shared Data Context), [`src/App.jsx`](https://github.com/sivagnanamani-1/ktc/blob/master/src/App.jsx) (Routed Application), [`src/components/Auth/Login.jsx`](https://github.com/sivagnanamani-1/ktc/blob/master/src/components/Auth/Login.jsx) (Admin Login), [`src/context/AuthContext.jsx`](https://github.com/sivagnanamani-1/ktc/blob/master/src/context/AuthContext.jsx) (Auth Context)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Application and Access"]
  node_app["Routed Application<br/>[App.jsx]"]
  node_login["Admin Login<br/>[Login.jsx]"]
  node_auth["Auth Context<br/>[AuthContext.jsx]"]
  node_dashboard["Overview Dashboard<br/>[Dashboard.jsx]"]
  node_data["Shared Data Context<br/>[DataContext.jsx]"]
  node_firebase["Firebase Services<br/>[firebase.js]"]
end

subgraph group_students["Classes and Students"]
  node_classes["Class List<br/>[ClassList.jsx]"]
  node_students_active["Student List<br/>[StudentList.jsx]"]
  node_students_past["Past Students"]
end

subgraph group_attendance["Attendance and Progress"]
  node_attendance_mark["Mark Attendance"]
  node_calendar["Attendance Calendar<br/>[CalendarView.jsx]"]
  node_attendance_history["Session History"]
  node_student_history["Student Progress<br/>[StudentHistory.jsx]"]
end

subgraph group_finance["Fees and Finance"]
  node_fees["Fee Management<br/>[Fees.jsx]"]
  node_class_fees["Class Fees<br/>[ClassFees.jsx]"]
  node_income["Income Dashboard<br/>[Dashboard.jsx]"]
  node_fee_status["Fee Status<br/>[FeeStatus.jsx]"]
  node_backlogs["Fee Backlogs"]
end

subgraph group_staff["Staff and Academics"]
  node_staff_list["Staff Management<br/>[StaffList.jsx]"]
  node_staff_history["Staff History<br/>[StaffHistory.jsx]"]
  node_staff_salary["Staff Salaries<br/>[StaffSalary.jsx]"]
  node_subject_marks["Subject Marks<br/>[SubjectMarks.jsx]"]
end

subgraph group_sharing["Progress Sharing"]
  node_share_function["Progress Share Handler<br/>[share-progress.js]"]
end

node_admin(("Administrator"))
node_firestore[("Firestore")]
node_whatsapp["WhatsApp API"]

node_admin -->|"signs in"| node_login
node_app -->|"routes to"| node_login
node_app -->|"routes to"| node_dashboard
node_app -->|"routes to"| node_classes
node_app -->|"routes to"| node_students_active
node_app -->|"routes to"| node_attendance_mark
node_app -->|"routes to"| node_calendar
node_app -->|"routes to"| node_attendance_history
node_app -->|"routes to"| node_student_history
node_app -->|"routes to"| node_students_past
node_app -->|"routes to"| node_staff_list
node_app -->|"routes to"| node_fees
node_app -->|"routes to"| node_class_fees
node_app -->|"routes to"| node_staff_salary
node_app -->|"routes to"| node_fee_status
node_app -->|"routes to"| node_backlogs
node_app -->|"provides auth"| node_auth
node_app -->|"provides data"| node_data
node_login -->|"uses auth"| node_auth
node_dashboard -->|"reads data"| node_data
node_classes -->|"uses data"| node_data
node_students_active -->|"uses data"| node_data
node_students_past -->|"uses data"| node_data
node_attendance_mark -->|"uses data"| node_data
node_calendar -->|"uses data"| node_data
node_attendance_history -->|"uses data"| node_data
node_student_history -->|"uses data"| node_data
node_fees -->|"uses data"| node_data
node_class_fees -->|"uses data"| node_data
node_income -->|"uses data"| node_data
node_fee_status -->|"uses data"| node_data
node_backlogs -->|"uses data"| node_data
node_staff_list -->|"uses data"| node_data
node_staff_history -->|"uses data"| node_data
node_staff_salary -->|"uses data"| node_data
node_subject_marks -->|"uses data"| node_data
node_data -->|"uses services"| node_firebase
node_auth -->|"uses auth"| node_firebase
node_data -->|"reads and writes"| node_firestore
node_share_function -->|"fetches students"| node_firestore
node_share_function -->|"uploads and sends"| node_whatsapp

click node_app "https://github.com/sivagnanamani-1/ktc/blob/master/src/App.jsx"
click node_login "https://github.com/sivagnanamani-1/ktc/blob/master/src/components/Auth/Login.jsx"
click node_auth "https://github.com/sivagnanamani-1/ktc/blob/master/src/context/AuthContext.jsx"
click node_dashboard "https://github.com/sivagnanamani-1/ktc/blob/master/src/components/Dashboard/Dashboard.jsx"
click node_data "https://github.com/sivagnanamani-1/ktc/blob/master/src/context/DataContext.jsx"
click node_firebase "https://github.com/sivagnanamani-1/ktc/blob/master/src/firebase.js"
click node_classes "https://github.com/sivagnanamani-1/ktc/blob/master/src/components/Classes/ClassList.jsx"
click node_students_active "https://github.com/sivagnanamani-1/ktc/blob/master/src/components/Students/StudentList.jsx"
click node_students_past "https://github.com/sivagnanamani-1/ktc/blob/master/src/components/Students/PastStudentList.jsx"
click node_attendance_mark "https://github.com/sivagnanamani-1/ktc/blob/master/src/components/Attendance/AttendanceMarking.jsx"
click node_calendar "https://github.com/sivagnanamani-1/ktc/blob/master/src/components/History/CalendarView.jsx"
click node_attendance_history "https://github.com/sivagnanamani-1/ktc/blob/master/src/components/History/AttendanceHistory.jsx"
click node_student_history "https://github.com/sivagnanamani-1/ktc/blob/master/src/components/History/StudentHistory.jsx"
click node_fees "https://github.com/sivagnanamani-1/ktc/blob/master/src/components/Fees/Fees.jsx"
click node_class_fees "https://github.com/sivagnanamani-1/ktc/blob/master/src/components/Fees/ClassFees.jsx"
click node_income "https://github.com/sivagnanamani-1/ktc/blob/master/src/components/Income/Dashboard.jsx"
click node_fee_status "https://github.com/sivagnanamani-1/ktc/blob/master/src/components/Income/FeeStatus.jsx"
click node_backlogs "https://github.com/sivagnanamani-1/ktc/blob/master/src/components/Income/PreviousBacklogs.jsx"
click node_staff_list "https://github.com/sivagnanamani-1/ktc/blob/master/src/components/Staff/StaffList.jsx"
click node_staff_history "https://github.com/sivagnanamani-1/ktc/blob/master/src/components/Staff/StaffHistory.jsx"
click node_staff_salary "https://github.com/sivagnanamani-1/ktc/blob/master/src/components/Income/StaffSalary.jsx"
click node_subject_marks "https://github.com/sivagnanamani-1/ktc/blob/master/src/components/Subjects/SubjectMarks.jsx"
click node_share_function "https://github.com/sivagnanamani-1/ktc/blob/master/netlify/functions/share-progress.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_login,node_auth,node_dashboard,node_data,node_firebase toneBlue
class node_classes,node_students_active,node_students_past,node_firestore toneAmber
class node_attendance_mark,node_calendar,node_attendance_history,node_student_history,node_whatsapp toneMint
class node_fees,node_class_fees,node_income,node_fee_status,node_backlogs toneRose
class node_staff_list,node_staff_history,node_staff_salary,node_subject_marks,node_admin toneIndigo
class node_share_function toneTeal
```

## Components

### Application and Access

- [Routed Application](https://github.com/sivagnanamani-1/ktc/blob/master/src/App.jsx): `src/App.jsx`
- [Admin Login](https://github.com/sivagnanamani-1/ktc/blob/master/src/components/Auth/Login.jsx): `src/components/Auth/Login.jsx`
- [Auth Context](https://github.com/sivagnanamani-1/ktc/blob/master/src/context/AuthContext.jsx): `src/context/AuthContext.jsx`
- [Overview Dashboard](https://github.com/sivagnanamani-1/ktc/blob/master/src/components/Dashboard/Dashboard.jsx): `src/components/Dashboard/Dashboard.jsx`
- [Shared Data Context](https://github.com/sivagnanamani-1/ktc/blob/master/src/context/DataContext.jsx): `src/context/DataContext.jsx`
- [Firebase Services](https://github.com/sivagnanamani-1/ktc/blob/master/src/firebase.js): `src/firebase.js`

### Classes and Students

- [Class List](https://github.com/sivagnanamani-1/ktc/blob/master/src/components/Classes/ClassList.jsx): `src/components/Classes/ClassList.jsx`
- [Student List](https://github.com/sivagnanamani-1/ktc/blob/master/src/components/Students/StudentList.jsx): `src/components/Students/StudentList.jsx`
- [Past Students](https://github.com/sivagnanamani-1/ktc/blob/master/src/components/Students/PastStudentList.jsx): `src/components/Students/PastStudentList.jsx`

### Attendance and Progress

- [Mark Attendance](https://github.com/sivagnanamani-1/ktc/blob/master/src/components/Attendance/AttendanceMarking.jsx): `src/components/Attendance/AttendanceMarking.jsx`
- [Attendance Calendar](https://github.com/sivagnanamani-1/ktc/blob/master/src/components/History/CalendarView.jsx): `src/components/History/CalendarView.jsx`
- [Session History](https://github.com/sivagnanamani-1/ktc/blob/master/src/components/History/AttendanceHistory.jsx): `src/components/History/AttendanceHistory.jsx`
- [Student Progress](https://github.com/sivagnanamani-1/ktc/blob/master/src/components/History/StudentHistory.jsx): `src/components/History/StudentHistory.jsx`

### Fees and Finance

- [Fee Management](https://github.com/sivagnanamani-1/ktc/blob/master/src/components/Fees/Fees.jsx): `src/components/Fees/Fees.jsx`
- [Class Fees](https://github.com/sivagnanamani-1/ktc/blob/master/src/components/Fees/ClassFees.jsx): `src/components/Fees/ClassFees.jsx`
- [Income Dashboard](https://github.com/sivagnanamani-1/ktc/blob/master/src/components/Income/Dashboard.jsx): `src/components/Income/Dashboard.jsx`
- [Fee Status](https://github.com/sivagnanamani-1/ktc/blob/master/src/components/Income/FeeStatus.jsx): `src/components/Income/FeeStatus.jsx`
- [Fee Backlogs](https://github.com/sivagnanamani-1/ktc/blob/master/src/components/Income/PreviousBacklogs.jsx): `src/components/Income/PreviousBacklogs.jsx`

### Staff and Academics

- [Staff Management](https://github.com/sivagnanamani-1/ktc/blob/master/src/components/Staff/StaffList.jsx): `src/components/Staff/StaffList.jsx`
- [Staff History](https://github.com/sivagnanamani-1/ktc/blob/master/src/components/Staff/StaffHistory.jsx): `src/components/Staff/StaffHistory.jsx`
- [Staff Salaries](https://github.com/sivagnanamani-1/ktc/blob/master/src/components/Income/StaffSalary.jsx): `src/components/Income/StaffSalary.jsx`
- [Subject Marks](https://github.com/sivagnanamani-1/ktc/blob/master/src/components/Subjects/SubjectMarks.jsx): `src/components/Subjects/SubjectMarks.jsx`

### Progress Sharing

- [Progress Share Handler](https://github.com/sivagnanamani-1/ktc/blob/master/netlify/functions/share-progress.js): `netlify/functions/share-progress.js`

### Other components

- **Administrator**
- **Firestore**
- **WhatsApp API**

## Connections

- Administrator → Admin Login: signs in
- Routed Application → Admin Login: routes to (evidence: `src/App.jsx`)
- Routed Application → Overview Dashboard: routes to (evidence: `src/App.jsx`)
- Routed Application → Class List: routes to (evidence: `src/App.jsx`)
- Routed Application → Student List: routes to (evidence: `src/App.jsx`)
- Routed Application → Mark Attendance: routes to (evidence: `src/App.jsx`)
- Routed Application → Attendance Calendar: routes to (evidence: `src/App.jsx`)
- Routed Application → Session History: routes to (evidence: `src/App.jsx`)
- Routed Application → Student Progress: routes to (evidence: `src/App.jsx`)
- Routed Application → Past Students: routes to (evidence: `src/App.jsx`)
- Routed Application → Staff Management: routes to (evidence: `src/App.jsx`)
- Routed Application → Fee Management: routes to (evidence: `src/App.jsx`)
- Routed Application → Class Fees: routes to (evidence: `src/App.jsx`)
- Routed Application → Staff Salaries: routes to (evidence: `src/App.jsx`)
- Routed Application → Fee Status: routes to (evidence: `src/App.jsx`)
- Routed Application → Fee Backlogs: routes to (evidence: `src/App.jsx`)
- Routed Application → Auth Context: provides auth (evidence: `src/App.jsx`)
- Routed Application → Shared Data Context: provides data (evidence: `src/App.jsx`)
- Admin Login → Auth Context: uses auth (evidence: `src/components/Auth/Login.jsx`)
- Overview Dashboard → Shared Data Context: reads data (evidence: `src/components/Dashboard/Dashboard.jsx`)
- Class List → Shared Data Context: uses data (evidence: `src/components/Classes/ClassList.jsx`)
- Student List → Shared Data Context: uses data (evidence: `src/components/Students/StudentList.jsx`)
- Past Students → Shared Data Context: uses data (evidence: `src/components/Students/PastStudentList.jsx`)
- Mark Attendance → Shared Data Context: uses data (evidence: `src/components/Attendance/AttendanceMarking.jsx`)
- Attendance Calendar → Shared Data Context: uses data (evidence: `src/components/History/CalendarView.jsx`)
- Session History → Shared Data Context: uses data (evidence: `src/components/History/AttendanceHistory.jsx`)
- Student Progress → Shared Data Context: uses data (evidence: `src/components/History/StudentHistory.jsx`)
- Fee Management → Shared Data Context: uses data (evidence: `src/components/Fees/Fees.jsx`)
- Class Fees → Shared Data Context: uses data (evidence: `src/components/Fees/ClassFees.jsx`)
- Income Dashboard → Shared Data Context: uses data (evidence: `src/components/Income/Dashboard.jsx`)
- Fee Status → Shared Data Context: uses data (evidence: `src/components/Income/FeeStatus.jsx`)
- Fee Backlogs → Shared Data Context: uses data (evidence: `src/components/Income/PreviousBacklogs.jsx`)
- Staff Management → Shared Data Context: uses data (evidence: `src/components/Staff/StaffList.jsx`)
- Staff History → Shared Data Context: uses data (evidence: `src/components/Staff/StaffHistory.jsx`)
- Staff Salaries → Shared Data Context: uses data (evidence: `src/components/Income/StaffSalary.jsx`)
- Subject Marks → Shared Data Context: uses data (evidence: `src/components/Subjects/SubjectMarks.jsx`)
- Shared Data Context → Firebase Services: uses services (evidence: `src/context/DataContext.jsx`)
- Auth Context → Firebase Services: uses auth (evidence: `src/context/AuthContext.jsx`)
- Shared Data Context → Firestore: reads and writes (evidence: `src/context/DataContext.jsx`)
- Progress Share Handler → Firestore: fetches students (evidence: `netlify/functions/share-progress.js`)
- Progress Share Handler → WhatsApp API: uploads and sends (evidence: `netlify/functions/share-progress.js`)
