How seb4s-dl/tienda-perfumes works
Project type and purpose
• This is a monolithic, full-stack PHP e-commerce application (“Tienda-Perfumes”) that provides an online storefront for browsing products, managing a shopping cart, processing orders, and administering products/orders.
File structure
• Top-level dirs:
• assets/ (CSS, images) – static frontend resources
• js/ (JavaScript) – client-side logic for cart interactions, order management
• pages/ (PHP view templates + controllers) – renders HTML pages
• backend/ (PHP API scripts) – AJAX endpoints for CRUD and business logic
• includes/ (header, footer, session validation) – shared UI fragments & auth checks
• db/ (db connection, SQL dumps) – MySQL schema & connection utility
• uploads/ – persistent storage for uploaded product images
• index.php – entry point routing to pages/
• db/db.php – encapsulates database connection
README
• Minimal (“# Tienda-Perfumes”), so we infer purpose from file names and folder organization.
Components
a. Main components
1. Client (Web Browser)
2. Web Server + PHP Application
– Static Asset Server (serves assets/css & assets/img)
– PHP View Layer (pages/*.php + includes/)
– PHP API Layer (backend/*.php)
3. Database (MySQL)
4. File Storage (uploads/)
b. Relationships and interactions
• Browser requests HTML via index.php → pages/*.php (with header/footer)
• Browser loads CSS/JS/images directly from assets/
• pages/*.php issue SQL queries via db/db.php to MySQL
• Client-side JavaScript calls backend/*.php endpoints for operations (add to cart, register, login, CRUD)
• Backend scripts read/write to MySQL and upload/delete files in uploads/
c. Architectural patterns and design principles
• Monolithic PHP MVC-like structure (pages = view+controller, backend = API endpoints, includes = shared components)
• Separation of concerns: static assets vs view templates vs business logic vs data persistence
• REST-ish endpoints for AJAX interactions (e.g., carrito.php, listar_productos.php)
d. Technologies & frameworks
• PHP 7+ (plain PHP files, no framework)
• MySQL (SQL scripts in db/)
• HTML/CSS (assets/css)
• JavaScript (vanilla, AJAX calls in js/)
• Apache/Nginx (assumed web server)