System Architecture & Culinary Platform
A custom web application built with PHP and MySQL dedicated to discovering, preparing, and sharing culinary recipes. It features real-time asynchronous search via the Fetch API, a secure membership portal with Bcrypt password hashing, and strict MIME validation for recipe photo uploads.
┌─────────────────────────────────────────────────────────────────────────────┐
│ Cuisinea Full-Stack Web Architecture │
└──────────────────────────────────────┬──────────────────────────────────────┘
│
┌───────────────────────────┼───────────────────────────┐
▼ ▼ ▼
🔍 Moteur Asynchrone (AJAX) 👤 Espace Membre & Sécurité 🍲 Modèle de Données (SQL)
• Fetch API en temps réel • Hash Bcrypt / Argon2 • Tables categories & recipes
• Requête SQL LIKE préparée • Sessions PHP & Rôles • Clés étrangères & Contraintes
• Filtrage par catégories • Envois SMTP (PHPMailer) • Validation MIME binaire
• Injection DOM sans reload • Protection XSS & Uploads • Chargement différé (Lazy)
Instant Asynchronous Search
JavaScript ES6 Fetch API engine querying MySQL databases in real-time without full-page reloads.
Member Area & Security
User registration and login system with cryptographic password hashing and automated SMTP notifications via PHPMailer.
Strict Upload Validation
Binary image verification via getimagesize() and unique sanitized filenames using slugify() and uniqid().
1. Functional Modules & User Journey
Structured around ergonomic modules designed to streamline recipe exploration and community contributions:
Dynamic Homepage Discovery
Random rotation of 3 curated recipes on each visit to provide continuous culinary inspiration.
RAND() SQLCartes dynamiquesBootstrap 5
Detailed Recipe Sheet
Comprehensive presentation featuring line-by-line ingredient breakdowns and numbered step-by-step cooking instructions.
IngrédientsÉtapes pas-à-pasnl2br
Recipe Creation & Management
Secure publishing form for authenticated members with category selectors and validated image uploads.
Upload MIMEslugify()uniqid()
2. Asynchronous Search & SQL Security
The search.php backend executes prepared multi-criteria SQL statements ensuring complete immunity against SQL injection attacks:
// Requête préparée multi-critères sécurisée (search.php)
$sql = "SELECT * FROM recipes
WHERE (? = '' OR title LIKE ?
OR description LIKE ?
OR ingredients LIKE ?)
AND (? = '' OR category_id = ?)";
$stmt = $pdo->prepare($sql);
$stmt->execute([
$searchTerm, "%$searchTerm%", "%$searchTerm%", "%$searchTerm%",
$category, $category
]);
- Universal Full-Text Search: Simultaneous scanning across recipe titles, descriptions, and ingredients using the SQL LIKE operator.
- Category Filtering: Instant filtering by meal category (Starters, Main Courses, Desserts) loaded dynamically via API.
- Empty State Feedback: Friendly and clear notification messages when no recipes match the entered search criteria.
3. MySQL Data Model & Relational Schema
Normalized relational database design preserving data integrity between recipes, categories, and user accounts:
| Table |
Key Columns |
SQL Types |
Description & Constraints |
| categories |
id, name |
INT, VARCHAR(255) |
Recipe meal categories with auto-incremented primary keys. |
| recipes |
id, category_id, title, description, ingredients, instructions, image |
INT, TEXT, VARCHAR(255) |
Recipes linked to categories via foreign keys, with structured ingredient lists and preparation steps. |
| users |
id, first_name, last_name, email, password, role |
INT, VARCHAR(255) |
User accounts with unique email constraints and securely hashed passwords. |
4. Technical Component Matrix
| Component |
Technical Implementation |
User & Performance Advantage |
| Asynchronous Search |
JavaScript ES6 Fetch API + search.php |
Fluid Experience Instant dynamic filtering without page reloads |
| PDO Prepared Statements |
PHP PDO Prepared Statements |
Peak Security Total protection against SQL injection vulnerabilities |
| Upload Sanitization |
getimagesize() + slugify() + uniqid() |
File Integrity Blocks disguised executable files and prevents overwrites |
| Password Hashing |
password_hash() & password_verify() (Bcrypt) |
Data Privacy Industry-standard credential protection using Bcrypt |
Experience Cuisinea Live
Browse the recipe collection, test the real-time search engine, and explore the web interface.
Visit Cuisinea Application ↗