# urian121/sistema-gestion-escolar-php-mysql-desde-cero architecture

> Architecture diagram of the GitHub repository urian121/sistema-gestion-escolar-php-mysql-desde-cero, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-07-13). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/urian121/sistema-gestion-escolar-php-mysql-desde-cero
- Repository: https://github.com/urian121/sistema-gestion-escolar-php-mysql-desde-cero

## Overview

#### Purpose and Entry Points
A PHP/MySQL school-management application for administering students, teachers, subjects, grades, and teacher-subject assignments. The browser entry point is `index.php`; feature pages are organized under `home/`. Database schema is supplied in `settings/bd/bd_sistema_gestion_escolar.sql`.

#### Request and Page Composition
Pages use shared PHP layout fragments for document head, navigation, sidebar, loading UI, and footer. This establishes a server-rendered page shell around each module page.
- `components/head.php`
- `components/header.php`
- `components/sidebar.php`
- `components/components.php`

#### Database and Configuration Boundary
Database connectivity and application-level connection settings are isolated under `settings/`. Controllers should be the boundary between page handlers and MySQL persistence, with the SQL schema defining core academic entities and relationships.
- `settings/config.php`
- `settings/settingBD.php`
- `settings/bd/bd_sistema_gestion_escolar.sql`

#### Domain Controllers
The controller layer separates operations by school domain: students, teachers, grades, subjects, plus shared/global behavior. These controllers are the primary backend control-flow layer invoked by module pages.
- `controllers/ControllerEstudiantes.php`
- `controllers/ControllerProfesores.php`
- `controllers/ControllerGrados.php`
- `controllers/ControllerMaterias.php`
- `controllers/ControllerGlobal.php`

#### Academic Administration Modules
Feature pages provide the user-facing administration flows. Student, grade, and subject modules expose their own index/listing views, while teacher management includes creation, detail, and assignment workflows.
- `home/estudiantes/index.php`
- `home/estudiantes/add.php`
- `home/grados/index.php`
- `home/materias/index.php`
- `home/profesores/index.php`
- `home/profesores/add_profe.php`
- `home/profesores/detalles.php`

#### Teacher–Subject Assignment Flow
Teacher assignment is a distinct multi-step flow: the assignment page presents the interaction, a server endpoint retrieves a teacher’s current subjects, and a receiver endpoint persists submitted assignment changes. Client-side JavaScript supports this interaction.
- `home/profesores/asignacion.php`
- `home/profesores/get_materias_profesor.php`
- `home/profesores/recibe_asignacion.php`
- `assets/js/asignacion_curso_materias_profe.js`

#### Front-End Runtime and Assets
The UI is server-rendered PHP enhanced with bundled browser libraries and custom scripts/styles. Bootstrap-derived vendor assets, jQuery/vendor bundles, icon fonts, dashboard behavior, and local avatars/images are served directly from the repository; no separate frontend build runtime is evident.
- `assets/vendors/js/vendor.bundle.base.js`
- `assets/js/dashboard.js`
- `assets/css/style.css`
- `assets/avatar_estudiantes`
- `assets/avatar_profesores`

Main entry points: [`components/head.php`](https://github.com/urian121/sistema-gestion-escolar-php-mysql-desde-cero/blob/master/components/head.php) (Shared page shell), [`settings/settingBD.php`](https://github.com/urian121/sistema-gestion-escolar-php-mysql-desde-cero/blob/master/settings/settingBD.php) (Database settings), [`controllers/ControllerProfesores.php`](https://github.com/urian121/sistema-gestion-escolar-php-mysql-desde-cero/blob/master/controllers/ControllerProfesores.php) (Teacher controller), [`assets/js/asignacion_curso_materias_profe.js`](https://github.com/urian121/sistema-gestion-escolar-php-mysql-desde-cero/blob/master/assets/js/asignacion_curso_materias_profe.js) (Assignment client logic)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["Server-rendered UI"]
  node_entry["Application entry<br/>PHP entry point<br/>[index.php]"]
  node_shell["Shared page shell<br/>PHP layout fragments<br/>[head.php]"]
  node_student_pages["Student administration<br/>module pages<br/>[index.php]"]
  node_student_add["Student creation<br/>module page<br/>[add.php]"]
  node_grade_pages["Grade administration<br/>module page<br/>[index.php]"]
  node_subject_pages["Subject administration<br/>module page<br/>[index.php]"]
  node_teacher_pages["Teacher management<br/>module pages<br/>[index.php]"]
  node_assignment_page["Teacher assignment<br/>interactive PHP page<br/>[asignacion.php]"]
  node_assignment_js["Assignment client logic<br/>browser JavaScript"]
  node_ui_assets["UI assets<br/>served static assets"]
end

subgraph group_controllers["Domain controllers"]
  node_student_controller["Student controller<br/>PHP controller"]
  node_teacher_controller["Teacher controller<br/>PHP controller"]
  node_grade_controller["Grade controller<br/>PHP controller"]
  node_subject_controller["Subject controller<br/>PHP controller"]
  node_global_controller["Global controller<br/>shared PHP controller"]
  node_assignment_lookup["Assigned-subject lookup<br/>PHP endpoint"]
  node_assignment_receiver["Assignment receiver<br/>PHP endpoint"]
end

subgraph group_data["Persistence"]
  node_db_settings["Database settings<br/>PHP connection config<br/>[settingBD.php]"]
  node_academic_schema[("Academic database<br/>MySQL schema")]
end

node_browser(("Browser<br/>client runtime"))

node_browser -->|"requests"| node_entry
node_entry -->|"renders with"| node_shell
node_shell -->|"wraps"| node_student_pages
node_shell -->|"wraps"| node_grade_pages
node_shell -->|"wraps"| node_subject_pages
node_shell -->|"wraps"| node_teacher_pages
node_shell -->|"wraps"| node_assignment_page
node_browser -->|"loads"| node_ui_assets
node_assignment_page -->|"uses"| node_assignment_js
node_student_pages -->|"invokes"| node_student_controller
node_student_add -->|"invokes"| node_student_controller
node_grade_pages -->|"invokes"| node_grade_controller
node_subject_pages -->|"invokes"| node_subject_controller
node_teacher_pages -->|"invokes"| node_teacher_controller
node_assignment_js -->|"fetches assignments"| node_assignment_lookup
node_assignment_js -->|"submits changes"| node_assignment_receiver
node_assignment_lookup -->|"uses"| node_teacher_controller
node_assignment_receiver -->|"uses"| node_teacher_controller
node_student_controller -->|"connects through"| node_db_settings
node_teacher_controller -->|"connects through"| node_db_settings
node_grade_controller -->|"connects through"| node_db_settings
node_subject_controller -->|"connects through"| node_db_settings
node_db_settings -->|"accesses"| node_academic_schema
node_global_controller -->|"uses"| node_db_settings

click node_entry "https://github.com/urian121/sistema-gestion-escolar-php-mysql-desde-cero/blob/master/index.php"
click node_shell "https://github.com/urian121/sistema-gestion-escolar-php-mysql-desde-cero/blob/master/components/head.php"
click node_student_pages "https://github.com/urian121/sistema-gestion-escolar-php-mysql-desde-cero/blob/master/home/estudiantes/index.php"
click node_student_add "https://github.com/urian121/sistema-gestion-escolar-php-mysql-desde-cero/blob/master/home/estudiantes/add.php"
click node_grade_pages "https://github.com/urian121/sistema-gestion-escolar-php-mysql-desde-cero/blob/master/home/grados/index.php"
click node_subject_pages "https://github.com/urian121/sistema-gestion-escolar-php-mysql-desde-cero/blob/master/home/materias/index.php"
click node_teacher_pages "https://github.com/urian121/sistema-gestion-escolar-php-mysql-desde-cero/blob/master/home/profesores/index.php"
click node_assignment_page "https://github.com/urian121/sistema-gestion-escolar-php-mysql-desde-cero/blob/master/home/profesores/asignacion.php"
click node_assignment_js "https://github.com/urian121/sistema-gestion-escolar-php-mysql-desde-cero/blob/master/assets/js/asignacion_curso_materias_profe.js"
click node_ui_assets "https://github.com/urian121/sistema-gestion-escolar-php-mysql-desde-cero/blob/master/assets/vendors/js/vendor.bundle.base.js"
click node_student_controller "https://github.com/urian121/sistema-gestion-escolar-php-mysql-desde-cero/blob/master/controllers/ControllerEstudiantes.php"
click node_teacher_controller "https://github.com/urian121/sistema-gestion-escolar-php-mysql-desde-cero/blob/master/controllers/ControllerProfesores.php"
click node_grade_controller "https://github.com/urian121/sistema-gestion-escolar-php-mysql-desde-cero/blob/master/controllers/ControllerGrados.php"
click node_subject_controller "https://github.com/urian121/sistema-gestion-escolar-php-mysql-desde-cero/blob/master/controllers/ControllerMaterias.php"
click node_global_controller "https://github.com/urian121/sistema-gestion-escolar-php-mysql-desde-cero/blob/master/controllers/ControllerGlobal.php"
click node_assignment_lookup "https://github.com/urian121/sistema-gestion-escolar-php-mysql-desde-cero/blob/master/home/profesores/get_materias_profesor.php"
click node_assignment_receiver "https://github.com/urian121/sistema-gestion-escolar-php-mysql-desde-cero/blob/master/home/profesores/recibe_asignacion.php"
click node_db_settings "https://github.com/urian121/sistema-gestion-escolar-php-mysql-desde-cero/blob/master/settings/settingBD.php"
click node_academic_schema "https://github.com/urian121/sistema-gestion-escolar-php-mysql-desde-cero/blob/master/settings/bd/bd_sistema_gestion_escolar.sql"

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_entry,node_shell,node_student_pages,node_student_add,node_grade_pages,node_subject_pages,node_teacher_pages,node_assignment_page,node_assignment_js,node_ui_assets toneBlue
class node_student_controller,node_teacher_controller,node_grade_controller,node_subject_controller,node_global_controller,node_assignment_lookup,node_assignment_receiver toneAmber
class node_db_settings,node_academic_schema toneMint
class node_browser toneNeutral
```

## Components

### Server-rendered UI

- [Application entry](https://github.com/urian121/sistema-gestion-escolar-php-mysql-desde-cero/blob/master/index.php): PHP entry point · `index.php`
- [Shared page shell](https://github.com/urian121/sistema-gestion-escolar-php-mysql-desde-cero/blob/master/components/head.php): PHP layout fragments · Head, navigation, sidebar, loading UI, and footer. · `components/head.php`
- [Student administration](https://github.com/urian121/sistema-gestion-escolar-php-mysql-desde-cero/blob/master/home/estudiantes/index.php): module pages · `home/estudiantes/index.php`
- [Student creation](https://github.com/urian121/sistema-gestion-escolar-php-mysql-desde-cero/blob/master/home/estudiantes/add.php): module page · `home/estudiantes/add.php`
- [Grade administration](https://github.com/urian121/sistema-gestion-escolar-php-mysql-desde-cero/blob/master/home/grados/index.php): module page · `home/grados/index.php`
- [Subject administration](https://github.com/urian121/sistema-gestion-escolar-php-mysql-desde-cero/blob/master/home/materias/index.php): module page · `home/materias/index.php`
- [Teacher management](https://github.com/urian121/sistema-gestion-escolar-php-mysql-desde-cero/blob/master/home/profesores/index.php): module pages · Listing, creation, and detail workflows. · `home/profesores/index.php`
- [Teacher assignment](https://github.com/urian121/sistema-gestion-escolar-php-mysql-desde-cero/blob/master/home/profesores/asignacion.php): interactive PHP page · `home/profesores/asignacion.php`
- [Assignment client logic](https://github.com/urian121/sistema-gestion-escolar-php-mysql-desde-cero/blob/master/assets/js/asignacion_curso_materias_profe.js): browser JavaScript · `assets/js/asignacion_curso_materias_profe.js`
- [UI assets](https://github.com/urian121/sistema-gestion-escolar-php-mysql-desde-cero/blob/master/assets/vendors/js/vendor.bundle.base.js): served static assets · Vendor bundle, dashboard behavior, styles, icons, and avatars. · `assets/vendors/js/vendor.bundle.base.js`

### Domain controllers

- [Student controller](https://github.com/urian121/sistema-gestion-escolar-php-mysql-desde-cero/blob/master/controllers/ControllerEstudiantes.php): PHP controller · `controllers/ControllerEstudiantes.php`
- [Teacher controller](https://github.com/urian121/sistema-gestion-escolar-php-mysql-desde-cero/blob/master/controllers/ControllerProfesores.php): PHP controller · `controllers/ControllerProfesores.php`
- [Grade controller](https://github.com/urian121/sistema-gestion-escolar-php-mysql-desde-cero/blob/master/controllers/ControllerGrados.php): PHP controller · `controllers/ControllerGrados.php`
- [Subject controller](https://github.com/urian121/sistema-gestion-escolar-php-mysql-desde-cero/blob/master/controllers/ControllerMaterias.php): PHP controller · `controllers/ControllerMaterias.php`
- [Global controller](https://github.com/urian121/sistema-gestion-escolar-php-mysql-desde-cero/blob/master/controllers/ControllerGlobal.php): shared PHP controller · `controllers/ControllerGlobal.php`
- [Assigned-subject lookup](https://github.com/urian121/sistema-gestion-escolar-php-mysql-desde-cero/blob/master/home/profesores/get_materias_profesor.php): PHP endpoint · Returns a teacher's current subjects. · `home/profesores/get_materias_profesor.php`
- [Assignment receiver](https://github.com/urian121/sistema-gestion-escolar-php-mysql-desde-cero/blob/master/home/profesores/recibe_asignacion.php): PHP endpoint · Persists teacher-subject assignment changes. · `home/profesores/recibe_asignacion.php`

### Persistence

- [Database settings](https://github.com/urian121/sistema-gestion-escolar-php-mysql-desde-cero/blob/master/settings/settingBD.php): PHP connection config · `settings/settingBD.php`
- [Academic database](https://github.com/urian121/sistema-gestion-escolar-php-mysql-desde-cero/blob/master/settings/bd/bd_sistema_gestion_escolar.sql): MySQL schema · Defines students, teachers, grades, subjects, and assignments. · `settings/bd/bd_sistema_gestion_escolar.sql`

### Other components

- **Browser**: client runtime

## Connections

- Browser → Application entry: requests
- Application entry → Shared page shell: renders with
- Shared page shell → Student administration: wraps
- Shared page shell → Grade administration: wraps
- Shared page shell → Subject administration: wraps
- Shared page shell → Teacher management: wraps
- Shared page shell → Teacher assignment: wraps
- Browser → UI assets: loads
- Teacher assignment → Assignment client logic: uses
- Student administration → Student controller: invokes
- Student creation → Student controller: invokes
- Grade administration → Grade controller: invokes
- Subject administration → Subject controller: invokes
- Teacher management → Teacher controller: invokes
- Assignment client logic → Assigned-subject lookup: fetches assignments
- Assignment client logic → Assignment receiver: submits changes
- Assigned-subject lookup → Teacher controller: uses
- Assignment receiver → Teacher controller: uses
- Student controller → Database settings: connects through
- Teacher controller → Database settings: connects through
- Grade controller → Database settings: connects through
- Subject controller → Database settings: connects through
- Database settings → Academic database: accesses
- Global controller → Database settings: uses
