# ghost0140/educa architecture

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

- Interactive diagram: https://gitdiagram.com/ghost0140/educa
- Repository: https://github.com/ghost0140/educa

## Overview

1. **Overall architecture**
   - This is a **single ASP.NET MVC 5 monolith** built on **.NET Framework 4.8**.
   - The application is server-rendered: browser requests hit MVC controllers, which return Razor views backed by models and view models.
   - Persistence is handled through **Entity Framework 6** against **SQL Server**.

2. **Functional subsystems**
   - The app is organized around academic administration:
     - **Authentication / access** via `AccountController`
     - **Admin management** via `AdminController`
     - **Teacher-facing workflows** via `DocenteController`
     - **Public/home pages** via `HomeController`
   - The UI and routes reflect these bounded areas, with separate view folders for each feature set.

3. **Presentation layer**
   - Views are in `Views/` and are grouped by controller, with shared layout in `Views/Shared/_Layout.cshtml`.
   - The app uses **Razor views** plus **Bootstrap 5** styling and **jQuery** validation scripts.
   - Important screens include course management, teacher management, attendance registration, login, and reports.

4. **Controller responsibilities**
   - Controllers act as the main orchestration layer:
     - `AccountController` handles login.
     - `AdminController` exposes management UIs for courses and teachers plus reporting.
     - `DocenteController` exposes teacher-specific pages such as assigned courses and attendance entry.
     - `HomeController` serves generic landing and informational pages.
   - The controller/view pairing is tight and conventional for MVC 5.

5. **Domain model**
   - Core business entities live under `Models/`:
     - People and roles: `Usuario`, `AdministradorSistema`, `Docente`, `Estudiante`
     - Academic structure: `Curso`, `Seccion`, `Turno`, `Matricula`
     - Operational records: `AsignacionCurso`, `AsistenciaDocente`, `AsistenciaEstudiante`, `Notas`
   - These objects define the main data boundaries of the system.

6. **View models as UI contracts**
   - `Models/ViewModels/` contains forms and page-specific contracts such as:
     - course create/edit and course info views
     - docente create/edit views
     - attendance and report views
     - assignment and notes forms
   - This indicates a separation between persistent entities and screen-specific data shapes, especially for create/edit/report workflows.

7. **Data access layer**
   - `Models/DB/EduControlDB.cs` is the EF database context, the main gateway to SQL Server.
   - Repositories under `Models/DB/Repositories/` encapsulate data operations for specific areas:
     - `UsuarioRepository`
     - `AsignacionCursoRepository`
     - `AsistenciaDocenteRepository`
   - The repo structure suggests a layered design where controllers call repositories instead of working directly with EF everywhere.

8. **Database boundary**
   - `DB_EDUCA_EFSRT4_FINAL.sql` is the authoritative SQL script for schema creation and initial data.
   - The README says the database name is **`DB_EDUCA`**, so SQL Server is the only external persistence service in the architecture.
   - The application’s connection string is configured in `Web.config`.

9. **Cross-cutting configuration**
   - `App_Start/RouteConfig.cs` defines routing, `BundleConfig.cs` handles asset bundling, and `FilterConfig.cs` registers MVC filters.
   - `filters/NoCacheAttribute.cs` is a cross-cutting concern likely used to prevent sensitive pages from being cached in the browser.
   - `Global.asax` and `Global.asax.cs` are the entry points for application startup.

10. **Static assets and client-side support**
   - The `Content/` and `Scripts/` folders contain the UI dependencies: Bootstrap CSS/JS, jQuery, validation, and site-specific styling.
   - Images are stored under `Content/Images/`, split into course and docente assets.
   - This is a traditional server-side MVC app with light client-side behavior rather than a SPA.

11. **Typical request/data flow**
   - A user opens a route in the browser.
   - MVC routing sends it to the relevant controller action.
   - The action reads or writes data through a repository and the EF context.
   - Data is mapped into a domain model or view model.
   - The controller returns a Razor view, which renders HTML using the shared layout and Bootstrap styles.

12. **Deployment/runtime shape**
   - The project is meant to run in **IIS Express / IIS** from Visual Studio, as described in the README.
   - NuGet packages are restored locally; build outputs are not committed.
   - The repository is therefore a classic Visual Studio web application with source, SQL bootstrap script, and documentation all in one solution.

Main entry points: [`EducaEFRT/Controllers`](https://github.com/ghost0140/educa/tree/main/EducaEFRT/Controllers) (Controllers), [`EducaEFRT/Models`](https://github.com/ghost0140/educa/tree/main/EducaEFRT/Models) (Models), [`EducaEFRT/App_Start`](https://github.com/ghost0140/educa/tree/main/EducaEFRT/App_Start) (App Start), [`EducaEFRT/Views`](https://github.com/ghost0140/educa/tree/main/EducaEFRT/Views) (Views)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_presentation["Presentation"]
  node_controllers["Controllers<br/>mvc layer"]
  node_account_controller["Account<br/>auth controller"]
  node_admin_controller["Admin<br/>[AdminController.cs]"]
  node_docente_controller["Docente<br/>teacher controller"]
  node_home_controller["Home<br/>landing controller<br/>[HomeController.cs]"]
  node_views["Views<br/>razor ui"]
  node_shared_layout["Layout<br/>shared razor<br/>[_Layout.cshtml]"]
  node_admin_views["Admin Views<br/>management screens"]
  node_docente_views["Teacher Views<br/>teacher screens"]
  node_account_views["Login View<br/>auth screen<br/>[Login.cshtml]"]
  node_assets["Assets"]
end

subgraph group_domain["Domain"]
  node_domain_models["Models<br/>domain entities"]
  node_user_models["People<br/>identity/domain<br/>[Usuario.cs]"]
  node_academic_models["Academic<br/>[Curso.cs]"]
  node_ops_models["Records<br/>operational domain<br/>[AsignacionCurso.cs]"]
  node_view_models["ViewModels<br/>ui contracts"]
end

subgraph group_data["Data"]
  node_db_context[("EF Context<br/>entity framework<br/>[EduControlDB.cs]")]
  node_repositories["Repositories<br/>data access"]
  node_sql_script["SQL Script<br/>database bootstrap"]
end

subgraph group_config["Config"]
  node_app_start["App Start<br/>mvc bootstrap"]
  node_global_asax["Global.asax<br/>startup<br/>[Global.asax]"]
  node_no_cache{{"NoCache<br/>mvc filter"}}
end

node_controllers -->|"contains"| node_account_controller
node_controllers -->|"contains"| node_admin_controller
node_controllers -->|"contains"| node_docente_controller
node_controllers -->|"contains"| node_home_controller
node_account_controller -->|"renders"| node_account_views
node_admin_controller -->|"renders"| node_admin_views
node_docente_controller -->|"renders"| node_docente_views
node_home_controller -->|"renders"| node_views
node_views -->|"uses"| node_shared_layout
node_views -->|"uses"| node_assets
node_controllers -->|"binds"| node_view_models
node_view_models -.->|"maps to"| node_domain_models
node_domain_models -->|"includes"| node_user_models
node_domain_models -->|"includes"| node_academic_models
node_domain_models -->|"includes"| node_ops_models
node_controllers -->|"queries"| node_repositories
node_repositories -->|"wraps"| node_db_context
node_db_context -->|"persists to"| node_sql_script
node_app_start -->|"boots via"| node_global_asax
node_app_start -->|"registers"| node_no_cache
node_app_start -->|"routes to"| node_controllers
node_global_asax -->|"initializes"| node_app_start

click node_controllers "https://github.com/ghost0140/educa/tree/main/EducaEFRT/Controllers"
click node_account_controller "https://github.com/ghost0140/educa/blob/main/EducaEFRT/Controllers/AccountController.cs"
click node_admin_controller "https://github.com/ghost0140/educa/blob/main/EducaEFRT/Controllers/AdminController.cs"
click node_docente_controller "https://github.com/ghost0140/educa/blob/main/EducaEFRT/Controllers/DocenteController.cs"
click node_home_controller "https://github.com/ghost0140/educa/blob/main/EducaEFRT/Controllers/HomeController.cs"
click node_views "https://github.com/ghost0140/educa/tree/main/EducaEFRT/Views"
click node_shared_layout "https://github.com/ghost0140/educa/blob/main/EducaEFRT/Views/Shared/_Layout.cshtml"
click node_admin_views "https://github.com/ghost0140/educa/tree/main/EducaEFRT/Views/Admin"
click node_docente_views "https://github.com/ghost0140/educa/tree/main/EducaEFRT/Views/Docente"
click node_account_views "https://github.com/ghost0140/educa/blob/main/EducaEFRT/Views/Account/Login.cshtml"
click node_domain_models "https://github.com/ghost0140/educa/tree/main/EducaEFRT/Models"
click node_user_models "https://github.com/ghost0140/educa/blob/main/EducaEFRT/Models/Usuario.cs"
click node_academic_models "https://github.com/ghost0140/educa/blob/main/EducaEFRT/Models/Curso.cs"
click node_ops_models "https://github.com/ghost0140/educa/blob/main/EducaEFRT/Models/AsignacionCurso.cs"
click node_view_models "https://github.com/ghost0140/educa/tree/main/EducaEFRT/Models/ViewModels"
click node_db_context "https://github.com/ghost0140/educa/blob/main/EducaEFRT/Models/DB/EduControlDB.cs"
click node_repositories "https://github.com/ghost0140/educa/tree/main/EducaEFRT/Models/DB/Repositories"
click node_sql_script "https://github.com/ghost0140/educa/blob/main/DB_EDUCA_EFSRT4_FINAL.sql"
click node_app_start "https://github.com/ghost0140/educa/tree/main/EducaEFRT/App_Start"
click node_global_asax "https://github.com/ghost0140/educa/blob/main/EducaEFRT/Global.asax"
click node_no_cache "https://github.com/ghost0140/educa/blob/main/EducaEFRT/filters/NoCacheAttribute.cs"
click node_assets "https://github.com/ghost0140/educa/tree/main/EducaEFRT/Content"

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_controllers,node_account_controller,node_admin_controller,node_docente_controller,node_home_controller,node_views,node_shared_layout,node_admin_views,node_docente_views,node_account_views,node_assets toneBlue
class node_domain_models,node_user_models,node_academic_models,node_ops_models,node_view_models toneAmber
class node_db_context,node_repositories,node_sql_script toneMint
class node_app_start,node_global_asax,node_no_cache toneRose
```

## Components

### Presentation

MVC controllers, Razor views, and static UI assets

- [Controllers](https://github.com/ghost0140/educa/tree/main/EducaEFRT/Controllers): mvc layer · Main request orchestration for login, admin, teacher, and home flows · `EducaEFRT/Controllers`
- [Account](https://github.com/ghost0140/educa/blob/main/EducaEFRT/Controllers/AccountController.cs): auth controller · Handles login and authentication UI · `EducaEFRT/Controllers/AccountController.cs`
- [Admin](https://github.com/ghost0140/educa/blob/main/EducaEFRT/Controllers/AdminController.cs): admin controller · Manages courses, teachers, and reports · `EducaEFRT/Controllers/AdminController.cs`
- [Docente](https://github.com/ghost0140/educa/blob/main/EducaEFRT/Controllers/DocenteController.cs): teacher controller · Teacher-facing workflows for assigned courses and attendance · `EducaEFRT/Controllers/DocenteController.cs`
- [Home](https://github.com/ghost0140/educa/blob/main/EducaEFRT/Controllers/HomeController.cs): landing controller · Public pages and site landing routes · `EducaEFRT/Controllers/HomeController.cs`
- [Views](https://github.com/ghost0140/educa/tree/main/EducaEFRT/Views): razor ui · Server-rendered Razor pages grouped by controller · `EducaEFRT/Views`
- [Layout](https://github.com/ghost0140/educa/blob/main/EducaEFRT/Views/Shared/_Layout.cshtml): shared razor · Common page shell and site chrome · `EducaEFRT/Views/Shared/_Layout.cshtml`
- [Admin Views](https://github.com/ghost0140/educa/tree/main/EducaEFRT/Views/Admin): management screens · Course, teacher, and reporting screens · `EducaEFRT/Views/Admin`
- [Teacher Views](https://github.com/ghost0140/educa/tree/main/EducaEFRT/Views/Docente): teacher screens · Assigned courses and attendance entry pages · `EducaEFRT/Views/Docente`
- [Login View](https://github.com/ghost0140/educa/blob/main/EducaEFRT/Views/Account/Login.cshtml): auth screen · Login form and access entry page · `EducaEFRT/Views/Account/Login.cshtml`
- [Assets](https://github.com/ghost0140/educa/tree/main/EducaEFRT/Content): static ui assets · Bootstrap, jQuery, site styles, and images · `EducaEFRT/Content`

### Domain

Core academic entities and view models

- [Models](https://github.com/ghost0140/educa/tree/main/EducaEFRT/Models): domain entities · Academic people, structure, and operational records · `EducaEFRT/Models`
- [People](https://github.com/ghost0140/educa/blob/main/EducaEFRT/Models/Usuario.cs): identity/domain · Usuario, AdministradorSistema, Docente, Estudiante · `EducaEFRT/Models/Usuario.cs`
- [Academic](https://github.com/ghost0140/educa/blob/main/EducaEFRT/Models/Curso.cs): academic domain · Curso, Seccion, Turno, Matricula · `EducaEFRT/Models/Curso.cs`
- [Records](https://github.com/ghost0140/educa/blob/main/EducaEFRT/Models/AsignacionCurso.cs): operational domain · AsignacionCurso, AsistenciaDocente, AsistenciaEstudiante, Notas · `EducaEFRT/Models/AsignacionCurso.cs`
- [ViewModels](https://github.com/ghost0140/educa/tree/main/EducaEFRT/Models/ViewModels): ui contracts · Screen-specific forms and report contracts · `EducaEFRT/Models/ViewModels`

### Data

EF context, repositories, and SQL boundary

- [EF Context](https://github.com/ghost0140/educa/blob/main/EducaEFRT/Models/DB/EduControlDB.cs): entity framework · Main gateway to SQL Server persistence · `EducaEFRT/Models/DB/EduControlDB.cs`
- [Repositories](https://github.com/ghost0140/educa/tree/main/EducaEFRT/Models/DB/Repositories): data access · Persistence abstractions for users, assignments, and attendance · `EducaEFRT/Models/DB/Repositories`
- [SQL Script](https://github.com/ghost0140/educa/blob/main/DB_EDUCA_EFSRT4_FINAL.sql): database bootstrap · Schema and seed data for DB_EDUCA · `DB_EDUCA_EFSRT4_FINAL.sql`

### Config

Application startup and cross-cutting MVC configuration

- [App Start](https://github.com/ghost0140/educa/tree/main/EducaEFRT/App_Start): mvc bootstrap · Routing, bundling, and filters registration · `EducaEFRT/App_Start`
- [Global.asax](https://github.com/ghost0140/educa/blob/main/EducaEFRT/Global.asax): startup · Application entry point and startup hook · `EducaEFRT/Global.asax`
- [NoCache](https://github.com/ghost0140/educa/blob/main/EducaEFRT/filters/NoCacheAttribute.cs): mvc filter · Cross-cutting no-cache behavior for sensitive pages · `EducaEFRT/filters/NoCacheAttribute.cs`

## Connections

- Controllers → Account: contains · MVC controller boundary
- Controllers → Admin: contains · MVC controller boundary
- Controllers → Docente: contains · MVC controller boundary
- Controllers → Home: contains · MVC controller boundary
- Account → Login View: renders · Login screen
- Admin → Admin Views: renders · Admin management screens
- Docente → Teacher Views: renders · Teacher workflow screens
- Home → Views: renders · Public Razor pages
- Views → Layout: uses · Common layout shell
- Views → Assets: uses · Bootstrap, jQuery, and site CSS
- Controllers → ViewModels: binds · Controller actions exchange screen contracts
- ViewModels → Models: maps to · Forms and reports are shaped from domain data
- Models → People: includes · Identity and role entities
- Models → Academic: includes · Academic structure entities
- Models → Records: includes · Attendance, assignment, and grades
- Controllers → Repositories: queries · Controllers use repositories for persistence
- Repositories → EF Context: wraps · Repository operations run through EF context
- EF Context → SQL Script: persists to · SQL Server schema and seed source
- App Start → Global.asax: boots via · Application startup wiring
- App Start → NoCache: registers · MVC cross-cutting filter setup
- App Start → Controllers: routes to · Route configuration directs requests to controllers
- Global.asax → App Start: initializes · Startup pipeline
