# xxemran05khanxx/uniflow architecture

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

- Interactive diagram: https://gitdiagram.com/xxemran05khanxx/uniflow
- Repository: https://github.com/xxemran05khanxx/uniflow

## Overview

UniFlow’s frontend is a role-based university timetable management system. Users enter through login or registration, then reach protected dashboards and role-specific pages for timetable viewing and generation, teacher/class workflows, and administration of rooms, subjects, users, and data. Timetable generation coordinates timetable, subject, and data-management services; administrative pages use domain services that call the backend API. The README identifies the active Express/MongoDB backend, but its implementation is not in this tree. Some service-to-page and routing links are supported by the source index rather than inspected excerpts.

Main entry points: [`frontend/src/App.tsx`](https://github.com/xxemran05khanxx/uniflow/blob/main/frontend/src/App.tsx) (App routing), [`frontend/src/store/authSlice.ts`](https://github.com/xxemran05khanxx/uniflow/blob/main/frontend/src/store/authSlice.ts) (Authentication state), [`frontend/src/services/subjectManagementService.ts`](https://github.com/xxemran05khanxx/uniflow/blob/main/frontend/src/services/subjectManagementService.ts) (Subject service), [`frontend/src/pages/Timetable/TimetableGenerationPage.tsx`](https://github.com/xxemran05khanxx/uniflow/blob/main/frontend/src/pages/Timetable/TimetableGenerationPage.tsx) (Timetable generation)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_access["Access and app shell"]
  node_app["App routing<br/>[App.tsx]"]
  node_login["Login and register<br/>[LoginPage.tsx]"]
  node_auth["Authentication state<br/>[authSlice.ts]"]
  node_authhook["Role-aware auth<br/>[useAuth.ts]"]
  node_notifications["Notifications"]
end

subgraph group_academic["Academic workflows"]
  node_dashboard["Role dashboards<br/>[DashboardPage.tsx]"]
  node_timetablegen["Timetable generation"]
  node_timetables["Timetable views<br/>[TimetablePage.tsx]"]
  node_teacherclasses["Teacher classes"]
end

subgraph group_admin["Administration"]
  node_roomadmin["Room management"]
  node_subjectadmin["Subject management"]
  node_usersadmin["User management"]
end

subgraph group_integration["Services and backend"]
  node_roomservice["Room service"]
  node_subjectservice["Subject service"]
  node_timetable_service["Timetable service"]
  node_datamanagement["Data management"]
  node_authapi["API operations<br/>[api.ts]"]
  node_backend{{"Uniflow backend"}}
end

node_user(("University user"))

node_user -->|"signs in"| node_login
node_app -->|"routes to"| node_login
node_app -->|"routes to"| node_dashboard
node_app -->|"routes to"| node_teacherclasses
node_app -->|"routes to"| node_roomadmin
node_app -->|"provides"| node_notifications
node_app -->|"initializes"| node_auth
node_login -->|"dispatches auth"| node_auth
node_auth -->|"requests auth"| node_authapi
node_authhook -->|"selects state"| node_auth
node_timetablegen -->|"requests schedules"| node_timetable_service
node_timetablegen -->|"uses subjects"| node_subjectservice
node_timetablegen -->|"uses data tools"| node_datamanagement
node_timetables -->|"loads schedules"| node_timetable_service
node_timetables -->|"loads subjects"| node_subjectservice
node_roomadmin -->|"manages rooms"| node_roomservice
node_subjectadmin -->|"manages subjects"| node_subjectservice
node_roomservice -->|"calls API"| node_backend
node_subjectservice -->|"calls API"| node_backend
node_timetable_service -->|"calls API"| node_backend
node_authapi -.->|"calls API"| node_backend

click node_app "https://github.com/xxemran05khanxx/uniflow/blob/main/frontend/src/App.tsx"
click node_login "https://github.com/xxemran05khanxx/uniflow/blob/main/frontend/src/pages/LoginPage.tsx"
click node_auth "https://github.com/xxemran05khanxx/uniflow/blob/main/frontend/src/store/authSlice.ts"
click node_authhook "https://github.com/xxemran05khanxx/uniflow/blob/main/frontend/src/hooks/useAuth.ts"
click node_notifications "https://github.com/xxemran05khanxx/uniflow/blob/main/frontend/src/contexts/NotificationContext.tsx"
click node_dashboard "https://github.com/xxemran05khanxx/uniflow/blob/main/frontend/src/pages/DashboardPage.tsx"
click node_timetablegen "https://github.com/xxemran05khanxx/uniflow/blob/main/frontend/src/pages/Timetable/TimetableGenerationPage.tsx"
click node_timetables "https://github.com/xxemran05khanxx/uniflow/blob/main/frontend/src/pages/Timetable/TimetablePage.tsx"
click node_teacherclasses "https://github.com/xxemran05khanxx/uniflow/blob/main/frontend/src/pages/Teacher/TeacherClassesPage.tsx"
click node_roomadmin "https://github.com/xxemran05khanxx/uniflow/blob/main/frontend/src/pages/Admin/RoomManagementPage.tsx"
click node_subjectadmin "https://github.com/xxemran05khanxx/uniflow/blob/main/frontend/src/pages/Admin/SubjectManagementPage.tsx"
click node_usersadmin "https://github.com/xxemran05khanxx/uniflow/blob/main/frontend/src/pages/Admin/UserManagementPage.tsx"
click node_roomservice "https://github.com/xxemran05khanxx/uniflow/blob/main/frontend/src/services/roomManagementService.ts"
click node_subjectservice "https://github.com/xxemran05khanxx/uniflow/blob/main/frontend/src/services/subjectManagementService.ts"
click node_timetable_service "https://github.com/xxemran05khanxx/uniflow/blob/main/frontend/src/services/timetableService.ts"
click node_datamanagement "https://github.com/xxemran05khanxx/uniflow/blob/main/frontend/src/services/dataManagementService.ts"
click node_authapi "https://github.com/xxemran05khanxx/uniflow/blob/main/frontend/src/services/api.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_app,node_login,node_auth,node_authhook,node_notifications,node_user toneBlue
class node_dashboard,node_timetablegen,node_timetables,node_teacherclasses toneAmber
class node_roomadmin,node_subjectadmin,node_usersadmin toneMint
class node_roomservice,node_subjectservice,node_timetable_service,node_datamanagement,node_authapi,node_backend toneRose
```

## Components

### Access and app shell

- [App routing](https://github.com/xxemran05khanxx/uniflow/blob/main/frontend/src/App.tsx): `frontend/src/App.tsx`
- [Login and register](https://github.com/xxemran05khanxx/uniflow/blob/main/frontend/src/pages/LoginPage.tsx): `frontend/src/pages/LoginPage.tsx`
- [Authentication state](https://github.com/xxemran05khanxx/uniflow/blob/main/frontend/src/store/authSlice.ts): `frontend/src/store/authSlice.ts`
- [Role-aware auth](https://github.com/xxemran05khanxx/uniflow/blob/main/frontend/src/hooks/useAuth.ts): `frontend/src/hooks/useAuth.ts`
- [Notifications](https://github.com/xxemran05khanxx/uniflow/blob/main/frontend/src/contexts/NotificationContext.tsx): `frontend/src/contexts/NotificationContext.tsx`

### Academic workflows

- [Role dashboards](https://github.com/xxemran05khanxx/uniflow/blob/main/frontend/src/pages/DashboardPage.tsx): `frontend/src/pages/DashboardPage.tsx`
- [Timetable generation](https://github.com/xxemran05khanxx/uniflow/blob/main/frontend/src/pages/Timetable/TimetableGenerationPage.tsx): `frontend/src/pages/Timetable/TimetableGenerationPage.tsx`
- [Timetable views](https://github.com/xxemran05khanxx/uniflow/blob/main/frontend/src/pages/Timetable/TimetablePage.tsx): `frontend/src/pages/Timetable/TimetablePage.tsx`
- [Teacher classes](https://github.com/xxemran05khanxx/uniflow/blob/main/frontend/src/pages/Teacher/TeacherClassesPage.tsx): `frontend/src/pages/Teacher/TeacherClassesPage.tsx`

### Administration

- [Room management](https://github.com/xxemran05khanxx/uniflow/blob/main/frontend/src/pages/Admin/RoomManagementPage.tsx): `frontend/src/pages/Admin/RoomManagementPage.tsx`
- [Subject management](https://github.com/xxemran05khanxx/uniflow/blob/main/frontend/src/pages/Admin/SubjectManagementPage.tsx): `frontend/src/pages/Admin/SubjectManagementPage.tsx`
- [User management](https://github.com/xxemran05khanxx/uniflow/blob/main/frontend/src/pages/Admin/UserManagementPage.tsx): `frontend/src/pages/Admin/UserManagementPage.tsx`

### Services and backend

- [Room service](https://github.com/xxemran05khanxx/uniflow/blob/main/frontend/src/services/roomManagementService.ts): `frontend/src/services/roomManagementService.ts`
- [Subject service](https://github.com/xxemran05khanxx/uniflow/blob/main/frontend/src/services/subjectManagementService.ts): `frontend/src/services/subjectManagementService.ts`
- [Timetable service](https://github.com/xxemran05khanxx/uniflow/blob/main/frontend/src/services/timetableService.ts): `frontend/src/services/timetableService.ts`
- [Data management](https://github.com/xxemran05khanxx/uniflow/blob/main/frontend/src/services/dataManagementService.ts): `frontend/src/services/dataManagementService.ts`
- [API operations](https://github.com/xxemran05khanxx/uniflow/blob/main/frontend/src/services/api.ts): `frontend/src/services/api.ts`
- **Uniflow backend**

### Other components

- **University user**

## Connections

- University user → Login and register: signs in (evidence: `frontend/src/pages/LoginPage.tsx`)
- App routing → Login and register: routes to (evidence: `frontend/src/App.tsx`)
- App routing → Role dashboards: routes to (evidence: `frontend/src/App.tsx`)
- App routing → Teacher classes: routes to (evidence: `frontend/src/App.tsx`)
- App routing → Room management: routes to (evidence: `frontend/src/App.tsx`)
- App routing → Notifications: provides (evidence: `frontend/src/App.tsx`)
- App routing → Authentication state: initializes (evidence: `frontend/src/App.tsx`)
- Login and register → Authentication state: dispatches auth (evidence: `frontend/src/pages/LoginPage.tsx`)
- Authentication state → API operations: requests auth (evidence: `frontend/src/store/authSlice.ts`)
- Role-aware auth → Authentication state: selects state (evidence: `frontend/src/hooks/useAuth.ts`)
- Timetable generation → Timetable service: requests schedules (evidence: `frontend/src/pages/Timetable/TimetableGenerationPage.tsx`)
- Timetable generation → Subject service: uses subjects (evidence: `frontend/src/pages/Timetable/TimetableGenerationPage.tsx`)
- Timetable generation → Data management: uses data tools (evidence: `frontend/src/pages/Timetable/TimetableGenerationPage.tsx`)
- Timetable views → Timetable service: loads schedules (evidence: `frontend/src/pages/Timetable/TimetablePage.tsx`)
- Timetable views → Subject service: loads subjects (evidence: `frontend/src/pages/Timetable/TimetablePage.tsx`)
- Room management → Room service: manages rooms (evidence: `frontend/src/pages/Admin/RoomManagementPage.tsx`)
- Subject management → Subject service: manages subjects (evidence: `frontend/src/pages/Admin/SubjectManagementPage.tsx`)
- Room service → Uniflow backend: calls API (evidence: `frontend/src/services/roomManagementService.ts`)
- Subject service → Uniflow backend: calls API (evidence: `frontend/src/services/subjectManagementService.ts`)
- Timetable service → Uniflow backend: calls API (evidence: `frontend/src/services/timetableService.ts`)
- API operations → Uniflow backend: calls API
