# abby6702/msuedu_ai architecture

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

- Interactive diagram: https://gitdiagram.com/abby6702/msuedu_ai
- Repository: https://github.com/abby6702/msuedu_ai

## Overview

MSUEdu AI is a Flask tutoring and peer-learning platform. Students discover approved tutors, request sessions, and use an AI assistant, quizzes, progress tools, and a coordinator that prepares—but does not commit—booking changes until confirmation. Tutors manage teaching details and respond to requests; administrators review tutors and manage platform data. Routes delegate to services, which use MySQL-backed helpers; AI features call the local Ollama service. Relationships are limited to README statements and the shown source/index references; unsampled subsystems are represented where the tree supports them.

Main entry points: [`app/services/request_service.py`](https://github.com/abby6702/msuedu_ai/blob/main/app/services/request_service.py) (Request lifecycle), [`app/services/tutor_service.py`](https://github.com/abby6702/msuedu_ai/blob/main/app/services/tutor_service.py) (Tutor matching), [`app/db.py`](https://github.com/abby6702/msuedu_ai/blob/main/app/db.py) (Database helpers), [`app/routes/bookings.py`](https://github.com/abby6702/msuedu_ai/blob/main/app/routes/bookings.py) (Booking requests)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_access["Access and administration"]
  node_auth_routes["Authentication<br/>[auth.py]"]
  node_account_routes["Accounts<br/>[account.py]"]
  node_admin_routes["Admin console<br/>[admin.py]"]
  node_user_service["User profiles<br/>[user_service.py]"]
end

subgraph group_tutoring["Tutoring marketplace"]
  node_tutor_routes["Tutor workspace<br/>[tutor.py]"]
  node_student_routes["Student discovery<br/>[student.py]"]
  node_booking_routes["Booking requests<br/>[bookings.py]"]
  node_tutor_service["Tutor matching<br/>[tutor_service.py]"]
  node_request_service["Request lifecycle<br/>[request_service.py]"]
end

subgraph group_learning["AI learning tools"]
  node_assistant_routes["AI assistant<br/>[assistant.py]"]
  node_quiz_routes["Quizzes<br/>[quizzes.py]"]
  node_progress_routes["Progress insights<br/>[progress.py]"]
  node_agent_routes["AI coordinator<br/>[agent.py]"]
  node_agent_service["Coordinator planning<br/>[agent_service.py]"]
  node_quiz_service["Quiz attempts<br/>[quiz_service.py]"]
  node_ai_service["AI workflows<br/>[ai_service.py]"]
end

subgraph group_platform["Shared platform services"]
  node_db_helpers["Database helpers<br/>[db.py]"]
  node_notifications["Notifications"]
  node_validation["Input and time rules<br/>[validators.py]"]
end

node_students(("Students"))
node_tutors(("Tutors"))
node_admins(("Administrators"))
node_ollama{{"Local Ollama"}}
node_mysql[("MySQL")]

node_students -->|"sign up"| node_auth_routes
node_tutors -->|"sign up"| node_auth_routes
node_admins -->|"manage platform"| node_admin_routes
node_students -->|"find tutors"| node_student_routes
node_students -->|"request sessions"| node_booking_routes
node_tutors -->|"manage availability"| node_tutor_routes
node_tutors -->|"respond to requests"| node_booking_routes
node_students -->|"ask questions"| node_assistant_routes
node_students -->|"take quizzes"| node_quiz_routes
node_students -->|"view progress"| node_progress_routes
node_students -->|"request coordination"| node_agent_routes
node_auth_routes -->|"manage accounts"| node_user_service
node_account_routes -->|"update profile"| node_user_service
node_admin_routes -->|"manage users"| node_user_service
node_admin_routes -->|"review tutors"| node_tutor_service
node_admin_routes -.->|"monitor requests"| node_request_service
node_student_routes -->|"search tutors"| node_tutor_service
node_student_routes -->|"view requests"| node_request_service
node_tutor_routes -->|"manage teaching"| node_tutor_service
node_tutor_routes -->|"respond to requests"| node_request_service
node_booking_routes -->|"change bookings"| node_request_service
node_booking_routes -->|"check tutor details"| node_tutor_service
node_assistant_routes -->|"generate responses"| node_ai_service
node_quiz_routes -->|"manage attempts"| node_quiz_service
node_quiz_routes -.->|"generate quiz"| node_ai_service
node_progress_routes -->|"summarize progress"| node_ai_service
node_progress_routes -->|"read quiz results"| node_quiz_service
node_agent_routes -->|"plan request"| node_agent_service
node_agent_service -->|"interpret message"| node_ollama
node_agent_service -->|"find tutors"| node_tutor_service
node_agent_service -.->|"prepare changes"| node_request_service
node_ai_service -->|"request completion"| node_ollama
node_user_service -->|"read and write"| node_db_helpers
node_tutor_service -->|"read and write"| node_db_helpers
node_request_service -->|"read and write"| node_db_helpers
node_quiz_service -->|"read and write"| node_db_helpers
node_notifications -->|"read and write"| node_db_helpers
node_db_helpers -->|"query database"| node_mysql
node_request_service -->|"record events"| node_notifications
node_booking_routes -->|"validate input"| node_validation

click node_auth_routes "https://github.com/abby6702/msuedu_ai/blob/main/app/routes/auth.py"
click node_account_routes "https://github.com/abby6702/msuedu_ai/blob/main/app/routes/account.py"
click node_admin_routes "https://github.com/abby6702/msuedu_ai/blob/main/app/routes/admin.py"
click node_user_service "https://github.com/abby6702/msuedu_ai/blob/main/app/services/user_service.py"
click node_tutor_routes "https://github.com/abby6702/msuedu_ai/blob/main/app/routes/tutor.py"
click node_student_routes "https://github.com/abby6702/msuedu_ai/blob/main/app/routes/student.py"
click node_booking_routes "https://github.com/abby6702/msuedu_ai/blob/main/app/routes/bookings.py"
click node_tutor_service "https://github.com/abby6702/msuedu_ai/blob/main/app/services/tutor_service.py"
click node_request_service "https://github.com/abby6702/msuedu_ai/blob/main/app/services/request_service.py"
click node_assistant_routes "https://github.com/abby6702/msuedu_ai/blob/main/app/routes/assistant.py"
click node_quiz_routes "https://github.com/abby6702/msuedu_ai/blob/main/app/routes/quizzes.py"
click node_progress_routes "https://github.com/abby6702/msuedu_ai/blob/main/app/routes/progress.py"
click node_agent_routes "https://github.com/abby6702/msuedu_ai/blob/main/app/routes/agent.py"
click node_agent_service "https://github.com/abby6702/msuedu_ai/blob/main/app/services/agent_service.py"
click node_quiz_service "https://github.com/abby6702/msuedu_ai/blob/main/app/services/quiz_service.py"
click node_ai_service "https://github.com/abby6702/msuedu_ai/blob/main/app/services/ai_service.py"
click node_db_helpers "https://github.com/abby6702/msuedu_ai/blob/main/app/db.py"
click node_notifications "https://github.com/abby6702/msuedu_ai/blob/main/app/services/notification_service.py"
click node_validation "https://github.com/abby6702/msuedu_ai/blob/main/app/validators.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_auth_routes,node_account_routes,node_admin_routes,node_user_service toneBlue
class node_tutor_routes,node_student_routes,node_booking_routes,node_tutor_service,node_request_service,node_mysql toneAmber
class node_assistant_routes,node_quiz_routes,node_progress_routes,node_agent_routes,node_agent_service,node_quiz_service,node_ai_service toneMint
class node_db_helpers,node_notifications,node_validation toneRose
class node_students,node_tutors,node_admins,node_ollama toneIndigo
```

## Components

### Access and administration

- [Authentication](https://github.com/abby6702/msuedu_ai/blob/main/app/routes/auth.py): `app/routes/auth.py`
- [Accounts](https://github.com/abby6702/msuedu_ai/blob/main/app/routes/account.py): `app/routes/account.py`
- [Admin console](https://github.com/abby6702/msuedu_ai/blob/main/app/routes/admin.py): `app/routes/admin.py`
- [User profiles](https://github.com/abby6702/msuedu_ai/blob/main/app/services/user_service.py): `app/services/user_service.py`

### Tutoring marketplace

- [Tutor workspace](https://github.com/abby6702/msuedu_ai/blob/main/app/routes/tutor.py): `app/routes/tutor.py`
- [Student discovery](https://github.com/abby6702/msuedu_ai/blob/main/app/routes/student.py): `app/routes/student.py`
- [Booking requests](https://github.com/abby6702/msuedu_ai/blob/main/app/routes/bookings.py): `app/routes/bookings.py`
- [Tutor matching](https://github.com/abby6702/msuedu_ai/blob/main/app/services/tutor_service.py): `app/services/tutor_service.py`
- [Request lifecycle](https://github.com/abby6702/msuedu_ai/blob/main/app/services/request_service.py): `app/services/request_service.py`

### AI learning tools

- [AI assistant](https://github.com/abby6702/msuedu_ai/blob/main/app/routes/assistant.py): `app/routes/assistant.py`
- [Quizzes](https://github.com/abby6702/msuedu_ai/blob/main/app/routes/quizzes.py): `app/routes/quizzes.py`
- [Progress insights](https://github.com/abby6702/msuedu_ai/blob/main/app/routes/progress.py): `app/routes/progress.py`
- [AI coordinator](https://github.com/abby6702/msuedu_ai/blob/main/app/routes/agent.py): `app/routes/agent.py`
- [Coordinator planning](https://github.com/abby6702/msuedu_ai/blob/main/app/services/agent_service.py): `app/services/agent_service.py`
- [Quiz attempts](https://github.com/abby6702/msuedu_ai/blob/main/app/services/quiz_service.py): `app/services/quiz_service.py`
- [AI workflows](https://github.com/abby6702/msuedu_ai/blob/main/app/services/ai_service.py): `app/services/ai_service.py`

### Shared platform services

- [Database helpers](https://github.com/abby6702/msuedu_ai/blob/main/app/db.py): `app/db.py`
- [Notifications](https://github.com/abby6702/msuedu_ai/blob/main/app/services/notification_service.py): `app/services/notification_service.py`
- [Input and time rules](https://github.com/abby6702/msuedu_ai/blob/main/app/validators.py): `app/validators.py`

### Other components

- **Students**
- **Tutors**
- **Administrators**
- **Local Ollama**
- **MySQL**

## Connections

- Students → Authentication: sign up (evidence: `README.md`)
- Tutors → Authentication: sign up (evidence: `README.md`)
- Administrators → Admin console: manage platform (evidence: `README.md`)
- Students → Student discovery: find tutors (evidence: `README.md`)
- Students → Booking requests: request sessions (evidence: `README.md`)
- Tutors → Tutor workspace: manage availability (evidence: `README.md`)
- Tutors → Booking requests: respond to requests (evidence: `README.md`)
- Students → AI assistant: ask questions (evidence: `README.md`)
- Students → Quizzes: take quizzes (evidence: `README.md`)
- Students → Progress insights: view progress (evidence: `README.md`)
- Students → AI coordinator: request coordination (evidence: `README.md`)
- Authentication → User profiles: manage accounts (evidence: `app/routes/auth.py`)
- Accounts → User profiles: update profile (evidence: `app/routes/account.py`)
- Admin console → User profiles: manage users (evidence: `app/routes/admin.py`)
- Admin console → Tutor matching: review tutors (evidence: `app/routes/admin.py`)
- Admin console → Request lifecycle: monitor requests
- Student discovery → Tutor matching: search tutors (evidence: `app/routes/student.py`)
- Student discovery → Request lifecycle: view requests (evidence: `app/routes/student.py`)
- Tutor workspace → Tutor matching: manage teaching (evidence: `app/routes/tutor.py`)
- Tutor workspace → Request lifecycle: respond to requests (evidence: `app/routes/tutor.py`)
- Booking requests → Request lifecycle: change bookings (evidence: `app/routes/bookings.py`)
- Booking requests → Tutor matching: check tutor details (evidence: `app/routes/bookings.py`)
- AI assistant → AI workflows: generate responses (evidence: `app/routes/assistant.py`)
- Quizzes → Quiz attempts: manage attempts (evidence: `app/routes/quizzes.py`)
- Quizzes → AI workflows: generate quiz
- Progress insights → AI workflows: summarize progress (evidence: `app/routes/progress.py`)
- Progress insights → Quiz attempts: read quiz results (evidence: `app/routes/progress.py`)
- AI coordinator → Coordinator planning: plan request (evidence: `app/routes/agent.py`)
- Coordinator planning → Local Ollama: interpret message (evidence: `app/services/agent_service.py`)
- Coordinator planning → Tutor matching: find tutors (evidence: `app/services/agent_service.py`)
- Coordinator planning → Request lifecycle: prepare changes (evidence: `app/services/agent_service.py`)
- AI workflows → Local Ollama: request completion (evidence: `app/services/ai_service.py`)
- User profiles → Database helpers: read and write (evidence: `app/services/user_service.py`)
- Tutor matching → Database helpers: read and write (evidence: `app/services/tutor_service.py`)
- Request lifecycle → Database helpers: read and write (evidence: `app/services/request_service.py`)
- Quiz attempts → Database helpers: read and write (evidence: `app/services/quiz_service.py`)
- Notifications → Database helpers: read and write (evidence: `app/services/notification_service.py`)
- Database helpers → MySQL: query database (evidence: `app/db.py`)
- Request lifecycle → Notifications: record events (evidence: `app/services/request_service.py`)
- Booking requests → Input and time rules: validate input (evidence: `app/routes/bookings.py`)
