# jaya-surya1602/diet-workout-recommendation-system-using-machine-learning-python architecture

> Architecture diagram of the GitHub repository jaya-surya1602/diet-workout-recommendation-system-using-machine-learning-python, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-26). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/jaya-surya1602/diet-workout-recommendation-system-using-machine-learning-python
- Repository: https://github.com/jaya-surya1602/diet-workout-recommendation-system-using-machine-learning-python

## Overview

This is a Flask web app that collects a user’s diet, fitness, lifestyle, and health details, requests a tailored plan from Gemini, parses the response into recommendation sections, and renders the result. The sampled source shows the routes and server-side flow; the template and README were not sampled, so the form’s exact structure and user interactions are not verified.

Main entry points: [`Diet-Workout-Recommendation-System-Using-Machine-Learning-Python-master/main.py`](https://github.com/jaya-surya1602/diet-workout-recommendation-system-using-machine-learning-python/blob/main/Diet-Workout-Recommendation-System-Using-Machine-Learning-Python-master/main.py) (Gemini API client), [`Diet-Workout-Recommendation-System-Using-Machine-Learning-Python-master/templates/index.html`](https://github.com/jaya-surya1602/diet-workout-recommendation-system-using-machine-learning-python/blob/main/Diet-Workout-Recommendation-System-Using-Machine-Learning-Python-master/templates/index.html) (Rendered plan)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web interface"]
  node_flask_app["Flask app<br/>[main.py]"]
  node_input_form["Profile form<br/>[index.html]"]
  node_profile_capture["Profile capture<br/>[main.py]"]
  node_result_view["Rendered plan<br/>[index.html]"]
end

subgraph group_recommendations["Recommendation generation"]
  node_prompt_builder["Plan prompt<br/>[main.py]"]
  node_gemini_client["Gemini API client<br/>[main.py]"]
  node_response_parser["Response parser<br/>[main.py]"]
  node_recommendation_data["Plan sections<br/>[main.py]"]
end

node_user(("User"))
node_gemini["Gemini service"]

node_user -->|"opens page"| node_flask_app
node_flask_app -->|"renders page"| node_input_form
node_user -.->|"submits profile"| node_profile_capture
node_profile_capture -->|"passes profile"| node_prompt_builder
node_prompt_builder -->|"builds request"| node_gemini_client
node_gemini_client -->|"sends prompt"| node_gemini
node_gemini -->|"returns text"| node_gemini_client
node_gemini_client -->|"passes text"| node_response_parser
node_response_parser -->|"extracts sections"| node_recommendation_data
node_flask_app -->|"renders plan"| node_result_view
node_recommendation_data -->|"supplies results"| node_result_view

click node_flask_app "https://github.com/jaya-surya1602/diet-workout-recommendation-system-using-machine-learning-python/blob/main/Diet-Workout-Recommendation-System-Using-Machine-Learning-Python-master/main.py"
click node_input_form "https://github.com/jaya-surya1602/diet-workout-recommendation-system-using-machine-learning-python/blob/main/Diet-Workout-Recommendation-System-Using-Machine-Learning-Python-master/templates/index.html"
click node_profile_capture "https://github.com/jaya-surya1602/diet-workout-recommendation-system-using-machine-learning-python/blob/main/Diet-Workout-Recommendation-System-Using-Machine-Learning-Python-master/main.py"
click node_prompt_builder "https://github.com/jaya-surya1602/diet-workout-recommendation-system-using-machine-learning-python/blob/main/Diet-Workout-Recommendation-System-Using-Machine-Learning-Python-master/main.py"
click node_gemini_client "https://github.com/jaya-surya1602/diet-workout-recommendation-system-using-machine-learning-python/blob/main/Diet-Workout-Recommendation-System-Using-Machine-Learning-Python-master/main.py"
click node_response_parser "https://github.com/jaya-surya1602/diet-workout-recommendation-system-using-machine-learning-python/blob/main/Diet-Workout-Recommendation-System-Using-Machine-Learning-Python-master/main.py"
click node_recommendation_data "https://github.com/jaya-surya1602/diet-workout-recommendation-system-using-machine-learning-python/blob/main/Diet-Workout-Recommendation-System-Using-Machine-Learning-Python-master/main.py"
click node_result_view "https://github.com/jaya-surya1602/diet-workout-recommendation-system-using-machine-learning-python/blob/main/Diet-Workout-Recommendation-System-Using-Machine-Learning-Python-master/templates/index.html"

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_flask_app,node_input_form,node_profile_capture,node_result_view,node_user toneBlue
class node_prompt_builder,node_gemini_client,node_response_parser,node_recommendation_data toneAmber
class node_gemini toneIndigo
```

## Components

### Web interface

- [Flask app](https://github.com/jaya-surya1602/diet-workout-recommendation-system-using-machine-learning-python/blob/main/Diet-Workout-Recommendation-System-Using-Machine-Learning-Python-master/main.py): `Diet-Workout-Recommendation-System-Using-Machine-Learning-Python-master/main.py`
- [Profile form](https://github.com/jaya-surya1602/diet-workout-recommendation-system-using-machine-learning-python/blob/main/Diet-Workout-Recommendation-System-Using-Machine-Learning-Python-master/templates/index.html): `Diet-Workout-Recommendation-System-Using-Machine-Learning-Python-master/templates/index.html`
- [Profile capture](https://github.com/jaya-surya1602/diet-workout-recommendation-system-using-machine-learning-python/blob/main/Diet-Workout-Recommendation-System-Using-Machine-Learning-Python-master/main.py): `Diet-Workout-Recommendation-System-Using-Machine-Learning-Python-master/main.py`
- [Rendered plan](https://github.com/jaya-surya1602/diet-workout-recommendation-system-using-machine-learning-python/blob/main/Diet-Workout-Recommendation-System-Using-Machine-Learning-Python-master/templates/index.html): `Diet-Workout-Recommendation-System-Using-Machine-Learning-Python-master/templates/index.html`

### Recommendation generation

- [Plan prompt](https://github.com/jaya-surya1602/diet-workout-recommendation-system-using-machine-learning-python/blob/main/Diet-Workout-Recommendation-System-Using-Machine-Learning-Python-master/main.py): `Diet-Workout-Recommendation-System-Using-Machine-Learning-Python-master/main.py`
- [Gemini API client](https://github.com/jaya-surya1602/diet-workout-recommendation-system-using-machine-learning-python/blob/main/Diet-Workout-Recommendation-System-Using-Machine-Learning-Python-master/main.py): `Diet-Workout-Recommendation-System-Using-Machine-Learning-Python-master/main.py`
- [Response parser](https://github.com/jaya-surya1602/diet-workout-recommendation-system-using-machine-learning-python/blob/main/Diet-Workout-Recommendation-System-Using-Machine-Learning-Python-master/main.py): `Diet-Workout-Recommendation-System-Using-Machine-Learning-Python-master/main.py`
- [Plan sections](https://github.com/jaya-surya1602/diet-workout-recommendation-system-using-machine-learning-python/blob/main/Diet-Workout-Recommendation-System-Using-Machine-Learning-Python-master/main.py): `Diet-Workout-Recommendation-System-Using-Machine-Learning-Python-master/main.py`

### Other components

- **User**
- **Gemini service**

## Connections

- User → Flask app: opens page (evidence: `Diet-Workout-Recommendation-System-Using-Machine-Learning-Python-master/main.py`)
- Flask app → Profile form: renders page (evidence: `Diet-Workout-Recommendation-System-Using-Machine-Learning-Python-master/main.py`)
- User → Profile capture: submits profile
- Profile capture → Plan prompt: passes profile (evidence: `Diet-Workout-Recommendation-System-Using-Machine-Learning-Python-master/main.py`)
- Plan prompt → Gemini API client: builds request (evidence: `Diet-Workout-Recommendation-System-Using-Machine-Learning-Python-master/main.py`)
- Gemini API client → Gemini service: sends prompt (evidence: `Diet-Workout-Recommendation-System-Using-Machine-Learning-Python-master/main.py`)
- Gemini service → Gemini API client: returns text (evidence: `Diet-Workout-Recommendation-System-Using-Machine-Learning-Python-master/main.py`)
- Gemini API client → Response parser: passes text (evidence: `Diet-Workout-Recommendation-System-Using-Machine-Learning-Python-master/main.py`)
- Response parser → Plan sections: extracts sections (evidence: `Diet-Workout-Recommendation-System-Using-Machine-Learning-Python-master/main.py`)
- Flask app → Rendered plan: renders plan (evidence: `Diet-Workout-Recommendation-System-Using-Machine-Learning-Python-master/main.py`)
- Plan sections → Rendered plan: supplies results (evidence: `Diet-Workout-Recommendation-System-Using-Machine-Learning-Python-master/main.py`)
