How 2001uri15/sgssi-proyecto works
Project Type and Purpose
• AlquiCar is a full-stack, containerized PHP web application for car rentals, deployed via Docker Compose.
• It uses Nginx as a reverse proxy, PHP scripts (app/) for business logic and templating, MySQL as the data store, and PHPMyAdmin for database management.
File Structure Analysis
• Top-level artifacts:
• Dockerfile, docker-compose.yml – define containers (web, db, phpmyadmin).
• nginx/ – TLS certs and Nginx configuration.
• app/ – PHP code, CSRF protection, templates, CSS, JavaScript, and PHPMailer integration (external SMTP).
• conf/custom.ini – app-specific settings.
• database.sql( .zip ) – initial schema and seed data.
• logs/ – persistent PHP error log.
• Patterns: monolithic PHP backend serving HTML/CSS/JS, MVC-style separation via app/plantillas (views) and process_* scripts (controllers).
README Insights
• Describes a three-service setup:
1. web (Nginx + PHP-FPM)
2. mysql (persistent storage)
3. phpmyadmin (DB admin interface)
• Ports: 81 for web, 3306 for MySQL, 8080 for PHPMyAdmin.
Main Components
a. Client Browser
b. Nginx Container (reverse proxy, SSL termination)
c. PHP-FPM Application Container (app/ directory mounted, custom.ini)
d. MySQL Container (database.sql import)
e. PHPMyAdmin Container (admin UI for MySQL)
f. External SMTP Service (PHPMailer)
g. Shared Volumes (logs/, app/, conf/)
Relationships and Interactions
• Client → HTTP(S) → Nginx (ports 81/443)
• Nginx → FastCGI → PHP-FPM
• PHP-FPM → SQL queries → MySQL
• Administrator → HTTP → PHPMyAdmin → MySQL
• PHP scripts → SMTP → External mail server (via PHPMailer)
• Volumes mount config, code, and logs between host and containers.
Architectural Patterns & Principles
• Containerization via Docker Compose (isolated services, reproducible environments).
• Clear separation of concerns: web server (NGINX) vs. application logic (PHP-FPM) vs. data (MySQL).
• MVC-style PHP templating (app/plantillas).
• Secure communications: TLS at Nginx, CSRF protection.
• Centralized configuration (conf/custom.ini).
Technologies & Frameworks
• Nginx, PHP-FPM, MySQL, PHP, PHPMailer, Docker, Docker Compose, PHPMyAdmin, JavaScript (validaciones.js), CSS.