How rubenmolerorios/allblue works
Project Type and Purpose
• This is a monolithic, server-rendered PHP full-stack web application with two main user interfaces: an “admin” panel and a “shop” (public storefront).
• It follows an MVC (Model-View-Controller) pattern, interfacing with a relational database (via src/config/database.php) and serving static assets from a “public” directory.
Main Components
a. Web Server Layer
• Apache (or Nginx) receiving HTTP requests, honoring .htaccess
• Routes all requests to index.php (front controller)
b. Application Core
• Front Controller (index.php, autoload.php, include.php)
• Router logic (decides which controller in src/controllers handles the request)
c. MVC Modules
• Controllers (src/controllers/*.php)
• Models (src/models/*.php)
• Views (admin/view/... and shop/view/...)
d. Asset Server
• Static files under public/ (CSS, JS, images)
e. Database
• MySQL (or compatible), schema in sql/basededatosproyecto.sql
• Connection managed by src/db/DB.php and config/database.php
f. Two Functional Zones
• Admin interface (admin/index.php → admin/view/…)
• Shop interface (shop/index.php → shop/view/…)
Relationships and Data Flow
1. Client → Web Server → index.php
2. index.php loads autoload/include, picks a Controller
3. Controller invokes Models ↔ DB via DB.php
4. Controller compiles data, selects a View
5. View renders HTML + references assets in public/
6. Response served back to client
7. Separate flows for admin vs. shop, but share same MVC core and DB
Architectural Patterns & Principles
• MVC separation: Controllers manage request & business logic, Models encapsulate data access, Views handle presentation
• Single code-base modularity: admin vs. shop modules share src/ core
• Clear separation of static vs. dynamic content
• Configuration isolation: parameters.php, database.php
Technologies & Frameworks
• PHP 7+ or 8
• Apache/Nginx with .htaccess
• MySQL (or MariaDB)
• Plain JavaScript, CSS
• PSR-4 autoloading (autoload.php)