How rodrigomelendezm/proyecto_vuelos works
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: class_conexion.php Domain classes · js/index.php JS/CSS assets · php/index.php Spanish backend · php/index.php English backend
Components 17
Localized frontends
Spanish and English browser-facing page trees for the same workflows.
- App entry · Top-level browser entry that dispatches into localized site trees.
index.php - Spanish public · Spanish home, login, registration, and flight search pages.
html/index.php - Spanish passenger · Spanish passenger session pages for booking, seat assignment, summary, my-flight, and check-in.
html/sesion_pasajero/index.php - Spanish admin · Spanish admin pages for flight and fare management.
html/sesion_administrador/index.php - English public · English home, login, registration, and flight search pages.
english/index.php - English passenger · English passenger session pages for booking, seat assignment, summary, my-flight, and check-in.
english/html/passenger_session/index.php - English admin · English admin surface for flight and fare management.
english/html/admin.html
Request handlers
Procedural PHP endpoints and domain classes.
- Spanish backend · Spanish request handlers for login, registration, search, booking, payment, check-in, and admin CRUD.
php/index.php - English backend · English request handlers mirroring the same passenger and admin workflows.
english/php/index.php - Auth & signup · Login, logout, and passenger registration endpoints.
php/iniciar_sesion_pas.php - Flight search · Search and result endpoints that find flights and prices.
php/buscar_vuelo.php - Booking & pay · Seat assignment, booking persistence, payment processing, and points handling.
php/asientos_pasajero.php - Check-in · Check-in handlers for lookup-based and session-based passenger check-in.
php/checkin.php - Admin CRUD · Flight and fare create, update, delete, and cancellation endpoints.
php/agregar_vuelo.php - Domain classes · 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 · Primary relational data store used by the application.
sql/Dump20260101final.sql
Other components
- JS/CSS assets · Shared JavaScript and stylesheet layer for forms, dialogs, seats, payments, and UI polish.
js/index.php
Connections 21
- 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.