How herberthreyes07/ts1-hola-mundo works
Project type and purpose
• This is a full-stack PHP web application implementing an online video-game store.
• It follows a classic MVC pattern:
• app/controllers – HTTP request handlers
• app/models – data structures
• app/views – HTML/PHP templates
• app/dao – persistence logic
• public – web-accessible entry points and static assets
File structure
• Top-level:
• app/ — application core
• app/config/database.php holds DB credentials; app/core/DatabaseConnection.php wraps PDO/MySQLi.
• Controllers are grouped by role: AdminController, AuthController, CashierController, CustomerController, UserController.
• DAOs: one per entity (VideoGameDAO, UserDAO, etc.), plus join-table DAOs (VideoGameGenreDAO).
• Views reflect MVC: subfolders by role (admin/, auth/, cashier/, customer/, user/) and global layouts.
• Utilities: app/utils/Validations.php for input checks.
README for additional insights
• The app runs under XAMPP (Apache + MySQL).
• DB setup scripts are in /db (not shown in file_tree) but key to persistence.
• Entry URL: http://localhost/miproyecto/public.
Main components
a. Presentation Layer
• Browser / Client
• Web Server (Apache via XAMPP)
• public/*.php entry scripts
• Static assets (CSS, JS, images)
b. Application Layer
• Front Controller / Router (public/index.php et al)
• Controllers (app/controllers/)
• Validation (app/utils/Validations.php)
c. Business & Persistence Layer
• Models (app/models/)
• Data Access Objects (app/dao/)
• DatabaseConnection (app/core/)
• MySQL Database
d. External Services
• (Optional) GitDiagram link for documentation
Relationships & data flow
1. Client → HTTP Request → public/*.php
2. Entry script loads app/config, core, routes to the appropriate Controller
3. Controller performs Validations → invokes DAO methods
4. DAO uses DatabaseConnection to execute SQL against MySQL
5. DAO returns Model objects to Controller
6. Controller passes Models to Views
7. Views rendered into HTML → Response back to Client
8. Static asset requests served directly by Apache
Architectural patterns & design principles
• MVC separation: clear layers for controllers, views, models
• Single Responsibility: each DAO handles one entity
• Reusable core component: DatabaseConnection
• Folder-based modularity by user role (admin, cashier, customer, user)