# leonard0nt/citascolegio architecture

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

- Interactive diagram: https://gitdiagram.com/leonard0nt/citascolegio
- Repository: https://github.com/leonard0nt/citascolegio

## Overview

Citas Colegio is a PHP/MySQL school appointment manager. Its main workflow is an administrator or teacher signing in, maintaining teacher and student/guardian records, scheduling meetings, then viewing the day’s meetings publicly. The graph retains CSV imports, profiles, role-protected pages, and meeting options alongside that flow. Some page-to-endpoint wiring and unsampled CRUD implementations are not shown; those links are marked unverified rather than inferred as source-level calls.

Main entry points: [`includes/session.php`](https://github.com/leonard0nt/citascolegio/blob/main/includes/session.php) (Session and role guards), [`meetings.php`](https://github.com/leonard0nt/citascolegio/blob/main/meetings.php) (Meeting management), [`backend/users/upload-teachers.php`](https://github.com/leonard0nt/citascolegio/blob/main/backend/users/upload-teachers.php) (Teacher CSV import), [`backend/users/upload-students.php`](https://github.com/leonard0nt/citascolegio/blob/main/backend/users/upload-students.php) (Student CSV import)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_access["Access and profiles"]
  node_login_page["Login page<br/>[login.php]"]
  node_auth_api["Authentication endpoints<br/>[login.php]"]
  node_session["Session and role guards<br/>[session.php]"]
  node_dashboard["Private dashboard<br/>[dashboard.php]"]
  node_profile_page["User profile<br/>[profile.php]"]
  node_profile_api["Profile update<br/>[profile-update.php]"]
end

subgraph group_people["People administration"]
  node_teacher_page["Teacher administration<br/>[users.php]"]
  node_teacher_api["Teacher records<br/>[create.php]"]
  node_teacher_helpers["Teacher profile helpers"]
  node_teacher_import["Teacher CSV import"]
  node_student_page["Student administration<br/>[students.php]"]
  node_student_api["Student records<br/>[update.php]"]
  node_student_helpers["Student and guardian helpers"]
  node_student_import["Student CSV import"]
  node_import_helpers["CSV import helpers"]
  node_encoding_helpers["CSV encoding helpers"]
end

subgraph group_agenda["Meeting agenda"]
  node_meeting_page["Meeting management<br/>[meetings.php]"]
  node_meeting_create["Create meeting<br/>[create.php]"]
  node_meeting_list["List meetings<br/>[list.php]"]
  node_meeting_delete["Delete meeting<br/>[delete.php]"]
  node_meeting_options["Meeting options<br/>[options.php]"]
  node_meeting_schema["Meeting schema helpers<br/>[schema-helpers.php]"]
  node_today_page["Public day view<br/>[today-meetings.php]"]
  node_today_api["Public day endpoint<br/>[today-public.php]"]
end

subgraph group_storage["Persistence"]
  node_config_path["Database config loader<br/>[config-path.php]"]
  node_db_config["PDO connection<br/>[database.php]"]
  node_mysql[("MySQL or MariaDB")]
end

node_visitor(("Administrator or teacher"))

node_visitor -->|"opens"| node_login_page
node_login_page -.->|"authenticates"| node_auth_api
node_auth_api -->|"loads connection"| node_config_path
node_auth_api -->|"uses profile helpers"| node_teacher_helpers
node_login_page -->|"uses guards"| node_session
node_dashboard -->|"uses guards"| node_session
node_teacher_page -->|"requires admin"| node_session
node_student_page -->|"requires admin"| node_session
node_profile_page -->|"uses guards"| node_session
node_profile_page -.->|"updates profile"| node_profile_api
node_teacher_page -.->|"manages teachers"| node_teacher_api
node_teacher_page -.->|"imports CSV"| node_teacher_import
node_teacher_api -->|"uses profile helpers"| node_teacher_helpers
node_teacher_import -->|"uses profile helpers"| node_teacher_helpers
node_teacher_import -->|"normalizes CSV"| node_encoding_helpers
node_teacher_import -->|"uses import helpers"| node_import_helpers
node_student_page -.->|"manages students"| node_student_api
node_student_page -.->|"imports CSV"| node_student_import
node_student_import -->|"saves student records"| node_student_helpers
node_student_import -->|"normalizes CSV"| node_encoding_helpers
node_student_import -->|"uses import helpers"| node_import_helpers
node_student_api -->|"uses profile helpers"| node_student_helpers
node_meeting_page -.->|"schedules meeting"| node_meeting_create
node_meeting_page -.->|"views meetings"| node_meeting_list
node_meeting_page -.->|"deletes meeting"| node_meeting_delete
node_meeting_page -.->|"loads options"| node_meeting_options
node_meeting_create -->|"loads connection"| node_config_path
node_meeting_create -->|"ensures schema"| node_meeting_schema
node_meeting_list -->|"loads connection"| node_config_path
node_meeting_list -->|"uses profile helpers"| node_teacher_helpers
node_today_page -.->|"shows daily meetings"| node_today_api
node_config_path -->|"loads"| node_db_config
node_db_config -->|"connects PDO"| node_mysql

click node_login_page "https://github.com/leonard0nt/citascolegio/blob/main/login.php"
click node_auth_api "https://github.com/leonard0nt/citascolegio/blob/main/backend/auth/login.php"
click node_session "https://github.com/leonard0nt/citascolegio/blob/main/includes/session.php"
click node_dashboard "https://github.com/leonard0nt/citascolegio/blob/main/dashboard.php"
click node_profile_page "https://github.com/leonard0nt/citascolegio/blob/main/profile.php"
click node_profile_api "https://github.com/leonard0nt/citascolegio/blob/main/backend/users/profile-update.php"
click node_teacher_page "https://github.com/leonard0nt/citascolegio/blob/main/users.php"
click node_teacher_api "https://github.com/leonard0nt/citascolegio/blob/main/backend/users/create.php"
click node_teacher_helpers "https://github.com/leonard0nt/citascolegio/blob/main/backend/users/teacher-profile-helpers.php"
click node_teacher_import "https://github.com/leonard0nt/citascolegio/blob/main/backend/users/upload-teachers.php"
click node_student_page "https://github.com/leonard0nt/citascolegio/blob/main/students.php"
click node_student_api "https://github.com/leonard0nt/citascolegio/blob/main/backend/users/update.php"
click node_student_helpers "https://github.com/leonard0nt/citascolegio/blob/main/backend/users/student-profile-helpers.php"
click node_student_import "https://github.com/leonard0nt/citascolegio/blob/main/backend/users/upload-students.php"
click node_import_helpers "https://github.com/leonard0nt/citascolegio/blob/main/backend/users/bulk-import-helpers.php"
click node_encoding_helpers "https://github.com/leonard0nt/citascolegio/blob/main/backend/users/encoding-helpers.php"
click node_meeting_page "https://github.com/leonard0nt/citascolegio/blob/main/meetings.php"
click node_meeting_create "https://github.com/leonard0nt/citascolegio/blob/main/backend/meetings/create.php"
click node_meeting_list "https://github.com/leonard0nt/citascolegio/blob/main/backend/meetings/list.php"
click node_meeting_delete "https://github.com/leonard0nt/citascolegio/blob/main/backend/meetings/delete.php"
click node_meeting_options "https://github.com/leonard0nt/citascolegio/blob/main/backend/meetings/options.php"
click node_meeting_schema "https://github.com/leonard0nt/citascolegio/blob/main/backend/meetings/schema-helpers.php"
click node_today_page "https://github.com/leonard0nt/citascolegio/blob/main/today-meetings.php"
click node_today_api "https://github.com/leonard0nt/citascolegio/blob/main/backend/meetings/today-public.php"
click node_config_path "https://github.com/leonard0nt/citascolegio/blob/main/includes/config-path.php"
click node_db_config "https://github.com/leonard0nt/citascolegio/blob/main/config/database.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_page,node_auth_api,node_session,node_dashboard,node_profile_page,node_profile_api toneBlue
class node_teacher_page,node_teacher_api,node_teacher_helpers,node_teacher_import,node_student_page,node_student_api,node_student_helpers,node_student_import,node_import_helpers,node_encoding_helpers toneAmber
class node_meeting_page,node_meeting_create,node_meeting_list,node_meeting_delete,node_meeting_options,node_meeting_schema,node_today_page,node_today_api toneMint
class node_config_path,node_db_config,node_mysql toneRose
class node_visitor toneIndigo
```

## Components

### Access and profiles

- [Login page](https://github.com/leonard0nt/citascolegio/blob/main/login.php): `login.php`
- [Authentication endpoints](https://github.com/leonard0nt/citascolegio/blob/main/backend/auth/login.php): `backend/auth/login.php`
- [Session and role guards](https://github.com/leonard0nt/citascolegio/blob/main/includes/session.php): `includes/session.php`
- [Private dashboard](https://github.com/leonard0nt/citascolegio/blob/main/dashboard.php): `dashboard.php`
- [User profile](https://github.com/leonard0nt/citascolegio/blob/main/profile.php): `profile.php`
- [Profile update](https://github.com/leonard0nt/citascolegio/blob/main/backend/users/profile-update.php): `backend/users/profile-update.php`

### People administration

- [Teacher administration](https://github.com/leonard0nt/citascolegio/blob/main/users.php): `users.php`
- [Teacher records](https://github.com/leonard0nt/citascolegio/blob/main/backend/users/create.php): `backend/users/create.php`
- [Teacher profile helpers](https://github.com/leonard0nt/citascolegio/blob/main/backend/users/teacher-profile-helpers.php): `backend/users/teacher-profile-helpers.php`
- [Teacher CSV import](https://github.com/leonard0nt/citascolegio/blob/main/backend/users/upload-teachers.php): `backend/users/upload-teachers.php`
- [Student administration](https://github.com/leonard0nt/citascolegio/blob/main/students.php): `students.php`
- [Student records](https://github.com/leonard0nt/citascolegio/blob/main/backend/users/update.php): `backend/users/update.php`
- [Student and guardian helpers](https://github.com/leonard0nt/citascolegio/blob/main/backend/users/student-profile-helpers.php): `backend/users/student-profile-helpers.php`
- [Student CSV import](https://github.com/leonard0nt/citascolegio/blob/main/backend/users/upload-students.php): `backend/users/upload-students.php`
- [CSV import helpers](https://github.com/leonard0nt/citascolegio/blob/main/backend/users/bulk-import-helpers.php): `backend/users/bulk-import-helpers.php`
- [CSV encoding helpers](https://github.com/leonard0nt/citascolegio/blob/main/backend/users/encoding-helpers.php): `backend/users/encoding-helpers.php`

### Meeting agenda

- [Meeting management](https://github.com/leonard0nt/citascolegio/blob/main/meetings.php): `meetings.php`
- [Create meeting](https://github.com/leonard0nt/citascolegio/blob/main/backend/meetings/create.php): `backend/meetings/create.php`
- [List meetings](https://github.com/leonard0nt/citascolegio/blob/main/backend/meetings/list.php): `backend/meetings/list.php`
- [Delete meeting](https://github.com/leonard0nt/citascolegio/blob/main/backend/meetings/delete.php): `backend/meetings/delete.php`
- [Meeting options](https://github.com/leonard0nt/citascolegio/blob/main/backend/meetings/options.php): `backend/meetings/options.php`
- [Meeting schema helpers](https://github.com/leonard0nt/citascolegio/blob/main/backend/meetings/schema-helpers.php): `backend/meetings/schema-helpers.php`
- [Public day view](https://github.com/leonard0nt/citascolegio/blob/main/today-meetings.php): `today-meetings.php`
- [Public day endpoint](https://github.com/leonard0nt/citascolegio/blob/main/backend/meetings/today-public.php): `backend/meetings/today-public.php`

### Persistence

- [Database config loader](https://github.com/leonard0nt/citascolegio/blob/main/includes/config-path.php): `includes/config-path.php`
- [PDO connection](https://github.com/leonard0nt/citascolegio/blob/main/config/database.php): `config/database.php`
- **MySQL or MariaDB**

### Other components

- **Administrator or teacher**

## Connections

- Administrator or teacher → Login page: opens (evidence: `README.md`)
- Login page → Authentication endpoints: authenticates
- Authentication endpoints → Database config loader: loads connection (evidence: `backend/auth/login.php`)
- Authentication endpoints → Teacher profile helpers: uses profile helpers (evidence: `backend/auth/login.php`)
- Login page → Session and role guards: uses guards (evidence: `login.php`)
- Private dashboard → Session and role guards: uses guards (evidence: `dashboard.php`)
- Teacher administration → Session and role guards: requires admin (evidence: `users.php`)
- Student administration → Session and role guards: requires admin (evidence: `students.php`)
- User profile → Session and role guards: uses guards (evidence: `profile.php`)
- User profile → Profile update: updates profile
- Teacher administration → Teacher records: manages teachers
- Teacher administration → Teacher CSV import: imports CSV
- Teacher records → Teacher profile helpers: uses profile helpers (evidence: `backend/users/create.php`)
- Teacher CSV import → Teacher profile helpers: uses profile helpers (evidence: `backend/users/upload-teachers.php`)
- Teacher CSV import → CSV encoding helpers: normalizes CSV (evidence: `backend/users/upload-teachers.php`)
- Teacher CSV import → CSV import helpers: uses import helpers (evidence: `backend/users/upload-teachers.php`)
- Student administration → Student records: manages students
- Student administration → Student CSV import: imports CSV
- Student CSV import → Student and guardian helpers: saves student records (evidence: `backend/users/upload-students.php`)
- Student CSV import → CSV encoding helpers: normalizes CSV (evidence: `backend/users/upload-students.php`)
- Student CSV import → CSV import helpers: uses import helpers (evidence: `backend/users/upload-students.php`)
- Student records → Student and guardian helpers: uses profile helpers (evidence: `backend/users/update.php`)
- Meeting management → Create meeting: schedules meeting
- Meeting management → List meetings: views meetings
- Meeting management → Delete meeting: deletes meeting
- Meeting management → Meeting options: loads options
- Create meeting → Database config loader: loads connection (evidence: `backend/meetings/create.php`)
- Create meeting → Meeting schema helpers: ensures schema (evidence: `backend/meetings/create.php`)
- List meetings → Database config loader: loads connection (evidence: `backend/meetings/list.php`)
- List meetings → Teacher profile helpers: uses profile helpers (evidence: `backend/meetings/list.php`)
- Public day view → Public day endpoint: shows daily meetings
- Database config loader → PDO connection: loads (evidence: `includes/config-path.php`)
- PDO connection → MySQL or MariaDB: connects PDO (evidence: `config/database.php`)
