# erlnievera/erllorencenievera_websystemfinalproject architecture

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

- Interactive diagram: https://gitdiagram.com/erlnievera/erllorencenievera_websystemfinalproject
- Repository: https://github.com/erlnievera/erllorencenievera_websystemfinalproject

## Overview

This is a faculty-and-student grade management system: users sign in through the MVC portal, which obtains API tokens server-side; faculty manage grades and students view their own profile and records. The API provides role-protected authentication and grade endpoints, backed by SQL Server. The repository also contains an application service/repository abstraction for grades, although the sampled API grade controller accesses its database context directly. MVC grade-request details and views were not sampled, so those links rely on README documentation.

Main entry points: [`StudentGradeManagement.Api/Controllers/AuthController.cs`](https://github.com/erlnievera/erllorencenievera_websystemfinalproject/blob/master/StudentGradeManagement.Api/Controllers/AuthController.cs) (Login endpoint), [`StudentGradeManagement.Api/Controllers/GradesController.cs`](https://github.com/erlnievera/erllorencenievera_websystemfinalproject/blob/master/StudentGradeManagement.Api/Controllers/GradesController.cs) (Grade endpoints), [`StudentGradeManagement.Infrastructure/Persistence/AcademicDbContext.cs`](https://github.com/erlnievera/erllorencenievera_websystemfinalproject/blob/master/StudentGradeManagement.Infrastructure/Persistence/AcademicDbContext.cs) (Academic context), [`StudentGradeManagement.Mvc/Controllers/AuthController.cs`](https://github.com/erlnievera/erllorencenievera_websystemfinalproject/blob/master/StudentGradeManagement.Mvc/Controllers/AuthController.cs) (MVC sign-in)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_mvc["MVC Portals"]
  node_mvc_auth["MVC sign-in<br/>[AuthController.cs]"]
  node_mvc_auth_client["API auth client<br/>[ApiAuthService.cs]"]
  node_faculty_grades["Faculty grade portal"]
  node_student_dashboard["Student dashboard"]
  node_grade_fetch["Grade fetch UI<br/>[site.js]"]
end

subgraph group_api["API and Identity"]
  node_api_auth["Login endpoint<br/>[AuthController.cs]"]
  node_api_grades["Grade endpoints"]
  node_jwt["JWT issuer<br/>[JwtTokenService.cs]"]
  node_identity_db[("Identity context")]
end

subgraph group_application["Grade Application"]
  node_grade_service["Grade service<br/>[GradeService.cs]"]
  node_grade_repository["Grade repository<br/>[GradeRepository.cs]"]
  node_remarks["Remarks calculator"]
end

subgraph group_data["Domain and Persistence"]
  node_grade_records["Academic records<br/>[StudentGrade.cs]"]
  node_student_faculty["Student and faculty<br/>[Student.cs]"]
  node_academic_db[("Academic context")]
end

node_faculty(("Faculty user"))
node_student(("Student user"))
node_sql_server[("SQL Server")]

node_faculty -->|"signs in"| node_mvc_auth
node_student -->|"signs in"| node_mvc_auth
node_mvc_auth -->|"requests login"| node_mvc_auth_client
node_mvc_auth_client -->|"posts credentials"| node_api_auth
node_api_auth -->|"issues token"| node_jwt
node_api_auth -->|"checks account"| node_identity_db
node_api_auth -->|"checks role mapping"| node_academic_db
node_faculty -->|"manages grades"| node_faculty_grades
node_student -->|"views records"| node_student_dashboard
node_student_dashboard -->|"loads grades"| node_grade_fetch
node_faculty_grades -->|"calls API"| node_api_grades
node_grade_fetch -->|"fetches grades"| node_api_grades
node_api_grades -->|"reads and writes"| node_academic_db
node_api_grades -->|"calculates remarks"| node_remarks
node_grade_service -->|"uses repository"| node_grade_repository
node_grade_service -->|"calculates remarks"| node_remarks
node_grade_repository -->|"queries and saves"| node_academic_db
node_academic_db -->|"uses SQL Server"| node_sql_server
node_identity_db -->|"uses SQL Server"| node_sql_server

click node_mvc_auth "https://github.com/erlnievera/erllorencenievera_websystemfinalproject/blob/master/StudentGradeManagement.Mvc/Controllers/AuthController.cs"
click node_mvc_auth_client "https://github.com/erlnievera/erllorencenievera_websystemfinalproject/blob/master/StudentGradeManagement.Mvc/Services/ApiAuthService.cs"
click node_faculty_grades "https://github.com/erlnievera/erllorencenievera_websystemfinalproject/blob/master/StudentGradeManagement.Mvc/Controllers/GradesController.cs"
click node_student_dashboard "https://github.com/erlnievera/erllorencenievera_websystemfinalproject/blob/master/StudentGradeManagement.Mvc/Controllers/DashboardController.cs"
click node_grade_fetch "https://github.com/erlnievera/erllorencenievera_websystemfinalproject/blob/master/StudentGradeManagement.Mvc/wwwroot/js/site.js"
click node_api_auth "https://github.com/erlnievera/erllorencenievera_websystemfinalproject/blob/master/StudentGradeManagement.Api/Controllers/AuthController.cs"
click node_api_grades "https://github.com/erlnievera/erllorencenievera_websystemfinalproject/blob/master/StudentGradeManagement.Api/Controllers/GradesController.cs"
click node_jwt "https://github.com/erlnievera/erllorencenievera_websystemfinalproject/blob/master/StudentGradeManagement.Infrastructure/Identity/JwtTokenService.cs"
click node_identity_db "https://github.com/erlnievera/erllorencenievera_websystemfinalproject/blob/master/StudentGradeManagement.Infrastructure/Identity/ApplicationDbContext.cs"
click node_grade_service "https://github.com/erlnievera/erllorencenievera_websystemfinalproject/blob/master/StudentGradeManagement.Application/Services/GradeService.cs"
click node_grade_repository "https://github.com/erlnievera/erllorencenievera_websystemfinalproject/blob/master/StudentGradeManagement.Infrastructure/Repositories/GradeRepository.cs"
click node_remarks "https://github.com/erlnievera/erllorencenievera_websystemfinalproject/blob/master/StudentGradeManagement.Application/Services/GradeRemarksCalculator.cs"
click node_grade_records "https://github.com/erlnievera/erllorencenievera_websystemfinalproject/blob/master/StudentGradeManagement.Domain/Entities/StudentGrade.cs"
click node_student_faculty "https://github.com/erlnievera/erllorencenievera_websystemfinalproject/blob/master/StudentGradeManagement.Domain/Entities/Student.cs"
click node_academic_db "https://github.com/erlnievera/erllorencenievera_websystemfinalproject/blob/master/StudentGradeManagement.Infrastructure/Persistence/AcademicDbContext.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_mvc_auth,node_mvc_auth_client,node_faculty_grades,node_student_dashboard,node_grade_fetch,node_faculty,node_student toneBlue
class node_api_auth,node_api_grades,node_jwt,node_identity_db,node_sql_server toneAmber
class node_grade_service,node_grade_repository,node_remarks toneMint
class node_grade_records,node_student_faculty,node_academic_db toneRose
```

## Components

### MVC Portals

- [MVC sign-in](https://github.com/erlnievera/erllorencenievera_websystemfinalproject/blob/master/StudentGradeManagement.Mvc/Controllers/AuthController.cs): `StudentGradeManagement.Mvc/Controllers/AuthController.cs`
- [API auth client](https://github.com/erlnievera/erllorencenievera_websystemfinalproject/blob/master/StudentGradeManagement.Mvc/Services/ApiAuthService.cs): `StudentGradeManagement.Mvc/Services/ApiAuthService.cs`
- [Faculty grade portal](https://github.com/erlnievera/erllorencenievera_websystemfinalproject/blob/master/StudentGradeManagement.Mvc/Controllers/GradesController.cs): `StudentGradeManagement.Mvc/Controllers/GradesController.cs`
- [Student dashboard](https://github.com/erlnievera/erllorencenievera_websystemfinalproject/blob/master/StudentGradeManagement.Mvc/Controllers/DashboardController.cs): `StudentGradeManagement.Mvc/Controllers/DashboardController.cs`
- [Grade fetch UI](https://github.com/erlnievera/erllorencenievera_websystemfinalproject/blob/master/StudentGradeManagement.Mvc/wwwroot/js/site.js): `StudentGradeManagement.Mvc/wwwroot/js/site.js`

### API and Identity

- [Login endpoint](https://github.com/erlnievera/erllorencenievera_websystemfinalproject/blob/master/StudentGradeManagement.Api/Controllers/AuthController.cs): `StudentGradeManagement.Api/Controllers/AuthController.cs`
- [Grade endpoints](https://github.com/erlnievera/erllorencenievera_websystemfinalproject/blob/master/StudentGradeManagement.Api/Controllers/GradesController.cs): `StudentGradeManagement.Api/Controllers/GradesController.cs`
- [JWT issuer](https://github.com/erlnievera/erllorencenievera_websystemfinalproject/blob/master/StudentGradeManagement.Infrastructure/Identity/JwtTokenService.cs): `StudentGradeManagement.Infrastructure/Identity/JwtTokenService.cs`
- [Identity context](https://github.com/erlnievera/erllorencenievera_websystemfinalproject/blob/master/StudentGradeManagement.Infrastructure/Identity/ApplicationDbContext.cs): `StudentGradeManagement.Infrastructure/Identity/ApplicationDbContext.cs`

### Grade Application

- [Grade service](https://github.com/erlnievera/erllorencenievera_websystemfinalproject/blob/master/StudentGradeManagement.Application/Services/GradeService.cs): `StudentGradeManagement.Application/Services/GradeService.cs`
- [Grade repository](https://github.com/erlnievera/erllorencenievera_websystemfinalproject/blob/master/StudentGradeManagement.Infrastructure/Repositories/GradeRepository.cs): `StudentGradeManagement.Infrastructure/Repositories/GradeRepository.cs`
- [Remarks calculator](https://github.com/erlnievera/erllorencenievera_websystemfinalproject/blob/master/StudentGradeManagement.Application/Services/GradeRemarksCalculator.cs): `StudentGradeManagement.Application/Services/GradeRemarksCalculator.cs`

### Domain and Persistence

- [Academic records](https://github.com/erlnievera/erllorencenievera_websystemfinalproject/blob/master/StudentGradeManagement.Domain/Entities/StudentGrade.cs): `StudentGradeManagement.Domain/Entities/StudentGrade.cs`
- [Student and faculty](https://github.com/erlnievera/erllorencenievera_websystemfinalproject/blob/master/StudentGradeManagement.Domain/Entities/Student.cs): `StudentGradeManagement.Domain/Entities/Student.cs`
- [Academic context](https://github.com/erlnievera/erllorencenievera_websystemfinalproject/blob/master/StudentGradeManagement.Infrastructure/Persistence/AcademicDbContext.cs): `StudentGradeManagement.Infrastructure/Persistence/AcademicDbContext.cs`

### Other components

- **Faculty user**
- **Student user**
- **SQL Server**

## Connections

- Faculty user → MVC sign-in: signs in (evidence: `README.md`)
- Student user → MVC sign-in: signs in (evidence: `README.md`)
- MVC sign-in → API auth client: requests login (evidence: `StudentGradeManagement.Mvc/Controllers/AuthController.cs`)
- API auth client → Login endpoint: posts credentials (evidence: `StudentGradeManagement.Mvc/Services/ApiAuthService.cs`)
- Login endpoint → JWT issuer: issues token (evidence: `StudentGradeManagement.Api/Controllers/AuthController.cs`)
- Login endpoint → Identity context: checks account (evidence: `StudentGradeManagement.Api/Controllers/AuthController.cs`)
- Login endpoint → Academic context: checks role mapping (evidence: `StudentGradeManagement.Api/Controllers/AuthController.cs`)
- Faculty user → Faculty grade portal: manages grades (evidence: `README.md`)
- Student user → Student dashboard: views records (evidence: `README.md`)
- Student dashboard → Grade fetch UI: loads grades (evidence: `README.md`)
- Faculty grade portal → Grade endpoints: calls API (evidence: `README.md`)
- Grade fetch UI → Grade endpoints: fetches grades (evidence: `README.md`)
- Grade endpoints → Academic context: reads and writes (evidence: `StudentGradeManagement.Api/Controllers/GradesController.cs`)
- Grade endpoints → Remarks calculator: calculates remarks (evidence: `StudentGradeManagement.Api/Controllers/GradesController.cs`)
- Grade service → Grade repository: uses repository (evidence: `StudentGradeManagement.Application/Services/GradeService.cs`)
- Grade service → Remarks calculator: calculates remarks (evidence: `StudentGradeManagement.Application/Services/GradeService.cs`)
- Grade repository → Academic context: queries and saves (evidence: `StudentGradeManagement.Infrastructure/Repositories/GradeRepository.cs`)
- Academic context → SQL Server: uses SQL Server
- Identity context → SQL Server: uses SQL Server
