# vudinhphong2-1/be-mos_excel_grade architecture

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

- Interactive diagram: https://gitdiagram.com/vudinhphong2-1/be-mos_excel_grade
- Repository: https://github.com/vudinhphong2-1/be-mos_excel_grade

## Overview

MOS Project is an ASP.NET Core backend for managing coursework and classes, grading Excel and Word submissions, and administering published exams. A teacher submits a workbook through the grading API; the controller invokes the grading service, which runs project/task graders and returns results, while the controller records an attempt for analytics. Other API areas cover identity, assignments, classroom operations, scores, scheduling, and exam sessions. MongoDB/GridFS and optional Redis support persistence and caching; Google Sheets attendance sync is also documented. Some subsystem links are dashed because their implementation was not sampled.

Main entry points: [`MOS.ExcelGrading.API/Program.cs`](https://github.com/vudinhphong2-1/be-mos_excel_grade/blob/main/MOS.ExcelGrading.API/Program.cs) (Web API), [`MOS.ExcelGrading.API/Controllers/AssignmentController.cs`](https://github.com/vudinhphong2-1/be-mos_excel_grade/blob/main/MOS.ExcelGrading.API/Controllers/AssignmentController.cs) (Assignments), [`MOS.ExcelGrading.API/Controllers/GradingController.cs`](https://github.com/vudinhphong2-1/be-mos_excel_grade/blob/main/MOS.ExcelGrading.API/Controllers/GradingController.cs) (Grading API), [`MOS.ExcelGrading.API/Controllers/AuthController.cs`](https://github.com/vudinhphong2-1/be-mos_excel_grade/blob/main/MOS.ExcelGrading.API/Controllers/AuthController.cs) (Authentication)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["API and Identity"]
  node_api["Web API<br/>[Program.cs]"]
  node_auth["Authentication<br/>[AuthController.cs]"]
  node_users["User service<br/>[IUserService.cs]"]
end

subgraph group_grading["Grading and Results"]
  node_assignment["Assignments"]
  node_assignmentdata["Assignment service"]
  node_gradingapi["Grading API"]
  node_grader["Grading service<br/>[GradingService.cs]"]
  node_taskgraders["Project task graders<br/>[P01T1Grader.cs]"]
  node_results["Scores<br/>[ScoreService.cs]"]
  node_analytics["Analytics"]
end

subgraph group_classroom["Classroom Operations"]
  node_school["Schools"]
  node_classes["Classes<br/>[ClassController.cs]"]
  node_students["Students<br/>[StudentService.cs]"]
end

subgraph group_exams["Exams and Scheduling"]
  node_sessions["Exam sessions"]
  node_publications["Exam publications"]
  node_schedule["Scheduling"]
  node_attendance["Attendance sync"]
end

subgraph group_infra["Persistence and Integrations"]
  node_mongo[("MongoDB<br/>[MongoDbSettings.cs]")]
  node_redis[("Redis cache<br/>[RedisSettings.cs]")]
  node_google["Google Sheets"]
  node_gridfs[("GridFS assets")]
end

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

node_teacher -->|"uses"| node_api
node_student -->|"uses"| node_api
node_api -.->|"routes requests"| node_auth
node_auth -->|"calls"| node_users
node_api -.->|"routes requests"| node_assignment
node_assignment -->|"calls"| node_assignmentdata
node_api -.->|"routes requests"| node_gradingapi
node_gradingapi -->|"grades submission"| node_grader
node_grader -->|"dispatches tasks"| node_taskgraders
node_gradingapi -->|"saves attempt"| node_analytics
node_api -.->|"routes score requests"| node_results
node_api -.->|"routes requests"| node_school
node_api -.->|"routes requests"| node_classes
node_classes -->|"uses school service"| node_school
node_api -.->|"routes requests"| node_students
node_api -.->|"routes requests"| node_sessions
node_sessions -.->|"loads publication"| node_publications
node_api -.->|"routes requests"| node_schedule
node_schedule -->|"invokes sync"| node_attendance
node_attendance -.->|"syncs attendance"| node_google
node_api -->|"configures database"| node_mongo
node_api -->|"configures cache"| node_redis
node_assignment -->|"uses file service"| node_gridfs

click node_api "https://github.com/vudinhphong2-1/be-mos_excel_grade/blob/main/MOS.ExcelGrading.API/Program.cs"
click node_auth "https://github.com/vudinhphong2-1/be-mos_excel_grade/blob/main/MOS.ExcelGrading.API/Controllers/AuthController.cs"
click node_users "https://github.com/vudinhphong2-1/be-mos_excel_grade/blob/main/MOS.ExcelGrading.Core/Interfaces/IUserService.cs"
click node_assignment "https://github.com/vudinhphong2-1/be-mos_excel_grade/blob/main/MOS.ExcelGrading.API/Controllers/AssignmentController.cs"
click node_assignmentdata "https://github.com/vudinhphong2-1/be-mos_excel_grade/blob/main/MOS.ExcelGrading.Core/Services/AssignmentService.cs"
click node_gradingapi "https://github.com/vudinhphong2-1/be-mos_excel_grade/blob/main/MOS.ExcelGrading.API/Controllers/GradingController.cs"
click node_grader "https://github.com/vudinhphong2-1/be-mos_excel_grade/blob/main/MOS.ExcelGrading.Core/Services/GradingService.cs"
click node_taskgraders "https://github.com/vudinhphong2-1/be-mos_excel_grade/blob/main/MOS.ExcelGrading.Core/Graders/OTTH/Excel/Project01/P01T1Grader.cs"
click node_results "https://github.com/vudinhphong2-1/be-mos_excel_grade/blob/main/MOS.ExcelGrading.Core/Services/ScoreService.cs"
click node_analytics "https://github.com/vudinhphong2-1/be-mos_excel_grade/blob/main/MOS.ExcelGrading.Core/Services/AnalyticsService.cs"
click node_school "https://github.com/vudinhphong2-1/be-mos_excel_grade/blob/main/MOS.ExcelGrading.API/Controllers/SchoolController.cs"
click node_classes "https://github.com/vudinhphong2-1/be-mos_excel_grade/blob/main/MOS.ExcelGrading.API/Controllers/ClassController.cs"
click node_students "https://github.com/vudinhphong2-1/be-mos_excel_grade/blob/main/MOS.ExcelGrading.Core/Services/StudentService.cs"
click node_sessions "https://github.com/vudinhphong2-1/be-mos_excel_grade/blob/main/MOS.ExcelGrading.Core/Services/ExamSessionService.cs"
click node_publications "https://github.com/vudinhphong2-1/be-mos_excel_grade/blob/main/MOS.ExcelGrading.API/Controllers/ExamPublicationsController.cs"
click node_schedule "https://github.com/vudinhphong2-1/be-mos_excel_grade/blob/main/MOS.ExcelGrading.API/Controllers/ScheduleController.cs"
click node_attendance "https://github.com/vudinhphong2-1/be-mos_excel_grade/blob/main/MOS.ExcelGrading.Core/Services/GoogleSheetAttendanceSyncService.cs"
click node_mongo "https://github.com/vudinhphong2-1/be-mos_excel_grade/blob/main/MOS.ExcelGrading.Core/Models/MongoDbSettings.cs"
click node_redis "https://github.com/vudinhphong2-1/be-mos_excel_grade/blob/main/MOS.ExcelGrading.Core/Models/RedisSettings.cs"
click node_gridfs "https://github.com/vudinhphong2-1/be-mos_excel_grade/blob/main/MOS.ExcelGrading.Core/Services/AssignmentFileService.cs"

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_api,node_auth,node_users toneBlue
class node_assignment,node_assignmentdata,node_gradingapi,node_grader,node_taskgraders,node_results,node_analytics toneAmber
class node_school,node_classes,node_students toneMint
class node_sessions,node_publications,node_schedule,node_attendance toneRose
class node_mongo,node_redis,node_google,node_gridfs,node_teacher,node_student toneIndigo
```

## Components

### API and Identity

- [Web API](https://github.com/vudinhphong2-1/be-mos_excel_grade/blob/main/MOS.ExcelGrading.API/Program.cs): `MOS.ExcelGrading.API/Program.cs`
- [Authentication](https://github.com/vudinhphong2-1/be-mos_excel_grade/blob/main/MOS.ExcelGrading.API/Controllers/AuthController.cs): `MOS.ExcelGrading.API/Controllers/AuthController.cs`
- [User service](https://github.com/vudinhphong2-1/be-mos_excel_grade/blob/main/MOS.ExcelGrading.Core/Interfaces/IUserService.cs): `MOS.ExcelGrading.Core/Interfaces/IUserService.cs`

### Grading and Results

- [Assignments](https://github.com/vudinhphong2-1/be-mos_excel_grade/blob/main/MOS.ExcelGrading.API/Controllers/AssignmentController.cs): `MOS.ExcelGrading.API/Controllers/AssignmentController.cs`
- [Assignment service](https://github.com/vudinhphong2-1/be-mos_excel_grade/blob/main/MOS.ExcelGrading.Core/Services/AssignmentService.cs): `MOS.ExcelGrading.Core/Services/AssignmentService.cs`
- [Grading API](https://github.com/vudinhphong2-1/be-mos_excel_grade/blob/main/MOS.ExcelGrading.API/Controllers/GradingController.cs): `MOS.ExcelGrading.API/Controllers/GradingController.cs`
- [Grading service](https://github.com/vudinhphong2-1/be-mos_excel_grade/blob/main/MOS.ExcelGrading.Core/Services/GradingService.cs): `MOS.ExcelGrading.Core/Services/GradingService.cs`
- [Project task graders](https://github.com/vudinhphong2-1/be-mos_excel_grade/blob/main/MOS.ExcelGrading.Core/Graders/OTTH/Excel/Project01/P01T1Grader.cs): `MOS.ExcelGrading.Core/Graders/OTTH/Excel/Project01/P01T1Grader.cs`
- [Scores](https://github.com/vudinhphong2-1/be-mos_excel_grade/blob/main/MOS.ExcelGrading.Core/Services/ScoreService.cs): `MOS.ExcelGrading.Core/Services/ScoreService.cs`
- [Analytics](https://github.com/vudinhphong2-1/be-mos_excel_grade/blob/main/MOS.ExcelGrading.Core/Services/AnalyticsService.cs): `MOS.ExcelGrading.Core/Services/AnalyticsService.cs`

### Classroom Operations

- [Schools](https://github.com/vudinhphong2-1/be-mos_excel_grade/blob/main/MOS.ExcelGrading.API/Controllers/SchoolController.cs): `MOS.ExcelGrading.API/Controllers/SchoolController.cs`
- [Classes](https://github.com/vudinhphong2-1/be-mos_excel_grade/blob/main/MOS.ExcelGrading.API/Controllers/ClassController.cs): `MOS.ExcelGrading.API/Controllers/ClassController.cs`
- [Students](https://github.com/vudinhphong2-1/be-mos_excel_grade/blob/main/MOS.ExcelGrading.Core/Services/StudentService.cs): `MOS.ExcelGrading.Core/Services/StudentService.cs`

### Exams and Scheduling

- [Exam sessions](https://github.com/vudinhphong2-1/be-mos_excel_grade/blob/main/MOS.ExcelGrading.Core/Services/ExamSessionService.cs): `MOS.ExcelGrading.Core/Services/ExamSessionService.cs`
- [Exam publications](https://github.com/vudinhphong2-1/be-mos_excel_grade/blob/main/MOS.ExcelGrading.API/Controllers/ExamPublicationsController.cs): `MOS.ExcelGrading.API/Controllers/ExamPublicationsController.cs`
- [Scheduling](https://github.com/vudinhphong2-1/be-mos_excel_grade/blob/main/MOS.ExcelGrading.API/Controllers/ScheduleController.cs): `MOS.ExcelGrading.API/Controllers/ScheduleController.cs`
- [Attendance sync](https://github.com/vudinhphong2-1/be-mos_excel_grade/blob/main/MOS.ExcelGrading.Core/Services/GoogleSheetAttendanceSyncService.cs): `MOS.ExcelGrading.Core/Services/GoogleSheetAttendanceSyncService.cs`

### Persistence and Integrations

- [MongoDB](https://github.com/vudinhphong2-1/be-mos_excel_grade/blob/main/MOS.ExcelGrading.Core/Models/MongoDbSettings.cs): `MOS.ExcelGrading.Core/Models/MongoDbSettings.cs`
- [Redis cache](https://github.com/vudinhphong2-1/be-mos_excel_grade/blob/main/MOS.ExcelGrading.Core/Models/RedisSettings.cs): `MOS.ExcelGrading.Core/Models/RedisSettings.cs`
- **Google Sheets**
- [GridFS assets](https://github.com/vudinhphong2-1/be-mos_excel_grade/blob/main/MOS.ExcelGrading.Core/Services/AssignmentFileService.cs): `MOS.ExcelGrading.Core/Services/AssignmentFileService.cs`

### Other components

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

## Connections

- Teacher → Web API: uses (evidence: `README.md`)
- Student → Web API: uses (evidence: `README.md`)
- Web API → Authentication: routes requests
- Authentication → User service: calls (evidence: `MOS.ExcelGrading.API/Controllers/AuthController.cs`)
- Web API → Assignments: routes requests
- Assignments → Assignment service: calls (evidence: `MOS.ExcelGrading.API/Controllers/AssignmentController.cs`)
- Web API → Grading API: routes requests
- Grading API → Grading service: grades submission (evidence: `MOS.ExcelGrading.API/Controllers/GradingController.cs`)
- Grading service → Project task graders: dispatches tasks (evidence: `MOS.ExcelGrading.Core/Services/GradingService.cs`)
- Grading API → Analytics: saves attempt (evidence: `MOS.ExcelGrading.API/Controllers/GradingController.cs`)
- Web API → Scores: routes score requests (evidence: `MOS.ExcelGrading.API/Program.cs`)
- Web API → Schools: routes requests
- Web API → Classes: routes requests
- Classes → Schools: uses school service (evidence: `MOS.ExcelGrading.API/Controllers/ClassController.cs`)
- Web API → Students: routes requests (evidence: `MOS.ExcelGrading.API/Program.cs`)
- Web API → Exam sessions: routes requests (evidence: `MOS.ExcelGrading.API/Program.cs`)
- Exam sessions → Exam publications: loads publication
- Web API → Scheduling: routes requests
- Scheduling → Attendance sync: invokes sync (evidence: `MOS.ExcelGrading.API/Controllers/ScheduleController.cs`)
- Attendance sync → Google Sheets: syncs attendance
- Web API → MongoDB: configures database (evidence: `MOS.ExcelGrading.API/Program.cs`)
- Web API → Redis cache: configures cache (evidence: `MOS.ExcelGrading.API/Program.cs`)
- Assignments → GridFS assets: uses file service (evidence: `MOS.ExcelGrading.API/Controllers/AssignmentController.cs`)
