# amin-nepali/campus-management-system architecture

> Architecture diagram of the GitHub repository amin-nepali/campus-management-system, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-29). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/amin-nepali/campus-management-system
- Repository: https://github.com/amin-nepali/campus-management-system

## Overview

Campus Management System is a role-based web application for campus operations. The implemented workflows cover sign-in and profile loading, role-gated navigation, administrator academic setup, teacher attendance and audit logging, and notes, assignments, submissions, and attachments. The README also describes broader planned operations—such as fees, routines, notices, and parent notifications—that are not visibly implemented in the sampled routes, so they are represented only as documented capabilities. Relationships reflect the shown wiring; other subsystems and integrations are not inferred.

Main entry points: [`src/features/learning-materials/repository.ts`](https://github.com/amin-nepali/campus-management-system/blob/main/src/features/learning-materials/repository.ts) (Learning records), [`src/app/App.tsx`](https://github.com/amin-nepali/campus-management-system/blob/main/src/app/App.tsx) (Application routes), [`src/lib/firebase.ts`](https://github.com/amin-nepali/campus-management-system/blob/main/src/lib/firebase.ts) (Firebase configuration), [`src/features/academic/repository.ts`](https://github.com/amin-nepali/campus-management-system/blob/main/src/features/academic/repository.ts) (Academic records)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_access["Access and navigation"]
  node_entry["Application routes<br/>[App.tsx]"]
  node_shell["Role workspace<br/>[AppShell.tsx]"]
  node_rolepaths["Role navigation<br/>[navigation.ts]"]
  node_auth["Identity and profiles<br/>[AuthProvider.tsx]"]
  node_login["Sign-in<br/>[LoginPage.tsx]"]
end

subgraph group_academic["Academic setup"]
  node_academicpage["Academic setup UI"]
  node_academicrepo["Academic records<br/>[repository.ts]"]
  node_academicschema["Academic validation<br/>[schema.ts]"]
end

subgraph group_attendance["Attendance"]
  node_attendancepage["Attendance register<br/>[AttendancePage.tsx]"]
  node_attendancerepo["Attendance records<br/>[repository.ts]"]
  node_attendanceschema["Attendance validation<br/>[schema.ts]"]
end

subgraph group_learning["Learning materials"]
  node_learningpage["Notes and assignments"]
  node_learningrepo["Learning records<br/>[repository.ts]"]
  node_learningschema["Learning validation<br/>[schema.ts]"]
end

subgraph group_platform["Firebase services"]
  node_firebase["Firebase configuration<br/>[firebase.ts]"]
  node_firestore[("Cloud Firestore")]
  node_storage[("Firebase Storage")]
end

node_community(("Campus users"))
node_broader["Documented broader operations<br/>[README.md]"]

node_community -->|"signs in"| node_login
node_login -->|"requests sign-in"| node_auth
node_entry -->|"routes to"| node_login
node_entry -->|"renders protected"| node_shell
node_entry -->|"routes to"| node_academicpage
node_entry -->|"routes to"| node_attendancepage
node_entry -->|"routes to"| node_learningpage
node_shell -->|"reads profile"| node_auth
node_shell -->|"gets links"| node_rolepaths
node_auth -->|"uses services"| node_firebase
node_auth -->|"loads profile"| node_firestore
node_academicpage -->|"uses records"| node_academicrepo
node_academicrepo -->|"validates data"| node_academicschema
node_academicrepo -->|"uses database"| node_firebase
node_academicrepo -->|"reads and writes"| node_firestore
node_attendancepage -->|"loads and saves"| node_attendancerepo
node_attendancepage -->|"loads teacher access"| node_learningrepo
node_attendancerepo -->|"validates records"| node_attendanceschema
node_attendancerepo -->|"reads and writes"| node_firestore
node_learningpage -->|"uses materials"| node_learningrepo
node_learningrepo -->|"validates content"| node_learningschema
node_learningrepo -->|"uses services"| node_firebase
node_learningrepo -->|"reads and writes"| node_firestore
node_learningrepo -->|"uploads files"| node_storage
node_firebase -->|"initializes"| node_firestore
node_firebase -->|"initializes"| node_storage
node_community -.->|"has planned needs"| node_broader

click node_entry "https://github.com/amin-nepali/campus-management-system/blob/main/src/app/App.tsx"
click node_shell "https://github.com/amin-nepali/campus-management-system/blob/main/src/components/layout/AppShell.tsx"
click node_rolepaths "https://github.com/amin-nepali/campus-management-system/blob/main/src/app/navigation.ts"
click node_auth "https://github.com/amin-nepali/campus-management-system/blob/main/src/features/auth/AuthProvider.tsx"
click node_login "https://github.com/amin-nepali/campus-management-system/blob/main/src/features/auth/LoginPage.tsx"
click node_academicpage "https://github.com/amin-nepali/campus-management-system/blob/main/src/features/academic/AcademicSetupPage.tsx"
click node_academicrepo "https://github.com/amin-nepali/campus-management-system/blob/main/src/features/academic/repository.ts"
click node_academicschema "https://github.com/amin-nepali/campus-management-system/blob/main/src/features/academic/schema.ts"
click node_attendancepage "https://github.com/amin-nepali/campus-management-system/blob/main/src/features/attendance/AttendancePage.tsx"
click node_attendancerepo "https://github.com/amin-nepali/campus-management-system/blob/main/src/features/attendance/repository.ts"
click node_attendanceschema "https://github.com/amin-nepali/campus-management-system/blob/main/src/features/attendance/schema.ts"
click node_learningpage "https://github.com/amin-nepali/campus-management-system/blob/main/src/features/learning-materials/LearningMaterialsPage.tsx"
click node_learningrepo "https://github.com/amin-nepali/campus-management-system/blob/main/src/features/learning-materials/repository.ts"
click node_learningschema "https://github.com/amin-nepali/campus-management-system/blob/main/src/features/learning-materials/schema.ts"
click node_firebase "https://github.com/amin-nepali/campus-management-system/blob/main/src/lib/firebase.ts"
click node_broader "https://github.com/amin-nepali/campus-management-system/blob/main/README.md"

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_entry,node_shell,node_rolepaths,node_auth,node_login,node_community toneBlue
class node_academicpage,node_academicrepo,node_academicschema toneAmber
class node_attendancepage,node_attendancerepo,node_attendanceschema toneMint
class node_learningpage,node_learningrepo,node_learningschema toneRose
class node_firebase,node_firestore,node_storage toneIndigo
class node_broader toneTeal
```

## Components

### Access and navigation

- [Application routes](https://github.com/amin-nepali/campus-management-system/blob/main/src/app/App.tsx): `src/app/App.tsx`
- [Role workspace](https://github.com/amin-nepali/campus-management-system/blob/main/src/components/layout/AppShell.tsx): `src/components/layout/AppShell.tsx`
- [Role navigation](https://github.com/amin-nepali/campus-management-system/blob/main/src/app/navigation.ts): `src/app/navigation.ts`
- [Identity and profiles](https://github.com/amin-nepali/campus-management-system/blob/main/src/features/auth/AuthProvider.tsx): `src/features/auth/AuthProvider.tsx`
- [Sign-in](https://github.com/amin-nepali/campus-management-system/blob/main/src/features/auth/LoginPage.tsx): `src/features/auth/LoginPage.tsx`

### Academic setup

- [Academic setup UI](https://github.com/amin-nepali/campus-management-system/blob/main/src/features/academic/AcademicSetupPage.tsx): `src/features/academic/AcademicSetupPage.tsx`
- [Academic records](https://github.com/amin-nepali/campus-management-system/blob/main/src/features/academic/repository.ts): `src/features/academic/repository.ts`
- [Academic validation](https://github.com/amin-nepali/campus-management-system/blob/main/src/features/academic/schema.ts): `src/features/academic/schema.ts`

### Attendance

- [Attendance register](https://github.com/amin-nepali/campus-management-system/blob/main/src/features/attendance/AttendancePage.tsx): `src/features/attendance/AttendancePage.tsx`
- [Attendance records](https://github.com/amin-nepali/campus-management-system/blob/main/src/features/attendance/repository.ts): `src/features/attendance/repository.ts`
- [Attendance validation](https://github.com/amin-nepali/campus-management-system/blob/main/src/features/attendance/schema.ts): `src/features/attendance/schema.ts`

### Learning materials

- [Notes and assignments](https://github.com/amin-nepali/campus-management-system/blob/main/src/features/learning-materials/LearningMaterialsPage.tsx): `src/features/learning-materials/LearningMaterialsPage.tsx`
- [Learning records](https://github.com/amin-nepali/campus-management-system/blob/main/src/features/learning-materials/repository.ts): `src/features/learning-materials/repository.ts`
- [Learning validation](https://github.com/amin-nepali/campus-management-system/blob/main/src/features/learning-materials/schema.ts): `src/features/learning-materials/schema.ts`

### Firebase services

- [Firebase configuration](https://github.com/amin-nepali/campus-management-system/blob/main/src/lib/firebase.ts): `src/lib/firebase.ts`
- **Cloud Firestore**
- **Firebase Storage**

### Other components

- **Campus users**
- [Documented broader operations](https://github.com/amin-nepali/campus-management-system/blob/main/README.md): `README.md`

## Connections

- Campus users → Sign-in: signs in
- Sign-in → Identity and profiles: requests sign-in (evidence: `src/features/auth/LoginPage.tsx`)
- Application routes → Sign-in: routes to (evidence: `src/app/App.tsx`)
- Application routes → Role workspace: renders protected (evidence: `src/app/App.tsx`)
- Application routes → Academic setup UI: routes to (evidence: `src/app/App.tsx`)
- Application routes → Attendance register: routes to (evidence: `src/app/App.tsx`)
- Application routes → Notes and assignments: routes to (evidence: `src/app/App.tsx`)
- Role workspace → Identity and profiles: reads profile (evidence: `src/components/layout/AppShell.tsx`)
- Role workspace → Role navigation: gets links (evidence: `src/components/layout/AppShell.tsx`)
- Identity and profiles → Firebase configuration: uses services (evidence: `src/features/auth/AuthProvider.tsx`)
- Identity and profiles → Cloud Firestore: loads profile (evidence: `src/features/auth/AuthProvider.tsx`)
- Academic setup UI → Academic records: uses records (evidence: `src/features/academic/AcademicSetupPage.tsx`)
- Academic records → Academic validation: validates data (evidence: `src/features/academic/repository.ts`)
- Academic records → Firebase configuration: uses database (evidence: `src/features/academic/repository.ts`)
- Academic records → Cloud Firestore: reads and writes (evidence: `src/features/academic/repository.ts`)
- Attendance register → Attendance records: loads and saves (evidence: `src/features/attendance/AttendancePage.tsx`)
- Attendance register → Learning records: loads teacher access (evidence: `src/features/attendance/AttendancePage.tsx`)
- Attendance records → Attendance validation: validates records (evidence: `src/features/attendance/repository.ts`)
- Attendance records → Cloud Firestore: reads and writes (evidence: `src/features/attendance/repository.ts`)
- Notes and assignments → Learning records: uses materials (evidence: `src/features/learning-materials/LearningMaterialsPage.tsx`)
- Learning records → Learning validation: validates content (evidence: `src/features/learning-materials/repository.ts`)
- Learning records → Firebase configuration: uses services (evidence: `src/features/learning-materials/repository.ts`)
- Learning records → Cloud Firestore: reads and writes (evidence: `src/features/learning-materials/repository.ts`)
- Learning records → Firebase Storage: uploads files (evidence: `src/features/learning-materials/repository.ts`)
- Firebase configuration → Cloud Firestore: initializes (evidence: `src/lib/firebase.ts`)
- Firebase configuration → Firebase Storage: initializes (evidence: `src/lib/firebase.ts`)
- Campus users → Documented broader operations: has planned needs (evidence: `README.md`)
