How evaluationweb/projet-chocoblast works
Project Type and Purpose
• This is a PHP‐based full‐stack web application (named “Chocoblast”) following a classic MVC pattern.
• It delivers server‐rendered HTML pages, uses Composer for dependency management, reads configuration from an .env file, and persists data in a relational database.
File Structure Analysis
• App/
• Controller/ – contains controller logic (routes → handlers)
• Model/ – domain objects and database access methods
• Database/ – database connection/config wrapper
• public/
• index.php – front controller (entry point)
• style/, script/, image/ – static assets served directly
• templates/ – view templates (HTML/PHP)
• composer.json/.env – dependency & configuration
• README.md – setup instructions
Core Components
a. Client (Browser)
b. Web Server (PHP built‐in server or Apache/Nginx + PHP-FPM)
c. Front Controller (public/index.php)
d. Router & Controllers (App/Controller)
e. Model Layer (App/Model)
f. Database Connector (App/Database + .env config)
g. Relational Database (MySQL/PostgreSQL/etc.)
h. Templating Engine (templates/)
i. Static Asset Server (public/style, script, image)
Relationships and Data Flows
• Web Server → Front Controller (index.php)
• Front Controller → Router → Specific Controller Method
• Controller ↔ Model: read/write business data
• Model → Database Connector → Database: SQL queries/results
• Controller → Templating Engine → Generated HTML
• HTML + Asset references → Client
• Static asset requests (CSS/JS/Images) are served directly by the public directory
Architectural Patterns & Principles
• MVC Separation (Controller / Model / View)
• Single Entry‐Point (Front Controller)
• Dependency Injection via Composer packages (if applicable)
• Twelve-Factor App-style environment config (.env)
Step-by-Step Creation
– index.php (Front Controller)
– Router → Controller classes
7. Labels for protocols (HTTP, SQL) and config details (.env).