# naimisha1169/food-recommendation-system-project architecture

> Architecture diagram of the GitHub repository naimisha1169/food-recommendation-system-project, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-13). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/naimisha1169/food-recommendation-system-project
- Repository: https://github.com/naimisha1169/food-recommendation-system-project

## Overview

This Flask application turns a user's biometrics and food preferences into ranked Indian-dish recommendations, using a calorie target, weighted penalties, and a hard allergy exclusion. Its main flow runs from the form through recommendation logic to a results page. A separate data-preparation script converts nutrition CSV rows into the JSON dataset used at runtime. The README documents regional and dietary segmentation and Vercel deployment; source excerpts do not show template internals or deployment wiring, so those connections are not asserted.

Main entry points: [`app.py`](https://github.com/naimisha1169/food-recommendation-system-project/blob/master/app.py) (Recommendation handler), [`process_data.py`](https://github.com/naimisha1169/food-recommendation-system-project/blob/master/process_data.py) (Nutrition processor), [`templates/index.html`](https://github.com/naimisha1169/food-recommendation-system-project/blob/master/templates/index.html) (Preference form), [`dishes.json`](https://github.com/naimisha1169/food-recommendation-system-project/blob/master/dishes.json) (Dish dataset)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web experience"]
  node_form["Preference form<br/>[index.html]"]
  node_results["Ranked results<br/>[results.html]"]
end

subgraph group_recommend["Recommendation logic"]
  node_recommend_route["Recommendation handler<br/>[app.py]"]
  node_calorie["Meal target<br/>[app.py]"]
  node_allergy["Allergy guard<br/>[app.py]"]
  node_scoring["Dish scoring<br/>[app.py]"]
end

subgraph group_data["Food data pipeline"]
  node_nutrition_csv["Nutrition source"]
  node_processor["Nutrition processor<br/>[process_data.py]"]
  node_dish_data[("Dish dataset<br/>[dishes.json]")]
end

node_user(("Food seeker"))
node_vercel["Vercel"]

node_user -.->|"enters preferences"| node_form
node_form -.->|"submits request"| node_recommend_route
node_recommend_route -->|"calculates target"| node_calorie
node_recommend_route -->|"checks allergens"| node_allergy
node_recommend_route -->|"scores dishes"| node_scoring
node_recommend_route -->|"loads dataset"| node_dish_data
node_recommend_route -->|"renders results"| node_results
node_processor -->|"reads rows"| node_nutrition_csv
node_processor -->|"writes dishes"| node_dish_data
node_vercel -.->|"hosts app"| node_recommend_route

click node_form "https://github.com/naimisha1169/food-recommendation-system-project/blob/master/templates/index.html"
click node_recommend_route "https://github.com/naimisha1169/food-recommendation-system-project/blob/master/app.py"
click node_calorie "https://github.com/naimisha1169/food-recommendation-system-project/blob/master/app.py"
click node_allergy "https://github.com/naimisha1169/food-recommendation-system-project/blob/master/app.py"
click node_scoring "https://github.com/naimisha1169/food-recommendation-system-project/blob/master/app.py"
click node_results "https://github.com/naimisha1169/food-recommendation-system-project/blob/master/templates/results.html"
click node_nutrition_csv "https://github.com/naimisha1169/food-recommendation-system-project/blob/master/Indian_Food_Nutrition_Processed.csv"
click node_processor "https://github.com/naimisha1169/food-recommendation-system-project/blob/master/process_data.py"
click node_dish_data "https://github.com/naimisha1169/food-recommendation-system-project/blob/master/dishes.json"

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_form,node_results toneBlue
class node_recommend_route,node_calorie,node_allergy,node_scoring toneAmber
class node_nutrition_csv,node_processor,node_dish_data toneMint
class node_user,node_vercel toneIndigo
```

## Components

### Web experience

- [Preference form](https://github.com/naimisha1169/food-recommendation-system-project/blob/master/templates/index.html): `templates/index.html`
- [Ranked results](https://github.com/naimisha1169/food-recommendation-system-project/blob/master/templates/results.html): `templates/results.html`

### Recommendation logic

- [Recommendation handler](https://github.com/naimisha1169/food-recommendation-system-project/blob/master/app.py): `app.py`
- [Meal target](https://github.com/naimisha1169/food-recommendation-system-project/blob/master/app.py): `app.py`
- [Allergy guard](https://github.com/naimisha1169/food-recommendation-system-project/blob/master/app.py): `app.py`
- [Dish scoring](https://github.com/naimisha1169/food-recommendation-system-project/blob/master/app.py): `app.py`

### Food data pipeline

- [Nutrition source](https://github.com/naimisha1169/food-recommendation-system-project/blob/master/Indian_Food_Nutrition_Processed.csv): `Indian_Food_Nutrition_Processed.csv`
- [Nutrition processor](https://github.com/naimisha1169/food-recommendation-system-project/blob/master/process_data.py): `process_data.py`
- [Dish dataset](https://github.com/naimisha1169/food-recommendation-system-project/blob/master/dishes.json): `dishes.json`

### Other components

- **Food seeker**
- **Vercel**

## Connections

- Food seeker → Preference form: enters preferences (evidence: `README.md`)
- Preference form → Recommendation handler: submits request (evidence: `README.md`)
- Recommendation handler → Meal target: calculates target (evidence: `app.py`)
- Recommendation handler → Allergy guard: checks allergens (evidence: `app.py`)
- Recommendation handler → Dish scoring: scores dishes (evidence: `app.py`)
- Recommendation handler → Dish dataset: loads dataset (evidence: `app.py`)
- Recommendation handler → Ranked results: renders results (evidence: `app.py`)
- Nutrition processor → Nutrition source: reads rows (evidence: `process_data.py`)
- Nutrition processor → Dish dataset: writes dishes (evidence: `process_data.py`)
- Vercel → Recommendation handler: hosts app (evidence: `README.md`)
