How jalfalc/tfg-thebeast works
Project type and purpose
• This is a PHP-based full-stack MVC web application (“TFG-TheBeast”) for user registration/login and booking/reservation of services (e.g., facial cleaning).
• Key features: user registration, login/logout, viewing services, making and editing reservations, listing user’s own reservations.
File structure
• Top-level directories:
• BBDD: contains database schema (database.sql) for MySQL.
• src: the entire MVC application, subdivided into Controller, Model, View, plus static assets (css, js, img).
• notas: contains project notes.
• Controllers (src/Controller): one controller per route/page (Login, Logout, Registro, Servicios, Reservas, MisReservas, EditarReserva, Verify, Principal).
• Models (src/Model):
• DAO/Conexion.php – database connection setup.
• DAO/MySqlDAO.php – generic data-access implementation.
• Usuario.php – user entity.
• Views (src/View): per-page PHP templates and shared header/footer sub-folders.
• Static assets: organized under src/css and src/js by feature/folder, plus img directory at project root.
• Entry point: src/index.php routes incoming requests to the appropriate controller.
README for additional insights
• Contains notes on path-resolution issues for CSS/JS/images when index.php is entry point.
a. Main components
1) Client Browser – renders HTML/CSS/JS, initiates HTTP requests.
2) Web Server & PHP Runtime – Apache/Nginx+PHP-FPM serving index.php.
3) MVC Layers:
• Router / Front Controller (index.php)
• Controllers – handle requests, invoke models, choose views
• Models / DAO – execute SQL against MySQL via Conexion and MySqlDAO
• Views – render HTML with CSS/JS assets
4) Static Assets – CSS, JS, images served either by web server directly or via PHP.
5) Database – MySQL instance initialized by BBDD/database.sql.
b. Relationships & interactions
• Browser → HTTP GET/POST → Web Server → index.php
• index.php → dispatch → appropriate Controller
• Controller → calls Model/DAO → Database
• Model → returns data → Controller → passes to View
• View → embeds static asset links → generates HTML → Response → Browser
• Static asset requests (CSS/JS/img) → Web Server → served directly
c. Architectural patterns & design principles
• MVC pattern separates concerns (routing/controllers, business logic/models, presentation/views).
• DAO pattern abstracts database operations.
• Single entry point (Front Controller) centralizes routing.
d. Technologies & frameworks
• PHP (7.x/8.x), MySQL, HTML5, CSS3, Vanilla JS.
Detail level
• Index.php as the entry point router that dispatches to Controllers.
• Path-resolution issues near static assets to highlight deployment considerations.