# wyat2/teacherapp architecture

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

- Interactive diagram: https://gitdiagram.com/wyat2/teacherapp
- Repository: https://github.com/wyat2/teacherapp

## Overview

TeacherApp is an ASP.NET Core MVC student and user management system for TRIO programs. Staff enter through the web application, authenticate or complete first-run setup, then manage student records and related academic/contact information; reporting and CSV export provide outputs, while audit logging records changes. Separate interfaces cover administration, directors, tutors, and permissions. The README documents role-based access, search/filtering, compliance, and cloud-backed PostgreSQL. Some controller and service implementations were not sampled, so their links are included only where the index or README supports them.

Main entry points: [`Data/ApplicationDbContext.cs`](https://github.com/wyat2/teacherapp/blob/main/Data/ApplicationDbContext.cs) (Application database), [`Controllers/StudentsController.cs`](https://github.com/wyat2/teacherapp/blob/main/Controllers/StudentsController.cs) (Student management), [`Program.cs`](https://github.com/wyat2/teacherapp/blob/main/Program.cs) (MVC application), [`Controllers/AccountController.cs`](https://github.com/wyat2/teacherapp/blob/main/Controllers/AccountController.cs) (Account access)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Web entry and identity"]
  node_web["MVC application<br/>[Program.cs]"]
  node_account["Account access"]
  node_setup["First-run setup"]
end

subgraph group_operations["Program operations"]
  node_admin["Admin management"]
  node_directors["Director dashboard"]
  node_tutors["Tutor management"]
  node_permissions["Role permissions"]
  node_reports["Reports and export"]
end

subgraph group_records["Student records"]
  node_students["Student management"]
  node_student_model["Student profile<br/>[Student.cs]"]
  node_class_model["Class records<br/>[StudentClass.cs]"]
  node_contact_model["Contact records<br/>[Contact.cs]"]
  node_homework_model["Homework records<br/>[Homework.cs]"]
  node_director_model["Grant and school info"]
  node_identity_model["User identity<br/>[ApplicationUser.cs]"]
  node_permission_model["Permission rules<br/>[RolePermission.cs]"]
  node_dropdown_model["Dropdown options<br/>[DropdownValue.cs]"]
  node_audit_model["Audit entries<br/>[AuditLog.cs]"]
end

subgraph group_platform["Persistence and services"]
  node_database[("Application database")]
  node_audit["Audit logging<br/>[AuditLogService.cs]"]
  node_email["Email delivery<br/>[EmailService.cs]"]
  node_image["Image handling<br/>[ImageHelper.cs]"]
end

node_staff(("Staff user"))

node_staff -->|"uses"| node_web
node_web -->|"routes requests"| node_account
node_web -->|"checks first run"| node_setup
node_account -->|"reads and writes"| node_database
node_account -->|"requests email"| node_email
node_setup -->|"initializes records"| node_database
node_admin -->|"manages users"| node_database
node_directors -->|"manages director info"| node_database
node_tutors -->|"manages tutors"| node_database
node_permissions -->|"stores permissions"| node_database
node_reports -->|"queries student data"| node_database
node_students -->|"manages records"| node_database
node_students -->|"logs changes"| node_audit
node_students -->|"handles images"| node_image
node_database -->|"maps"| node_student_model
node_database -->|"maps"| node_class_model
node_database -->|"maps"| node_contact_model
node_database -->|"maps"| node_homework_model
node_database -->|"maps"| node_director_model
node_database -->|"maps"| node_identity_model
node_database -->|"maps"| node_permission_model
node_database -->|"maps"| node_dropdown_model
node_database -->|"maps"| node_audit_model
node_audit -->|"persists events"| node_database

click node_web "https://github.com/wyat2/teacherapp/blob/main/Program.cs"
click node_account "https://github.com/wyat2/teacherapp/blob/main/Controllers/AccountController.cs"
click node_setup "https://github.com/wyat2/teacherapp/blob/main/Services/SetupWizardService.cs"
click node_admin "https://github.com/wyat2/teacherapp/blob/main/Controllers/AdminsController.cs"
click node_directors "https://github.com/wyat2/teacherapp/blob/main/Controllers/DirectorsController.cs"
click node_tutors "https://github.com/wyat2/teacherapp/blob/main/Controllers/TutorsController.cs"
click node_permissions "https://github.com/wyat2/teacherapp/blob/main/Controllers/PermissionsController.cs"
click node_reports "https://github.com/wyat2/teacherapp/blob/main/Controllers/ReportsController.cs"
click node_students "https://github.com/wyat2/teacherapp/blob/main/Controllers/StudentsController.cs"
click node_student_model "https://github.com/wyat2/teacherapp/blob/main/Models/Student.cs"
click node_class_model "https://github.com/wyat2/teacherapp/blob/main/Models/StudentClass.cs"
click node_contact_model "https://github.com/wyat2/teacherapp/blob/main/Models/Contact.cs"
click node_homework_model "https://github.com/wyat2/teacherapp/blob/main/Models/Homework.cs"
click node_director_model "https://github.com/wyat2/teacherapp/blob/main/Models/DirectorsPageInfo.cs"
click node_identity_model "https://github.com/wyat2/teacherapp/blob/main/Models/ApplicationUser.cs"
click node_permission_model "https://github.com/wyat2/teacherapp/blob/main/Models/RolePermission.cs"
click node_dropdown_model "https://github.com/wyat2/teacherapp/blob/main/Models/DropdownValue.cs"
click node_database "https://github.com/wyat2/teacherapp/blob/main/Data/ApplicationDbContext.cs"
click node_audit "https://github.com/wyat2/teacherapp/blob/main/Services/AuditLogService.cs"
click node_email "https://github.com/wyat2/teacherapp/blob/main/Services/EmailService.cs"
click node_image "https://github.com/wyat2/teacherapp/blob/main/Services/ImageHelper.cs"
click node_audit_model "https://github.com/wyat2/teacherapp/blob/main/Models/AuditLog.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_web,node_account,node_setup,node_staff toneBlue
class node_admin,node_directors,node_tutors,node_permissions,node_reports toneAmber
class node_students,node_student_model,node_class_model,node_contact_model,node_homework_model,node_director_model,node_identity_model,node_permission_model,node_dropdown_model,node_audit_model toneMint
class node_database,node_audit,node_email,node_image toneRose
```

## Components

### Web entry and identity

- [MVC application](https://github.com/wyat2/teacherapp/blob/main/Program.cs): `Program.cs`
- [Account access](https://github.com/wyat2/teacherapp/blob/main/Controllers/AccountController.cs): `Controllers/AccountController.cs`
- [First-run setup](https://github.com/wyat2/teacherapp/blob/main/Services/SetupWizardService.cs): `Services/SetupWizardService.cs`

### Program operations

- [Admin management](https://github.com/wyat2/teacherapp/blob/main/Controllers/AdminsController.cs): `Controllers/AdminsController.cs`
- [Director dashboard](https://github.com/wyat2/teacherapp/blob/main/Controllers/DirectorsController.cs): `Controllers/DirectorsController.cs`
- [Tutor management](https://github.com/wyat2/teacherapp/blob/main/Controllers/TutorsController.cs): `Controllers/TutorsController.cs`
- [Role permissions](https://github.com/wyat2/teacherapp/blob/main/Controllers/PermissionsController.cs): `Controllers/PermissionsController.cs`
- [Reports and export](https://github.com/wyat2/teacherapp/blob/main/Controllers/ReportsController.cs): `Controllers/ReportsController.cs`

### Student records

- [Student management](https://github.com/wyat2/teacherapp/blob/main/Controllers/StudentsController.cs): `Controllers/StudentsController.cs`
- [Student profile](https://github.com/wyat2/teacherapp/blob/main/Models/Student.cs): `Models/Student.cs`
- [Class records](https://github.com/wyat2/teacherapp/blob/main/Models/StudentClass.cs): `Models/StudentClass.cs`
- [Contact records](https://github.com/wyat2/teacherapp/blob/main/Models/Contact.cs): `Models/Contact.cs`
- [Homework records](https://github.com/wyat2/teacherapp/blob/main/Models/Homework.cs): `Models/Homework.cs`
- [Grant and school info](https://github.com/wyat2/teacherapp/blob/main/Models/DirectorsPageInfo.cs): `Models/DirectorsPageInfo.cs`
- [User identity](https://github.com/wyat2/teacherapp/blob/main/Models/ApplicationUser.cs): `Models/ApplicationUser.cs`
- [Permission rules](https://github.com/wyat2/teacherapp/blob/main/Models/RolePermission.cs): `Models/RolePermission.cs`
- [Dropdown options](https://github.com/wyat2/teacherapp/blob/main/Models/DropdownValue.cs): `Models/DropdownValue.cs`
- [Audit entries](https://github.com/wyat2/teacherapp/blob/main/Models/AuditLog.cs): `Models/AuditLog.cs`

### Persistence and services

- [Application database](https://github.com/wyat2/teacherapp/blob/main/Data/ApplicationDbContext.cs): `Data/ApplicationDbContext.cs`
- [Audit logging](https://github.com/wyat2/teacherapp/blob/main/Services/AuditLogService.cs): `Services/AuditLogService.cs`
- [Email delivery](https://github.com/wyat2/teacherapp/blob/main/Services/EmailService.cs): `Services/EmailService.cs`
- [Image handling](https://github.com/wyat2/teacherapp/blob/main/Services/ImageHelper.cs): `Services/ImageHelper.cs`

### Other components

- **Staff user**

## Connections

- Staff user → MVC application: uses (evidence: `README.md`)
- MVC application → Account access: routes requests (evidence: `Program.cs`)
- MVC application → First-run setup: checks first run (evidence: `Program.cs`)
- Account access → Application database: reads and writes (evidence: `Controllers/AccountController.cs`)
- Account access → Email delivery: requests email (evidence: `Controllers/AccountController.cs`)
- First-run setup → Application database: initializes records (evidence: `Services/SetupWizardService.cs`)
- Admin management → Application database: manages users (evidence: `Controllers/AdminsController.cs`)
- Director dashboard → Application database: manages director info (evidence: `Controllers/DirectorsController.cs`)
- Tutor management → Application database: manages tutors (evidence: `Controllers/TutorsController.cs`)
- Role permissions → Application database: stores permissions (evidence: `Controllers/PermissionsController.cs`)
- Reports and export → Application database: queries student data (evidence: `Controllers/ReportsController.cs`)
- Student management → Application database: manages records (evidence: `Controllers/StudentsController.cs`)
- Student management → Audit logging: logs changes (evidence: `Controllers/StudentsController.cs`)
- Student management → Image handling: handles images (evidence: `Controllers/StudentsController.cs`)
- Application database → Student profile: maps (evidence: `Data/ApplicationDbContext.cs`)
- Application database → Class records: maps (evidence: `Data/ApplicationDbContext.cs`)
- Application database → Contact records: maps (evidence: `Data/ApplicationDbContext.cs`)
- Application database → Homework records: maps (evidence: `Data/ApplicationDbContext.cs`)
- Application database → Grant and school info: maps (evidence: `Data/ApplicationDbContext.cs`)
- Application database → User identity: maps (evidence: `Data/ApplicationDbContext.cs`)
- Application database → Permission rules: maps (evidence: `Data/ApplicationDbContext.cs`)
- Application database → Dropdown options: maps (evidence: `Data/ApplicationDbContext.cs`)
- Application database → Audit entries: maps (evidence: `Data/ApplicationDbContext.cs`)
- Audit logging → Application database: persists events (evidence: `Services/AuditLogService.cs`)
