# leonarriagada/nortematriculas architecture

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

- Interactive diagram: https://gitdiagram.com/leonarriagada/nortematriculas
- Repository: https://github.com/leonarriagada/nortematriculas

## Overview

This is a PHP web application for managing student enrollment in courses, academic records, grades, and certificates. The apparent workflow is staff authentication, student/course enrollment, grade maintenance, then certificate lookup, generation, download, or email delivery. The tree also exposes course administration, student search, and CSV reporting. The database connection and certificate-generation logic are visible in sampled source; most page handlers are unsampled, so their detailed calls and data flow are not asserted here.

Main entry points: [`index.php`](https://github.com/leonarriagada/nortematriculas/blob/main/index.php) (Session routing), [`includes/functions.php`](https://github.com/leonarriagada/nortematriculas/blob/main/includes/functions.php) (Domain utilities), [`config/db.php`](https://github.com/leonarriagada/nortematriculas/blob/main/config/db.php) (PDO connection), [`includes/ms_graph_helper.php`](https://github.com/leonarriagada/nortematriculas/blob/main/includes/ms_graph_helper.php) (Graph mail helper)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_access["Access"]
  node_login["Sign in<br/>[login.php]"]
  node_entry["Session routing<br/>[index.php]"]
  node_dashboard["Dashboard<br/>[dashboard.php]"]
  node_auth["Auth checks<br/>[auth.php]"]
end

subgraph group_academic["Academic administration"]
  node_enrollment["Student enrollment"]
  node_student["Student records"]
  node_courses["Course management<br/>[crear_curso.php]"]
  node_course_review["Course review<br/>[revisar_cursos.php]"]
  node_grades["Grade management<br/>[notas.php]"]
  node_grade_update["Grade updates<br/>[update_notas.php]"]
end

subgraph group_credentials["Certificates and reports"]
  node_certificate_search["Certificate lookup"]
  node_certificate["Certificate output<br/>[certificado.php]"]
  node_email_certificate["Certificate email"]
  node_bulk_email["Bulk certificate email"]
  node_csv["CSV export<br/>[download_csv.php]"]
end

subgraph group_shared["Shared services"]
  node_domain_logic["Domain utilities<br/>[functions.php]"]
  node_db_config["PDO connection<br/>[db.php]"]
  node_database[("Application database")]
  node_graph_helper["Graph mail helper"]
end

node_staff(("Staff user"))
node_microsoft_graph{{"Microsoft Graph"}}

node_staff -->|"opens app"| node_entry
node_entry -->|"validates token"| node_auth
node_entry -->|"redirects"| node_dashboard
node_entry -->|"redirects"| node_login
node_staff -->|"manages enrollment"| node_enrollment
node_staff -->|"searches records"| node_student
node_staff -->|"manages courses"| node_courses
node_staff -->|"reviews courses"| node_course_review
node_staff -->|"manages grades"| node_grades
node_staff -->|"looks up certificates"| node_certificate_search
node_staff -->|"requests certificate"| node_certificate
node_staff -->|"sends certificate"| node_email_certificate
node_staff -->|"sends certificates"| node_bulk_email
node_staff -->|"exports data"| node_csv
node_domain_logic -->|"queries and updates"| node_database
node_db_config -->|"connects"| node_database
node_graph_helper -->|"sends mail"| node_microsoft_graph

click node_login "https://github.com/leonarriagada/nortematriculas/blob/main/login.php"
click node_entry "https://github.com/leonarriagada/nortematriculas/blob/main/index.php"
click node_dashboard "https://github.com/leonarriagada/nortematriculas/blob/main/dashboard.php"
click node_auth "https://github.com/leonarriagada/nortematriculas/blob/main/includes/auth.php"
click node_enrollment "https://github.com/leonarriagada/nortematriculas/blob/main/matricular_estudiante.php"
click node_student "https://github.com/leonarriagada/nortematriculas/blob/main/buscar_registros.php"
click node_courses "https://github.com/leonarriagada/nortematriculas/blob/main/crear_curso.php"
click node_course_review "https://github.com/leonarriagada/nortematriculas/blob/main/revisar_cursos.php"
click node_grades "https://github.com/leonarriagada/nortematriculas/blob/main/notas.php"
click node_grade_update "https://github.com/leonarriagada/nortematriculas/blob/main/update_notas.php"
click node_certificate_search "https://github.com/leonarriagada/nortematriculas/blob/main/buscar_certificado.php"
click node_certificate "https://github.com/leonarriagada/nortematriculas/blob/main/certificado.php"
click node_email_certificate "https://github.com/leonarriagada/nortematriculas/blob/main/enviar_certificado_email.php"
click node_bulk_email "https://github.com/leonarriagada/nortematriculas/blob/main/enviar_certificados_masivo.php"
click node_csv "https://github.com/leonarriagada/nortematriculas/blob/main/download_csv.php"
click node_domain_logic "https://github.com/leonarriagada/nortematriculas/blob/main/includes/functions.php"
click node_db_config "https://github.com/leonarriagada/nortematriculas/blob/main/config/db.php"
click node_graph_helper "https://github.com/leonarriagada/nortematriculas/blob/main/includes/ms_graph_helper.php"

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_login,node_entry,node_dashboard,node_auth,node_staff toneBlue
class node_enrollment,node_student,node_courses,node_course_review,node_grades,node_grade_update toneAmber
class node_certificate_search,node_certificate,node_email_certificate,node_bulk_email,node_csv toneMint
class node_domain_logic,node_db_config,node_database,node_graph_helper toneRose
class node_microsoft_graph toneIndigo
```

## Components

### Access

- [Sign in](https://github.com/leonarriagada/nortematriculas/blob/main/login.php): `login.php`
- [Session routing](https://github.com/leonarriagada/nortematriculas/blob/main/index.php): `index.php`
- [Dashboard](https://github.com/leonarriagada/nortematriculas/blob/main/dashboard.php): `dashboard.php`
- [Auth checks](https://github.com/leonarriagada/nortematriculas/blob/main/includes/auth.php): `includes/auth.php`

### Academic administration

- [Student enrollment](https://github.com/leonarriagada/nortematriculas/blob/main/matricular_estudiante.php): `matricular_estudiante.php`
- [Student records](https://github.com/leonarriagada/nortematriculas/blob/main/buscar_registros.php): `buscar_registros.php`
- [Course management](https://github.com/leonarriagada/nortematriculas/blob/main/crear_curso.php): `crear_curso.php`
- [Course review](https://github.com/leonarriagada/nortematriculas/blob/main/revisar_cursos.php): `revisar_cursos.php`
- [Grade management](https://github.com/leonarriagada/nortematriculas/blob/main/notas.php): `notas.php`
- [Grade updates](https://github.com/leonarriagada/nortematriculas/blob/main/update_notas.php): `update_notas.php`

### Certificates and reports

- [Certificate lookup](https://github.com/leonarriagada/nortematriculas/blob/main/buscar_certificado.php): `buscar_certificado.php`
- [Certificate output](https://github.com/leonarriagada/nortematriculas/blob/main/certificado.php): `certificado.php`
- [Certificate email](https://github.com/leonarriagada/nortematriculas/blob/main/enviar_certificado_email.php): `enviar_certificado_email.php`
- [Bulk certificate email](https://github.com/leonarriagada/nortematriculas/blob/main/enviar_certificados_masivo.php): `enviar_certificados_masivo.php`
- [CSV export](https://github.com/leonarriagada/nortematriculas/blob/main/download_csv.php): `download_csv.php`

### Shared services

- [Domain utilities](https://github.com/leonarriagada/nortematriculas/blob/main/includes/functions.php): `includes/functions.php`
- [PDO connection](https://github.com/leonarriagada/nortematriculas/blob/main/config/db.php): `config/db.php`
- **Application database**
- [Graph mail helper](https://github.com/leonarriagada/nortematriculas/blob/main/includes/ms_graph_helper.php): `includes/ms_graph_helper.php`

### Other components

- **Staff user**
- **Microsoft Graph**

## Connections

- Staff user → Session routing: opens app
- Session routing → Auth checks: validates token
- Session routing → Dashboard: redirects
- Session routing → Sign in: redirects
- Staff user → Student enrollment: manages enrollment
- Staff user → Student records: searches records
- Staff user → Course management: manages courses
- Staff user → Course review: reviews courses
- Staff user → Grade management: manages grades
- Staff user → Certificate lookup: looks up certificates
- Staff user → Certificate output: requests certificate
- Staff user → Certificate email: sends certificate
- Staff user → Bulk certificate email: sends certificates
- Staff user → CSV export: exports data
- Domain utilities → Application database: queries and updates
- PDO connection → Application database: connects
- Graph mail helper → Microsoft Graph: sends mail
