# benali1405/esprit-pw-2a30-2526-kool-healthy architecture

> Architecture diagram of the GitHub repository benali1405/esprit-pw-2a30-2526-kool-healthy, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-30). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/benali1405/esprit-pw-2a30-2526-kool-healthy
- Repository: https://github.com/benali1405/esprit-pw-2a30-2526-kool-healthy

## Overview

Kool Healthy is a PHP wellness application spanning recipes and social features, nutrition planning, gamified challenges, and workout tracking. Users enter through separate recipe and sports front controllers, or interact with the nutrition/gamification pages, then use controllers to update or retrieve domain data. Workout recommendations can query the external WorkoutX API. The repository has no README, and several major subsystems are represented only by the file tree and source index; those branches are shown without speculative internal call links.

Main entry points: [`controllers/ExerciceController.php`](https://github.com/benali1405/esprit-pw-2a30-2526-kool-healthy/blob/main/controllers/ExerciceController.php) (Exercise controller), [`INDEX.php`](https://github.com/benali1405/esprit-pw-2a30-2526-kool-healthy/blob/main/INDEX.php) (Recipe entry), [`CONTROLLER/RecipeC.php`](https://github.com/benali1405/esprit-pw-2a30-2526-kool-healthy/blob/main/CONTROLLER/RecipeC.php) (Recipe controller), [`Gamification/CONTROLLER/DefiController.php`](https://github.com/benali1405/esprit-pw-2a30-2526-kool-healthy/blob/main/Gamification/CONTROLLER/DefiController.php) (Challenge controller)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_recipes["Recipes and community"]
  node_recipe_entry["Recipe entry<br/>[INDEX.php]"]
  node_recipe_controller["Recipe controller<br/>[RecipeC.php]"]
  node_ingredient_controller["Ingredient controller<br/>[IngredientC.php]"]
  node_recipe_model["Recipe model<br/>[Recipe.php]"]
  node_ingredient_model["Ingredient model<br/>[Ingredient.php]"]
  node_recipe_community["Recipe community"]
end

subgraph group_nutrition["Nutrition and gamification"]
  node_nutrition_controller["Nutrition plans<br/>[PlanController.php]"]
  node_meal_model["Meal model<br/>[RepasModel.php]"]
  node_nutrition_plan_controller["Plan controller"]
  node_meal_controller["Plan meal controller"]
  node_plan_model["Nutrition plan model"]
  node_plan_meal_model["Plan meal model<br/>[Repas.php]"]
  node_gamification_page["Challenges and points<br/>[gamification.php]"]
  node_challenge_controller["Challenge controller<br/>[DefiController.php]"]
  node_participation_controller["Participation controller"]
  node_challenge_model["Challenge model<br/>[Defi.php]"]
end

subgraph group_training["Workout tracking"]
  node_sport_entry["Workout entry<br/>[index.php]"]
  node_training_controller["Training controller"]
  node_exercise_controller["Exercise controller"]
  node_admin_controller["Workout admin"]
  node_training_model["Training model"]
  node_knn_model["KNN recommendations<br/>[KnnModel.php]"]
  node_workoutx_service["WorkoutX integration"]
  node_exercise_model["Exercise model<br/>[ExerciceModel.php]"]
  node_performance_model["Performance model"]
end

subgraph group_identity["Identity and persistence"]
  node_auth_entry["Authentication<br/>[auth.php]"]
  node_auth_controller["Auth controller<br/>[AuthController.php]"]
  node_user_model["User model<br/>[User.php]"]
  node_main_database[("Application database<br/>[config.php]")]
  node_sport_database[("Workout database<br/>[Database.php]")]
end

subgraph group_presentation["Application interface"]
  node_workout_views["Workout views<br/>[header.php]"]
  node_main_views["Recipe and nutrition views<br/>[home.php]"]
end

node_user(("User"))
node_workoutx{{"WorkoutX API"}}

node_user -->|"opens"| node_recipe_entry
node_recipe_entry -->|"loads"| node_recipe_controller
node_recipe_entry -->|"loads"| node_ingredient_controller
node_recipe_entry -->|"configures"| node_main_database
node_recipe_controller -->|"uses"| node_recipe_model
node_recipe_controller -->|"uses"| node_ingredient_model
node_ingredient_controller -->|"uses"| node_ingredient_model
node_user -->|"opens"| node_auth_entry
node_auth_entry -->|"uses"| node_auth_controller
node_auth_controller -->|"loads"| node_user_model
node_auth_controller -->|"reads and writes"| node_main_database
node_recipe_controller -.->|"links"| node_recipe_community
node_user -.->|"opens"| node_gamification_page
node_gamification_page -->|"uses"| node_challenge_controller
node_gamification_page -->|"uses"| node_participation_controller
node_challenge_controller -->|"uses"| node_challenge_model
node_challenge_controller -->|"reads and writes"| node_main_database
node_challenge_controller -->|"notifies"| node_participation_controller
node_participation_controller -->|"reads and writes"| node_main_database
node_user -.->|"opens"| node_nutrition_controller
node_nutrition_controller -->|"uses"| node_meal_model
node_nutrition_controller -->|"uses"| node_plan_meal_model
node_user -.->|"opens"| node_nutrition_plan_controller
node_nutrition_plan_controller -->|"uses"| node_plan_model
node_meal_controller -->|"uses"| node_plan_meal_model
node_user -->|"opens"| node_sport_entry
node_sport_entry -->|"routes"| node_training_controller
node_sport_entry -->|"routes"| node_exercise_controller
node_sport_entry -->|"routes"| node_admin_controller
node_training_controller -->|"uses"| node_training_model
node_training_controller -->|"renders"| node_workout_views
node_exercise_controller -->|"uses"| node_exercise_model
node_exercise_controller -->|"uses"| node_training_model
node_exercise_controller -->|"uses"| node_knn_model
node_exercise_controller -->|"uses"| node_performance_model
node_exercise_controller -->|"requests import"| node_workoutx_service
node_workoutx_service -->|"queries"| node_workoutx
node_admin_controller -->|"uses"| node_training_model
node_admin_controller -->|"uses"| node_exercise_model
node_admin_controller -->|"uses"| node_knn_model
node_training_model -->|"connects"| node_sport_database
node_knn_model -->|"connects"| node_sport_database
node_exercise_model -.->|"connects"| node_sport_database
node_performance_model -.->|"connects"| node_sport_database

click node_recipe_entry "https://github.com/benali1405/esprit-pw-2a30-2526-kool-healthy/blob/main/INDEX.php"
click node_recipe_controller "https://github.com/benali1405/esprit-pw-2a30-2526-kool-healthy/blob/main/CONTROLLER/RecipeC.php"
click node_ingredient_controller "https://github.com/benali1405/esprit-pw-2a30-2526-kool-healthy/blob/main/CONTROLLER/IngredientC.php"
click node_recipe_model "https://github.com/benali1405/esprit-pw-2a30-2526-kool-healthy/blob/main/MODEL/Recipe.php"
click node_ingredient_model "https://github.com/benali1405/esprit-pw-2a30-2526-kool-healthy/blob/main/MODEL/Ingredient.php"
click node_recipe_community "https://github.com/benali1405/esprit-pw-2a30-2526-kool-healthy/blob/main/CONTROLLER/RecetteController.php"
click node_auth_entry "https://github.com/benali1405/esprit-pw-2a30-2526-kool-healthy/blob/main/VIEW/auth.php"
click node_auth_controller "https://github.com/benali1405/esprit-pw-2a30-2526-kool-healthy/blob/main/CONTROLLER/AuthController.php"
click node_user_model "https://github.com/benali1405/esprit-pw-2a30-2526-kool-healthy/blob/main/MODEL/User.php"
click node_main_database "https://github.com/benali1405/esprit-pw-2a30-2526-kool-healthy/blob/main/config.php"
click node_nutrition_controller "https://github.com/benali1405/esprit-pw-2a30-2526-kool-healthy/blob/main/CONTROLLER/PlanController.php"
click node_meal_model "https://github.com/benali1405/esprit-pw-2a30-2526-kool-healthy/blob/main/MODEL/RepasModel.php"
click node_nutrition_plan_controller "https://github.com/benali1405/esprit-pw-2a30-2526-kool-healthy/blob/main/Gamification/PlanNutritionnel/CONTROLLER/PlanNutritionnelController.php"
click node_meal_controller "https://github.com/benali1405/esprit-pw-2a30-2526-kool-healthy/blob/main/Gamification/PlanNutritionnel/CONTROLLER/RepasController.php"
click node_plan_model "https://github.com/benali1405/esprit-pw-2a30-2526-kool-healthy/blob/main/Gamification/PlanNutritionnel/MODEL/PlanNutritionnel.php"
click node_plan_meal_model "https://github.com/benali1405/esprit-pw-2a30-2526-kool-healthy/blob/main/Gamification/PlanNutritionnel/MODEL/Repas.php"
click node_gamification_page "https://github.com/benali1405/esprit-pw-2a30-2526-kool-healthy/blob/main/Gamification/VIEW/gamification.php"
click node_challenge_controller "https://github.com/benali1405/esprit-pw-2a30-2526-kool-healthy/blob/main/Gamification/CONTROLLER/DefiController.php"
click node_participation_controller "https://github.com/benali1405/esprit-pw-2a30-2526-kool-healthy/blob/main/Gamification/CONTROLLER/ParticipationController.php"
click node_challenge_model "https://github.com/benali1405/esprit-pw-2a30-2526-kool-healthy/blob/main/Gamification/MODEL/Defi.php"
click node_sport_entry "https://github.com/benali1405/esprit-pw-2a30-2526-kool-healthy/blob/main/sport/index.php"
click node_training_controller "https://github.com/benali1405/esprit-pw-2a30-2526-kool-healthy/blob/main/controllers/EntrainementController.php"
click node_exercise_controller "https://github.com/benali1405/esprit-pw-2a30-2526-kool-healthy/blob/main/controllers/ExerciceController.php"
click node_admin_controller "https://github.com/benali1405/esprit-pw-2a30-2526-kool-healthy/blob/main/controllers/AdminController.php"
click node_training_model "https://github.com/benali1405/esprit-pw-2a30-2526-kool-healthy/blob/main/models/EntrainementModel.php"
click node_knn_model "https://github.com/benali1405/esprit-pw-2a30-2526-kool-healthy/blob/main/models/KnnModel.php"
click node_workoutx_service "https://github.com/benali1405/esprit-pw-2a30-2526-kool-healthy/blob/main/services/WorkoutXApiService.php"
click node_exercise_model "https://github.com/benali1405/esprit-pw-2a30-2526-kool-healthy/blob/main/models/ExerciceModel.php"
click node_performance_model "https://github.com/benali1405/esprit-pw-2a30-2526-kool-healthy/blob/main/models/PerformanceModel.php"
click node_sport_database "https://github.com/benali1405/esprit-pw-2a30-2526-kool-healthy/blob/main/config/Database.php"
click node_workout_views "https://github.com/benali1405/esprit-pw-2a30-2526-kool-healthy/blob/main/views/layout/header.php"
click node_main_views "https://github.com/benali1405/esprit-pw-2a30-2526-kool-healthy/blob/main/VIEW/home.php"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_recipe_entry,node_recipe_controller,node_ingredient_controller,node_recipe_model,node_ingredient_model,node_recipe_community,node_user toneBlue
class node_nutrition_controller,node_meal_model,node_nutrition_plan_controller,node_meal_controller,node_plan_model,node_plan_meal_model,node_gamification_page,node_challenge_controller,node_participation_controller,node_challenge_model toneAmber
class node_sport_entry,node_training_controller,node_exercise_controller,node_admin_controller,node_training_model,node_knn_model,node_workoutx_service,node_exercise_model,node_performance_model,node_workoutx toneMint
class node_auth_entry,node_auth_controller,node_user_model,node_main_database,node_sport_database toneRose
class node_workout_views,node_main_views toneIndigo
```

## Components

### Recipes and community

- [Recipe entry](https://github.com/benali1405/esprit-pw-2a30-2526-kool-healthy/blob/main/INDEX.php): `INDEX.php`
- [Recipe controller](https://github.com/benali1405/esprit-pw-2a30-2526-kool-healthy/blob/main/CONTROLLER/RecipeC.php): `CONTROLLER/RecipeC.php`
- [Ingredient controller](https://github.com/benali1405/esprit-pw-2a30-2526-kool-healthy/blob/main/CONTROLLER/IngredientC.php): `CONTROLLER/IngredientC.php`
- [Recipe model](https://github.com/benali1405/esprit-pw-2a30-2526-kool-healthy/blob/main/MODEL/Recipe.php): `MODEL/Recipe.php`
- [Ingredient model](https://github.com/benali1405/esprit-pw-2a30-2526-kool-healthy/blob/main/MODEL/Ingredient.php): `MODEL/Ingredient.php`
- [Recipe community](https://github.com/benali1405/esprit-pw-2a30-2526-kool-healthy/blob/main/CONTROLLER/RecetteController.php): `CONTROLLER/RecetteController.php`

### Nutrition and gamification

- [Nutrition plans](https://github.com/benali1405/esprit-pw-2a30-2526-kool-healthy/blob/main/CONTROLLER/PlanController.php): `CONTROLLER/PlanController.php`
- [Meal model](https://github.com/benali1405/esprit-pw-2a30-2526-kool-healthy/blob/main/MODEL/RepasModel.php): `MODEL/RepasModel.php`
- [Plan controller](https://github.com/benali1405/esprit-pw-2a30-2526-kool-healthy/blob/main/Gamification/PlanNutritionnel/CONTROLLER/PlanNutritionnelController.php): `Gamification/PlanNutritionnel/CONTROLLER/PlanNutritionnelController.php`
- [Plan meal controller](https://github.com/benali1405/esprit-pw-2a30-2526-kool-healthy/blob/main/Gamification/PlanNutritionnel/CONTROLLER/RepasController.php): `Gamification/PlanNutritionnel/CONTROLLER/RepasController.php`
- [Nutrition plan model](https://github.com/benali1405/esprit-pw-2a30-2526-kool-healthy/blob/main/Gamification/PlanNutritionnel/MODEL/PlanNutritionnel.php): `Gamification/PlanNutritionnel/MODEL/PlanNutritionnel.php`
- [Plan meal model](https://github.com/benali1405/esprit-pw-2a30-2526-kool-healthy/blob/main/Gamification/PlanNutritionnel/MODEL/Repas.php): `Gamification/PlanNutritionnel/MODEL/Repas.php`
- [Challenges and points](https://github.com/benali1405/esprit-pw-2a30-2526-kool-healthy/blob/main/Gamification/VIEW/gamification.php): `Gamification/VIEW/gamification.php`
- [Challenge controller](https://github.com/benali1405/esprit-pw-2a30-2526-kool-healthy/blob/main/Gamification/CONTROLLER/DefiController.php): `Gamification/CONTROLLER/DefiController.php`
- [Participation controller](https://github.com/benali1405/esprit-pw-2a30-2526-kool-healthy/blob/main/Gamification/CONTROLLER/ParticipationController.php): `Gamification/CONTROLLER/ParticipationController.php`
- [Challenge model](https://github.com/benali1405/esprit-pw-2a30-2526-kool-healthy/blob/main/Gamification/MODEL/Defi.php): `Gamification/MODEL/Defi.php`

### Workout tracking

- [Workout entry](https://github.com/benali1405/esprit-pw-2a30-2526-kool-healthy/blob/main/sport/index.php): `sport/index.php`
- [Training controller](https://github.com/benali1405/esprit-pw-2a30-2526-kool-healthy/blob/main/controllers/EntrainementController.php): `controllers/EntrainementController.php`
- [Exercise controller](https://github.com/benali1405/esprit-pw-2a30-2526-kool-healthy/blob/main/controllers/ExerciceController.php): `controllers/ExerciceController.php`
- [Workout admin](https://github.com/benali1405/esprit-pw-2a30-2526-kool-healthy/blob/main/controllers/AdminController.php): `controllers/AdminController.php`
- [Training model](https://github.com/benali1405/esprit-pw-2a30-2526-kool-healthy/blob/main/models/EntrainementModel.php): `models/EntrainementModel.php`
- [KNN recommendations](https://github.com/benali1405/esprit-pw-2a30-2526-kool-healthy/blob/main/models/KnnModel.php): `models/KnnModel.php`
- [WorkoutX integration](https://github.com/benali1405/esprit-pw-2a30-2526-kool-healthy/blob/main/services/WorkoutXApiService.php): `services/WorkoutXApiService.php`
- [Exercise model](https://github.com/benali1405/esprit-pw-2a30-2526-kool-healthy/blob/main/models/ExerciceModel.php): `models/ExerciceModel.php`
- [Performance model](https://github.com/benali1405/esprit-pw-2a30-2526-kool-healthy/blob/main/models/PerformanceModel.php): `models/PerformanceModel.php`

### Identity and persistence

- [Authentication](https://github.com/benali1405/esprit-pw-2a30-2526-kool-healthy/blob/main/VIEW/auth.php): `VIEW/auth.php`
- [Auth controller](https://github.com/benali1405/esprit-pw-2a30-2526-kool-healthy/blob/main/CONTROLLER/AuthController.php): `CONTROLLER/AuthController.php`
- [User model](https://github.com/benali1405/esprit-pw-2a30-2526-kool-healthy/blob/main/MODEL/User.php): `MODEL/User.php`
- [Application database](https://github.com/benali1405/esprit-pw-2a30-2526-kool-healthy/blob/main/config.php): `config.php`
- [Workout database](https://github.com/benali1405/esprit-pw-2a30-2526-kool-healthy/blob/main/config/Database.php): `config/Database.php`

### Application interface

- [Workout views](https://github.com/benali1405/esprit-pw-2a30-2526-kool-healthy/blob/main/views/layout/header.php): `views/layout/header.php`
- [Recipe and nutrition views](https://github.com/benali1405/esprit-pw-2a30-2526-kool-healthy/blob/main/VIEW/home.php): `VIEW/home.php`

### Other components

- **User**
- **WorkoutX API**

## Connections

- User → Recipe entry: opens (evidence: `INDEX.php`)
- Recipe entry → Recipe controller: loads (evidence: `INDEX.php`)
- Recipe entry → Ingredient controller: loads (evidence: `INDEX.php`)
- Recipe entry → Application database: configures (evidence: `INDEX.php`)
- Recipe controller → Recipe model: uses (evidence: `CONTROLLER/RecipeC.php`)
- Recipe controller → Ingredient model: uses (evidence: `CONTROLLER/RecipeC.php`)
- Ingredient controller → Ingredient model: uses (evidence: `CONTROLLER/IngredientC.php`)
- User → Authentication: opens (evidence: `VIEW/auth.php`)
- Authentication → Auth controller: uses (evidence: `VIEW/auth.php`)
- Auth controller → User model: loads (evidence: `CONTROLLER/AuthController.php`)
- Auth controller → Application database: reads and writes (evidence: `CONTROLLER/AuthController.php`)
- Recipe controller → Recipe community: links
- User → Challenges and points: opens
- Challenges and points → Challenge controller: uses (evidence: `Gamification/VIEW/gamification.php`)
- Challenges and points → Participation controller: uses (evidence: `Gamification/VIEW/gamification.php`)
- Challenge controller → Challenge model: uses (evidence: `Gamification/CONTROLLER/DefiController.php`)
- Challenge controller → Application database: reads and writes (evidence: `Gamification/CONTROLLER/DefiController.php`)
- Challenge controller → Participation controller: notifies (evidence: `Gamification/CONTROLLER/DefiController.php`)
- Participation controller → Application database: reads and writes (evidence: `Gamification/CONTROLLER/ParticipationController.php`)
- User → Nutrition plans: opens
- Nutrition plans → Meal model: uses (evidence: `CONTROLLER/PlanController.php`)
- Nutrition plans → Plan meal model: uses (evidence: `CONTROLLER/PlanController.php`)
- User → Plan controller: opens
- Plan controller → Nutrition plan model: uses (evidence: `Gamification/PlanNutritionnel/CONTROLLER/PlanNutritionnelController.php`)
- Plan meal controller → Plan meal model: uses (evidence: `Gamification/PlanNutritionnel/CONTROLLER/RepasController.php`)
- User → Workout entry: opens (evidence: `sport/index.php`)
- Workout entry → Training controller: routes (evidence: `sport/index.php`)
- Workout entry → Exercise controller: routes (evidence: `sport/index.php`)
- Workout entry → Workout admin: routes (evidence: `sport/index.php`)
- Training controller → Training model: uses (evidence: `controllers/EntrainementController.php`)
- Training controller → Workout views: renders (evidence: `controllers/EntrainementController.php`)
- Exercise controller → Exercise model: uses (evidence: `controllers/ExerciceController.php`)
- Exercise controller → Training model: uses (evidence: `controllers/ExerciceController.php`)
- Exercise controller → KNN recommendations: uses (evidence: `controllers/ExerciceController.php`)
- Exercise controller → Performance model: uses (evidence: `controllers/ExerciceController.php`)
- Exercise controller → WorkoutX integration: requests import (evidence: `controllers/ExerciceController.php`)
- WorkoutX integration → WorkoutX API: queries (evidence: `services/WorkoutXApiService.php`)
- Workout admin → Training model: uses (evidence: `controllers/AdminController.php`)
- Workout admin → Exercise model: uses (evidence: `controllers/AdminController.php`)
- Workout admin → KNN recommendations: uses (evidence: `controllers/AdminController.php`)
- Training model → Workout database: connects (evidence: `models/EntrainementModel.php`)
- KNN recommendations → Workout database: connects (evidence: `models/KnnModel.php`)
- Exercise model → Workout database: connects (evidence: `models/ExerciceModel.php`)
- Performance model → Workout database: connects (evidence: `models/PerformanceModel.php`)
