# gayathriijs/lab_management_system architecture

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

- Interactive diagram: https://gitdiagram.com/gayathriijs/lab_management_system
- Repository: https://github.com/gayathriijs/lab_management_system

## Overview

LabTrack supports teacher-managed laboratory operations and student participation. The user workflow runs from role-based sign-in through lab, experiment, attendance, submission, quiz, and performance views, with Flask routes applying business rules and MySQL-backed persistence. File uploads support syllabus, experiment, record, and output materials. The README documents major capabilities not all visible in the sampled excerpts; those branches are retained, while links without direct relationship evidence are omitted or marked unverified.

Main entry points: [`backend/app/models.py`](https://github.com/gayathriijs/lab_management_system/blob/main/backend/app/models.py) (Database access), [`backend/app/routes/teacher_routes.py`](https://github.com/gayathriijs/lab_management_system/blob/main/backend/app/routes/teacher_routes.py) (Teacher routes), [`lab-management-frontend/src/App.jsx`](https://github.com/gayathriijs/lab_management_system/blob/main/lab-management-frontend/src/App.jsx) (Routes and layout), [`backend/app/routes/student_routes.py`](https://github.com/gayathriijs/lab_management_system/blob/main/backend/app/routes/student_routes.py) (Student routes)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Web application"]
  node_app["Routes and layout<br/>[App.jsx]"]
  node_authui["Sign-in pages"]
  node_authstate["Auth context<br/>[AuthContext.jsx]"]
  node_teacherui["Teacher workflows"]
  node_studentui["Student workflows"]
  node_authapi["Auth API client<br/>[auth.js]"]
  node_teacherapi["Teacher API client<br/>[teacher.js]"]
  node_studentapi["Student API client<br/>[student.js]"]
  node_axios["HTTP client<br/>[axios.js]"]
end

subgraph group_backend["API and domain"]
  node_authroutes["Authentication routes<br/>[auth_routes.py]"]
  node_teacherroutes["Teacher routes<br/>[teacher_routes.py]"]
  node_studentroutes["Student routes<br/>[student_routes.py]"]
  node_authlogic["JWT and roles<br/>[auth.py]"]
  node_quiz["Quiz generation<br/>[quiz_service.py]"]
  node_performance["Performance metrics"]
  node_fileutils["File handling<br/>[utils.py]"]
end

subgraph group_data["Persistence and files"]
  node_database["Database access<br/>[models.py]"]
  node_mysql[("MySQL")]
  node_uploads["Uploaded materials<br/>[config.py]"]
end

node_teacher(("Teacher"))
node_student(("Student"))

node_app -->|"provides auth"| node_authstate
node_app -->|"routes to"| node_authui
node_app -->|"routes to"| node_teacherui
node_app -->|"routes to"| node_studentui
node_authstate -->|"calls"| node_authapi
node_authapi -->|"uses"| node_axios
node_teacherui -->|"calls"| node_teacherapi
node_studentui -->|"calls"| node_studentapi
node_teacherapi -->|"uses"| node_axios
node_studentapi -->|"uses"| node_axios
node_teacher -.->|"uses"| node_app
node_student -.->|"uses"| node_app
node_authapi -.->|"HTTP requests"| node_authroutes
node_teacherapi -.->|"HTTP requests"| node_teacherroutes
node_studentapi -.->|"HTTP requests"| node_studentroutes
node_authroutes -->|"authenticates"| node_authlogic
node_teacherroutes -->|"guards routes"| node_authlogic
node_studentroutes -->|"guards routes"| node_authlogic
node_teacherroutes -->|"generates quizzes"| node_quiz
node_teacherroutes -->|"requests metrics"| node_performance
node_studentroutes -->|"requests metrics"| node_performance
node_teacherroutes -.->|"handles files"| node_fileutils
node_studentroutes -->|"handles files"| node_fileutils
node_authlogic -->|"looks up users"| node_database
node_authroutes -->|"reads and writes"| node_database
node_teacherroutes -->|"reads and writes"| node_database
node_studentroutes -->|"reads and writes"| node_database
node_performance -->|"queries metrics"| node_database
node_quiz -->|"uses data"| node_database
node_database -->|"queries"| node_mysql
node_fileutils -->|"saves files"| node_uploads

click node_app "https://github.com/gayathriijs/lab_management_system/blob/main/lab-management-frontend/src/App.jsx"
click node_authui "https://github.com/gayathriijs/lab_management_system/tree/main/lab-management-frontend/src/pages/auth"
click node_authstate "https://github.com/gayathriijs/lab_management_system/blob/main/lab-management-frontend/src/context/AuthContext.jsx"
click node_teacherui "https://github.com/gayathriijs/lab_management_system/tree/main/lab-management-frontend/src/pages/teacher"
click node_studentui "https://github.com/gayathriijs/lab_management_system/tree/main/lab-management-frontend/src/pages/student"
click node_authapi "https://github.com/gayathriijs/lab_management_system/blob/main/lab-management-frontend/src/api/auth.js"
click node_teacherapi "https://github.com/gayathriijs/lab_management_system/blob/main/lab-management-frontend/src/api/teacher.js"
click node_studentapi "https://github.com/gayathriijs/lab_management_system/blob/main/lab-management-frontend/src/api/student.js"
click node_axios "https://github.com/gayathriijs/lab_management_system/blob/main/lab-management-frontend/src/api/axios.js"
click node_authroutes "https://github.com/gayathriijs/lab_management_system/blob/main/backend/app/routes/auth_routes.py"
click node_teacherroutes "https://github.com/gayathriijs/lab_management_system/blob/main/backend/app/routes/teacher_routes.py"
click node_studentroutes "https://github.com/gayathriijs/lab_management_system/blob/main/backend/app/routes/student_routes.py"
click node_authlogic "https://github.com/gayathriijs/lab_management_system/blob/main/backend/app/auth.py"
click node_quiz "https://github.com/gayathriijs/lab_management_system/blob/main/backend/app/services/quiz_service.py"
click node_performance "https://github.com/gayathriijs/lab_management_system/blob/main/backend/app/services/performance_service.py"
click node_fileutils "https://github.com/gayathriijs/lab_management_system/blob/main/backend/app/utils.py"
click node_database "https://github.com/gayathriijs/lab_management_system/blob/main/backend/app/models.py"
click node_uploads "https://github.com/gayathriijs/lab_management_system/blob/main/backend/app/config.py"

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_authui,node_authstate,node_teacherui,node_studentui,node_authapi,node_teacherapi,node_studentapi,node_axios toneBlue
class node_authroutes,node_teacherroutes,node_studentroutes,node_authlogic,node_quiz,node_performance,node_fileutils toneAmber
class node_database,node_mysql,node_uploads toneMint
class node_teacher,node_student toneIndigo
```

## Components

### Web application

- [Routes and layout](https://github.com/gayathriijs/lab_management_system/blob/main/lab-management-frontend/src/App.jsx): `lab-management-frontend/src/App.jsx`
- [Sign-in pages](https://github.com/gayathriijs/lab_management_system/tree/main/lab-management-frontend/src/pages/auth): `lab-management-frontend/src/pages/auth`
- [Auth context](https://github.com/gayathriijs/lab_management_system/blob/main/lab-management-frontend/src/context/AuthContext.jsx): `lab-management-frontend/src/context/AuthContext.jsx`
- [Teacher workflows](https://github.com/gayathriijs/lab_management_system/tree/main/lab-management-frontend/src/pages/teacher): `lab-management-frontend/src/pages/teacher`
- [Student workflows](https://github.com/gayathriijs/lab_management_system/tree/main/lab-management-frontend/src/pages/student): `lab-management-frontend/src/pages/student`
- [Auth API client](https://github.com/gayathriijs/lab_management_system/blob/main/lab-management-frontend/src/api/auth.js): `lab-management-frontend/src/api/auth.js`
- [Teacher API client](https://github.com/gayathriijs/lab_management_system/blob/main/lab-management-frontend/src/api/teacher.js): `lab-management-frontend/src/api/teacher.js`
- [Student API client](https://github.com/gayathriijs/lab_management_system/blob/main/lab-management-frontend/src/api/student.js): `lab-management-frontend/src/api/student.js`
- [HTTP client](https://github.com/gayathriijs/lab_management_system/blob/main/lab-management-frontend/src/api/axios.js): `lab-management-frontend/src/api/axios.js`

### API and domain

- [Authentication routes](https://github.com/gayathriijs/lab_management_system/blob/main/backend/app/routes/auth_routes.py): `backend/app/routes/auth_routes.py`
- [Teacher routes](https://github.com/gayathriijs/lab_management_system/blob/main/backend/app/routes/teacher_routes.py): `backend/app/routes/teacher_routes.py`
- [Student routes](https://github.com/gayathriijs/lab_management_system/blob/main/backend/app/routes/student_routes.py): `backend/app/routes/student_routes.py`
- [JWT and roles](https://github.com/gayathriijs/lab_management_system/blob/main/backend/app/auth.py): `backend/app/auth.py`
- [Quiz generation](https://github.com/gayathriijs/lab_management_system/blob/main/backend/app/services/quiz_service.py): `backend/app/services/quiz_service.py`
- [Performance metrics](https://github.com/gayathriijs/lab_management_system/blob/main/backend/app/services/performance_service.py): `backend/app/services/performance_service.py`
- [File handling](https://github.com/gayathriijs/lab_management_system/blob/main/backend/app/utils.py): `backend/app/utils.py`

### Persistence and files

- [Database access](https://github.com/gayathriijs/lab_management_system/blob/main/backend/app/models.py): `backend/app/models.py`
- **MySQL**
- [Uploaded materials](https://github.com/gayathriijs/lab_management_system/blob/main/backend/app/config.py): `backend/app/config.py`

### Other components

- **Teacher**
- **Student**

## Connections

- Routes and layout → Auth context: provides auth (evidence: `lab-management-frontend/src/App.jsx`)
- Routes and layout → Sign-in pages: routes to (evidence: `lab-management-frontend/src/App.jsx`)
- Routes and layout → Teacher workflows: routes to (evidence: `lab-management-frontend/src/App.jsx`)
- Routes and layout → Student workflows: routes to (evidence: `lab-management-frontend/src/App.jsx`)
- Auth context → Auth API client: calls (evidence: `lab-management-frontend/src/context/AuthContext.jsx`)
- Auth API client → HTTP client: uses (evidence: `lab-management-frontend/src/api/auth.js`)
- Teacher workflows → Teacher API client: calls (evidence: `lab-management-frontend/src/pages/teacher/TeacherDashboard.jsx`)
- Student workflows → Student API client: calls (evidence: `lab-management-frontend/src/pages/student/MyLabs.jsx`)
- Teacher API client → HTTP client: uses (evidence: `lab-management-frontend/src/api/teacher.js`)
- Student API client → HTTP client: uses (evidence: `lab-management-frontend/src/api/student.js`)
- Teacher → Routes and layout: uses
- Student → Routes and layout: uses
- Auth API client → Authentication routes: HTTP requests
- Teacher API client → Teacher routes: HTTP requests
- Student API client → Student routes: HTTP requests
- Authentication routes → JWT and roles: authenticates (evidence: `backend/app/routes/auth_routes.py`)
- Teacher routes → JWT and roles: guards routes (evidence: `backend/app/routes/teacher_routes.py`)
- Student routes → JWT and roles: guards routes (evidence: `backend/app/routes/student_routes.py`)
- Teacher routes → Quiz generation: generates quizzes (evidence: `backend/app/routes/teacher_routes.py`)
- Teacher routes → Performance metrics: requests metrics (evidence: `backend/app/routes/teacher_routes.py`)
- Student routes → Performance metrics: requests metrics (evidence: `backend/app/routes/student_routes.py`)
- Teacher routes → File handling: handles files (evidence: `backend/app/routes/teacher_routes.py`)
- Student routes → File handling: handles files (evidence: `backend/app/routes/student_routes.py`)
- JWT and roles → Database access: looks up users (evidence: `backend/app/auth.py`)
- Authentication routes → Database access: reads and writes (evidence: `backend/app/routes/auth_routes.py`)
- Teacher routes → Database access: reads and writes (evidence: `backend/app/routes/teacher_routes.py`)
- Student routes → Database access: reads and writes (evidence: `backend/app/routes/student_routes.py`)
- Performance metrics → Database access: queries metrics (evidence: `backend/app/services/performance_service.py`)
- Quiz generation → Database access: uses data (evidence: `backend/app/services/quiz_service.py`)
- Database access → MySQL: queries (evidence: `backend/app/models.py`)
- File handling → Uploaded materials: saves files (evidence: `backend/app/utils.py`)
