# rodrigomelendezm/proyecto_vuelos architecture

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

- Interactive diagram: https://gitdiagram.com/rodrigomelendezm/proyecto_vuelos
- Repository: https://github.com/rodrigomelendezm/proyecto_vuelos

## Overview

1. This is a PHP monolith for an airline-style booking system. The application is split into presentation pages, procedural backend endpoints, a small set of domain classes, and a MySQL database schema/export set under `sql/`.

2. There are two parallel UI trees: the root `html/` tree for the Spanish site and the `english/` tree for the English site. Both expose the same core workflows, so an architecture diagram should treat them as two localized frontends over the same application capabilities rather than separate products.

3. Entry points are simple PHP pages (`index.php`, `html/index.php`, `english/index.php`, plus language-specific `main.php`/`main/index.php` variants). The app appears to be browser-driven and server-rendered, with PHP generating pages and JavaScript adding client-side interaction.

4. The main functional boundary is by user role:
   - public/anonymous users: home, login, registration, flight search
   - passenger sessions: booking, seat assignment, summary, my-flight, check-in
   - admin sessions: add/modify/cancel flights, manage fares, admin menu
   This separation is mirrored in both Spanish and English directories.

5. Backend logic lives in `/php` and `english/php`. These folders contain the operational endpoints for authentication, registration, flight search, booking, check-in, payment, seat assignment, and session termination. The names indicate a largely form-post / request-response flow rather than a heavy API layer.

6. The domain model is lightweight and class-based: `class_conexion.php` handles database connectivity, while `class_admin.php`, `class_pasajero.php`, and `class_vuelo.php` encapsulate admin, passenger, and flight-related data/operations. These classes are the main abstraction boundary between pages/endpoints and the database.

7. The passenger booking flow is the core data path: search flights → view available results/pricing → assign seats → summarize booking → process payment → persist booking state. In the English tree this is explicit under `passenger_session/booking/`, and in the Spanish tree under `sesion_pasajero/reservar/`.

8. Check-in is a separate passenger workflow, exposed for both public and sessioned users. That suggests the system supports both lookup-based check-in and logged-in passenger check-in, with backend handlers in `checkin.php` and related session pages.

9. Admin operations are CRUD-oriented and centered on flights and tariffs. The admin UI calls backend endpoints such as `agregar_vuelo.php`, `mod_vuelo.php`, `eliminar_vuelo.php`, `agregar_tarifa.php`, and `mod_tarifa.php`, so the diagram should show admin actions writing directly to the same persistence layer as passenger bookings.

10. Client-side JavaScript is used for interaction-heavy tasks: login/register flows, flight search, seat selection, modal dialogs, toast notifications, admin UI behavior, and payment integration (`paypal.js`). This means some steps in the booking/payment flow likely happen in the browser before the final PHP persistence call.

11. The persistent store is MySQL, evidenced by multiple SQL dump files (`sql/Dump...sql`). Those dumps are likely schema/data snapshots used to load or reset the system; they are not runtime components but are important for understanding the database-backed architecture.

12. Static assets are organized separately: CSS for page-specific styling, destination images under `img/places/`, and a PDF resource under `pdf/`. These assets support the UI but do not introduce additional subsystems beyond presentation.

13. Overall, the architecture is a localized, role-based web application with server-side PHP pages, small domain classes, JavaScript-enhanced forms, and a single relational database. The key diagram boundaries should be: localized frontend trees, shared backend endpoints, role-specific session flows, and the database as the central state store.

Main entry points: [`php/class_conexion.php`](https://github.com/rodrigomelendezm/proyecto_vuelos/blob/main/php/class_conexion.php) (Domain classes), [`js/index.php`](https://github.com/rodrigomelendezm/proyecto_vuelos/blob/main/js/index.php) (JS/CSS assets), [`php/index.php`](https://github.com/rodrigomelendezm/proyecto_vuelos/blob/main/php/index.php) (Spanish backend), [`english/php/index.php`](https://github.com/rodrigomelendezm/proyecto_vuelos/blob/main/english/php/index.php) (English backend)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontends["Localized frontends"]
  node_root["App entry<br/>PHP entry<br/>[index.php]"]
  node_es_public["Spanish public<br/>Pages<br/>[index.php]"]
  node_es_passenger["Spanish passenger<br/>Session pages<br/>[index.php]"]
  node_es_admin["Spanish admin<br/>Admin pages<br/>[index.php]"]
  node_en_public["English public<br/>Pages<br/>[index.php]"]
  node_en_passenger["English passenger<br/>Session pages<br/>[index.php]"]
  node_en_admin["English admin<br/>Admin pages<br/>[admin.html]"]
end

subgraph group_backend["Request handlers"]
  node_es_backend["Spanish backend<br/>PHP handlers<br/>[index.php]"]
  node_en_backend["English backend<br/>PHP handlers<br/>[index.php]"]
  node_auth_reg["Auth & signup<br/>Endpoints"]
  node_flight_search["Flight search<br/>Endpoints<br/>[buscar_vuelo.php]"]
  node_booking_pay["Booking & pay<br/>Endpoints"]
  node_checkin["Check-in<br/>Endpoints<br/>[checkin.php]"]
  node_admin_ops["Admin CRUD<br/>Endpoints<br/>[agregar_vuelo.php]"]
  node_domain["Domain classes<br/>PHP models<br/>[class_conexion.php]"]
end

subgraph group_data["Persistence"]
  node_db[("MySQL store<br/>Database")]
end

node_ui_assets["JS/CSS assets<br/>Client assets<br/>[index.php]"]

node_root -->|"Spanish site"| node_es_public
node_root -->|"English site"| node_en_public
node_es_public -->|"Forms"| node_es_backend
node_es_passenger -->|"Session actions"| node_es_backend
node_es_admin -->|"Admin actions"| node_es_backend
node_en_public -->|"Forms"| node_en_backend
node_en_passenger -->|"Session actions"| node_en_backend
node_en_admin -->|"Admin actions"| node_en_backend
node_es_public -->|"Client UI"| node_ui_assets
node_es_passenger -->|"Client UI"| node_ui_assets
node_es_admin -->|"Client UI"| node_ui_assets
node_en_public -->|"Client UI"| node_ui_assets
node_en_passenger -->|"Client UI"| node_ui_assets
node_auth_reg -->|"Uses"| node_domain
node_flight_search -->|"Uses"| node_domain
node_booking_pay -->|"Uses"| node_domain
node_checkin -->|"Uses"| node_domain
node_admin_ops -->|"Uses"| node_domain
node_domain -->|"Reads/writes"| node_db
node_es_backend -->|"Persists"| node_db
node_en_backend -->|"Persists"| node_db

click node_root "https://github.com/rodrigomelendezm/proyecto_vuelos/blob/main/index.php"
click node_es_public "https://github.com/rodrigomelendezm/proyecto_vuelos/blob/main/html/index.php"
click node_es_passenger "https://github.com/rodrigomelendezm/proyecto_vuelos/blob/main/html/sesion_pasajero/index.php"
click node_es_admin "https://github.com/rodrigomelendezm/proyecto_vuelos/blob/main/html/sesion_administrador/index.php"
click node_en_public "https://github.com/rodrigomelendezm/proyecto_vuelos/blob/main/english/index.php"
click node_en_passenger "https://github.com/rodrigomelendezm/proyecto_vuelos/blob/main/english/html/passenger_session/index.php"
click node_en_admin "https://github.com/rodrigomelendezm/proyecto_vuelos/blob/main/english/html/admin.html"
click node_ui_assets "https://github.com/rodrigomelendezm/proyecto_vuelos/blob/main/js/index.php"
click node_es_backend "https://github.com/rodrigomelendezm/proyecto_vuelos/blob/main/php/index.php"
click node_en_backend "https://github.com/rodrigomelendezm/proyecto_vuelos/blob/main/english/php/index.php"
click node_auth_reg "https://github.com/rodrigomelendezm/proyecto_vuelos/blob/main/php/iniciar_sesion_pas.php"
click node_flight_search "https://github.com/rodrigomelendezm/proyecto_vuelos/blob/main/php/buscar_vuelo.php"
click node_booking_pay "https://github.com/rodrigomelendezm/proyecto_vuelos/blob/main/php/asientos_pasajero.php"
click node_checkin "https://github.com/rodrigomelendezm/proyecto_vuelos/blob/main/php/checkin.php"
click node_admin_ops "https://github.com/rodrigomelendezm/proyecto_vuelos/blob/main/php/agregar_vuelo.php"
click node_domain "https://github.com/rodrigomelendezm/proyecto_vuelos/blob/main/php/class_conexion.php"
click node_db "https://github.com/rodrigomelendezm/proyecto_vuelos/blob/main/sql/Dump20260101final.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_root,node_es_public,node_es_passenger,node_es_admin,node_en_public,node_en_passenger,node_en_admin toneBlue
class node_es_backend,node_en_backend,node_auth_reg,node_flight_search,node_booking_pay,node_checkin,node_admin_ops,node_domain toneAmber
class node_db toneMint
class node_ui_assets toneNeutral
```

## Components

### Localized frontends

Spanish and English browser-facing page trees for the same workflows.

- [App entry](https://github.com/rodrigomelendezm/proyecto_vuelos/blob/main/index.php): PHP entry · Top-level browser entry that dispatches into localized site trees. · `index.php`
- [Spanish public](https://github.com/rodrigomelendezm/proyecto_vuelos/blob/main/html/index.php): Pages · Spanish home, login, registration, and flight search pages. · `html/index.php`
- [Spanish passenger](https://github.com/rodrigomelendezm/proyecto_vuelos/blob/main/html/sesion_pasajero/index.php): Session pages · Spanish passenger session pages for booking, seat assignment, summary, my-flight, and check-in. · `html/sesion_pasajero/index.php`
- [Spanish admin](https://github.com/rodrigomelendezm/proyecto_vuelos/blob/main/html/sesion_administrador/index.php): Admin pages · Spanish admin pages for flight and fare management. · `html/sesion_administrador/index.php`
- [English public](https://github.com/rodrigomelendezm/proyecto_vuelos/blob/main/english/index.php): Pages · English home, login, registration, and flight search pages. · `english/index.php`
- [English passenger](https://github.com/rodrigomelendezm/proyecto_vuelos/blob/main/english/html/passenger_session/index.php): Session pages · English passenger session pages for booking, seat assignment, summary, my-flight, and check-in. · `english/html/passenger_session/index.php`
- [English admin](https://github.com/rodrigomelendezm/proyecto_vuelos/blob/main/english/html/admin.html): Admin pages · English admin surface for flight and fare management. · `english/html/admin.html`

### Request handlers

Procedural PHP endpoints and domain classes.

- [Spanish backend](https://github.com/rodrigomelendezm/proyecto_vuelos/blob/main/php/index.php): PHP handlers · Spanish request handlers for login, registration, search, booking, payment, check-in, and admin CRUD. · `php/index.php`
- [English backend](https://github.com/rodrigomelendezm/proyecto_vuelos/blob/main/english/php/index.php): PHP handlers · English request handlers mirroring the same passenger and admin workflows. · `english/php/index.php`
- [Auth & signup](https://github.com/rodrigomelendezm/proyecto_vuelos/blob/main/php/iniciar_sesion_pas.php): Endpoints · Login, logout, and passenger registration endpoints. · `php/iniciar_sesion_pas.php`
- [Flight search](https://github.com/rodrigomelendezm/proyecto_vuelos/blob/main/php/buscar_vuelo.php): Endpoints · Search and result endpoints that find flights and prices. · `php/buscar_vuelo.php`
- [Booking & pay](https://github.com/rodrigomelendezm/proyecto_vuelos/blob/main/php/asientos_pasajero.php): Endpoints · Seat assignment, booking persistence, payment processing, and points handling. · `php/asientos_pasajero.php`
- [Check-in](https://github.com/rodrigomelendezm/proyecto_vuelos/blob/main/php/checkin.php): Endpoints · Check-in handlers for lookup-based and session-based passenger check-in. · `php/checkin.php`
- [Admin CRUD](https://github.com/rodrigomelendezm/proyecto_vuelos/blob/main/php/agregar_vuelo.php): Endpoints · Flight and fare create, update, delete, and cancellation endpoints. · `php/agregar_vuelo.php`
- [Domain classes](https://github.com/rodrigomelendezm/proyecto_vuelos/blob/main/php/class_conexion.php): PHP models · Core classes for database connection, admin, passenger, and flight operations. · `php/class_conexion.php`

### Persistence

Relational database and SQL exports used to load or reset it.

- [MySQL store](https://github.com/rodrigomelendezm/proyecto_vuelos/blob/main/sql/Dump20260101final.sql): Database · Primary relational data store used by the application. · `sql/Dump20260101final.sql`

### Other components

- [JS/CSS assets](https://github.com/rodrigomelendezm/proyecto_vuelos/blob/main/js/index.php): Client assets · Shared JavaScript and stylesheet layer for forms, dialogs, seats, payments, and UI polish. · `js/index.php`

## Connections

- App entry → Spanish public: Spanish site · Routes the default entry into the Spanish public UI.
- App entry → English public: English site · Routes into the English public UI.
- Spanish public → Spanish backend: Forms · Public Spanish pages post to shared backend handlers.
- Spanish passenger → Spanish backend: Session actions · Passenger session pages invoke booking, check-in, and profile handlers.
- Spanish admin → Spanish backend: Admin actions · Admin pages call flight and fare CRUD endpoints.
- English public → English backend: Forms · English public pages post to localized backend handlers.
- English passenger → English backend: Session actions · English passenger session pages invoke booking and check-in handlers.
- English admin → English backend: Admin actions · English admin pages call localized CRUD endpoints.
- Spanish public → JS/CSS assets: Client UI · Spanish pages use shared JavaScript and CSS for interaction.
- Spanish passenger → JS/CSS assets: Client UI · Passenger session pages use seat, modal, and payment scripts.
- Spanish admin → JS/CSS assets: Client UI · Admin pages use interaction scripts and styles.
- English public → JS/CSS assets: Client UI · English pages use the same browser assets.
- English passenger → JS/CSS assets: Client UI · English passenger pages use the same browser assets.
- Auth & signup → Domain classes: Uses · Authentication and registration logic use shared model classes.
- Flight search → Domain classes: Uses · Flight search endpoints query through flight/domain abstractions.
- Booking & pay → Domain classes: Uses · Booking and payment flow reads and writes through passenger and flight classes.
- Check-in → Domain classes: Uses · Check-in handlers validate passengers and flight state through models.
- Admin CRUD → Domain classes: Uses · Admin CRUD manipulates flights and fares through shared models.
- Domain classes → MySQL store: Reads/writes · All core business state persists in MySQL.
- Spanish backend → MySQL store: Persists · Spanish backend endpoints store and retrieve application state.
- English backend → MySQL store: Persists · English backend endpoints store and retrieve application state.
