How saulzarate/dv-produccion_web-tp_final works
1. Project type and runtime
- This is a classic server-rendered PHP + MySQL application for a clothing store.
- The architecture is MVC, with PHP handling request/response rendering and MySQL persisting users, products, and categories.
2. Request entry point
- index.php is the main entry point and likely acts as the front controller.
- It coordinates bootstrapping, routing to controllers, and loading the appropriate view for each request.
3. Bootstrap and configuration boundary
- autoload.php provides class loading for the app’s own code.
- config/parameters.php centralizes application path/base URL settings.
- config/db.php holds the database connection settings, so environment-specific values are isolated from the app logic.
4. Controller layer
- controllers/ProductoController.php handles product-facing flows such as listing, featured products, category views, product detail, and admin product creation/editing.
- controllers/UsuarioController.php handles authentication and user flows such as login and registration.
- Controllers are the orchestration layer: they gather model data, apply access rules, and pass variables into views.
5. Model layer and data access
- models/Producto.php, models/Categoria.php, and models/Usuario.php represent the main domain entities.
- These models are the boundary to the MySQL database and encapsulate queries/CRUD for products, categories, and users.
- The app’s persistent structure is defined by the SQL dump in database/dv-produccion_web-tienda.sql.
6. View layer and page composition
- Views are organized by feature: views/producto/* and views/usuario/*.
- Shared layout pieces live in views/layout/* (header, footer, nav, meta, links, scriptBootstrap), indicating a reusable page shell around content views.
- This layout structure suggests a consistent rendered HTML site with common navigation and styling.
7. Authentication and role separation
- The README indicates two roles: admin and normal user.
- User registration/login live in the UsuarioController and views/usuario/*.
- Role checks likely gate admin-only product management screens versus public catalog browsing.
8. Catalog and content flow
- Public-facing product browsing appears to include:
- featured/home content in views/producto/destacados.php
- category/product listings in views/producto/producto.php
- product detail in views/producto/ver.php
- The main flow is: request → controller fetches products/categories from models → view renders catalog page.
9. Admin product management
- views/producto/crear.php and the admin screenshots in the README indicate a back-office UI for creating and modifying products.
- This is likely the main write path in the app: admin submits product data through a controller, which persists it via the Producto model.
10. Helpers and pagination
- helpers/Paginador.php suggests list pages are paginated rather than loading all products at once.
- helpers/Utils.php likely contains shared utility functions for formatting, validation, or common view/controller operations.
- These helpers sit between controllers and views to reduce repeated logic.
11. Static and uploaded assets
- assets/css/style.css is the main custom stylesheet, alongside image assets in assets/img.
- uploads/images is the writable content area for product images, separating user/admin uploaded media from source assets.
- Product detail and listing pages likely render images from this upload directory.
12. Overall architectural boundary
- The application is split into:
- web entry/bootstrap (index.php, autoload.php, config/*)
- business and request handling (controllers/*, helpers/*)
- persistence/domain (models/*, database/*.sql)
- presentation (views/*, assets/*, uploads/*)
- There are no visible external APIs or services; the system is self-contained around PHP, Bootstrap-styled HTML, and MySQL.
Main entry points: ProductoController.php ProductoController · index.php index.php · UsuarioController.php UsuarioController · producto.php producto views
Components 17
Web entry
Front controller, autoloading, and configuration boundary
- index.php · Main request entry point and route dispatcher
index.php - autoload.php · Loads application classes
autoload.php - parameters · Application path and base URL settings
config/parameters.php - db config · Database connection settings
config/db.php
App logic
Controllers, helpers, and domain models
- ProductoController · Product browsing and admin product flows
controllers/ProductoController.php - UsuarioController · Login and registration flows
controllers/UsuarioController.php - Producto · Product domain and persistence access
models/Producto.php - Categoria · Category domain and persistence access
models/Categoria.php - Usuario · User domain and persistence access
models/Usuario.php - Paginador · Pagination support for list pages
helpers/Paginador.php - Utils · Shared utility functions
helpers/Utils.php
Presentation
Reusable layout and feature views
- layout · Shared page shell and chrome
views/layout/header.php - producto views · Catalog, detail, featured, and admin product screens
views/producto/producto.php - usuario views · Login and registration screens
views/usuario/login.php
Data
Database schema and persisted content
- schema SQL · MySQL structure and sample data dump
database/dv-produccion_web-tienda.sql
Assets
Static and uploaded media
- uploads/images · Writable product image directory
uploads/images - style.css · Custom site styling
assets/css/style.css
Connections 21
- index.php → autoload.php: loads · Bootstraps class loading before handling requests
- index.php → parameters: reads · Uses app path and base URL settings
- index.php → db config: reads · Connects application runtime to the database
- index.php → ProductoController: dispatches to · Routes catalog and admin product requests
- index.php → UsuarioController: dispatches to · Routes auth and user requests
- ProductoController → Producto: queries · Fetches and persists products
- ProductoController → Categoria: queries · Loads categories for catalog and forms
- ProductoController → Paginador: uses · Paginates product listings
- ProductoController → Utils: uses · Shares formatting and controller utilities
- UsuarioController → Usuario: queries · Authenticates and creates users
- UsuarioController → Utils: uses · Shares validation and helper routines
- ProductoController → producto views: renders · Composes catalog, detail, and admin product pages
- UsuarioController → usuario views: renders · Composes login and registration pages
- producto views → layout: wraps with · Uses common header, nav, meta, and footer pieces
- usuario views → layout: wraps with · Uses common header, nav, meta, and footer pieces
- producto views → style.css: styles with · Applies the shared site stylesheet
- usuario views → style.css: styles with · Applies the shared site stylesheet
- producto views → uploads/images: displays · Renders product images from the upload area
- Producto → schema SQL: maps to · Persists product records in MySQL
- Categoria → schema SQL: maps to · Persists category records in MySQL
- Usuario → schema SQL: maps to · Persists user records in MySQL