# redward42/data-diet-app architecture

> Architecture diagram of the GitHub repository redward42/data-diet-app, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-21). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/redward42/data-diet-app
- Repository: https://github.com/redward42/data-diet-app

## Overview

Data Diet is a React app for searching Spoonacular recipes and viewing nutrition information. The user submits a food query and can toggle ingredient exclusions; the app fetches a recipe and displays its nutrient summary and macro chart. The README describes broader dashboard filtering, but the sampled App implementation instead handles a single recipe and ingredient exclusions. The chart implementation and app/API interactions are visible in the excerpts; the API itself is external.

Main entry points: [`src/App.tsx`](https://github.com/RedWARd42/data-diet-app/blob/main/src/App.tsx) (Search and recipe details), [`src/components/BarChart.tsx`](https://github.com/RedWARd42/data-diet-app/blob/main/src/components/BarChart.tsx) (Macro bar chart), [`src/main.tsx`](https://github.com/RedWARd42/data-diet-app/blob/main/src/main.tsx) (React entry point)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Recipe app"]
  node_bootstrap["React entry point<br/>[main.tsx]"]
  node_recipe_app["Search and recipe details<br/>[App.tsx]"]
end

subgraph group_visualization["Nutrition visualization"]
  node_macro_chart["Macro bar chart<br/>[BarChart.tsx]"]
end

subgraph group_external["External services"]
  node_spoonacular{{"Spoonacular API"}}
  node_recharts["Recharts"]
end

node_user(("User"))

node_user -->|"searches and filters"| node_recipe_app
node_bootstrap -->|"mounts"| node_recipe_app
node_recipe_app -->|"fetches recipes"| node_spoonacular
node_spoonacular -->|"returns results"| node_recipe_app
node_recipe_app -->|"passes macro values"| node_macro_chart
node_macro_chart -->|"renders with"| node_recharts

click node_bootstrap "https://github.com/RedWARd42/data-diet-app/blob/main/src/main.tsx"
click node_recipe_app "https://github.com/RedWARd42/data-diet-app/blob/main/src/App.tsx"
click node_macro_chart "https://github.com/RedWARd42/data-diet-app/blob/main/src/components/BarChart.tsx"

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_bootstrap,node_recipe_app,node_user toneBlue
class node_macro_chart toneAmber
class node_spoonacular,node_recharts toneMint
```

## Components

### Recipe app

- [React entry point](https://github.com/RedWARd42/data-diet-app/blob/main/src/main.tsx): `src/main.tsx`
- [Search and recipe details](https://github.com/RedWARd42/data-diet-app/blob/main/src/App.tsx): `src/App.tsx`

### Nutrition visualization

- [Macro bar chart](https://github.com/RedWARd42/data-diet-app/blob/main/src/components/BarChart.tsx): `src/components/BarChart.tsx`

### External services

- **Spoonacular API**
- **Recharts**

### Other components

- **User**

## Connections

- User → Search and recipe details: searches and filters (evidence: `src/App.tsx`)
- React entry point → Search and recipe details: mounts (evidence: `src/main.tsx`)
- Search and recipe details → Spoonacular API: fetches recipes (evidence: `src/App.tsx`)
- Spoonacular API → Search and recipe details: returns results (evidence: `src/App.tsx`)
- Search and recipe details → Macro bar chart: passes macro values (evidence: `src/App.tsx`)
- Macro bar chart → Recharts: renders with (evidence: `src/components/BarChart.tsx`)
