# energyz0r/caloriescounter architecture

> Architecture diagram of the GitHub repository energyz0r/caloriescounter, 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/energyz0r/caloriescounter
- Repository: https://github.com/energyz0r/caloriescounter

## Overview

CaloriesCounter is a small ASP.NET Core MVC calorie tracker. A user reaches the Home controller through the default route, where food items can be added, edited, deleted, and listed with a summed calorie total; the controller keeps items in a static in-memory list. The controller uses the FoodItem model and returns MVC views. The tree identifies Index and Edit views, but their contents and form wiring were not sampled, so those interactions are not inferred. No persistent database is shown.

Main entry points: [`Controllers/HomeController.cs`](https://github.com/energyz0r/caloriescounter/blob/main/Controllers/HomeController.cs) (Home actions), [`Program.cs`](https://github.com/energyz0r/caloriescounter/blob/main/Program.cs) (MVC startup), [`Models/FoodItems.cs`](https://github.com/energyz0r/caloriescounter/blob/main/Models/FoodItems.cs) (Food item), [`Views/Home/Index.cshtml`](https://github.com/energyz0r/caloriescounter/blob/main/Views/Home/Index.cshtml) (Food list)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Web runtime"]
  node_startup["MVC startup<br/>[Program.cs]"]
end

subgraph group_tracking["Food tracking"]
  node_home["Home actions<br/>[HomeController.cs]"]
  node_food["Food item<br/>[FoodItems.cs]"]
end

subgraph group_ui["User interface"]
  node_index["Food list<br/>[Index.cshtml]"]
  node_edit["Edit form<br/>[Edit.cshtml]"]
end

node_user(("User"))

node_user -->|"sends requests"| node_startup
node_startup -->|"routes requests"| node_home
node_home -->|"uses model"| node_food
node_home -->|"returns list view"| node_index
node_home -->|"returns edit view"| node_edit

click node_startup "https://github.com/energyz0r/caloriescounter/blob/main/Program.cs"
click node_home "https://github.com/energyz0r/caloriescounter/blob/main/Controllers/HomeController.cs"
click node_food "https://github.com/energyz0r/caloriescounter/blob/main/Models/FoodItems.cs"
click node_index "https://github.com/energyz0r/caloriescounter/blob/main/Views/Home/Index.cshtml"
click node_edit "https://github.com/energyz0r/caloriescounter/blob/main/Views/Home/Edit.cshtml"

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_startup,node_user toneBlue
class node_home,node_food toneAmber
class node_index,node_edit toneMint
```

## Components

### Web runtime

- [MVC startup](https://github.com/energyz0r/caloriescounter/blob/main/Program.cs): `Program.cs`

### Food tracking

- [Home actions](https://github.com/energyz0r/caloriescounter/blob/main/Controllers/HomeController.cs): `Controllers/HomeController.cs`
- [Food item](https://github.com/energyz0r/caloriescounter/blob/main/Models/FoodItems.cs): `Models/FoodItems.cs`

### User interface

- [Food list](https://github.com/energyz0r/caloriescounter/blob/main/Views/Home/Index.cshtml): `Views/Home/Index.cshtml`
- [Edit form](https://github.com/energyz0r/caloriescounter/blob/main/Views/Home/Edit.cshtml): `Views/Home/Edit.cshtml`

### Other components

- **User**

## Connections

- User → MVC startup: sends requests
- MVC startup → Home actions: routes requests (evidence: `Program.cs`)
- Home actions → Food item: uses model (evidence: `Controllers/HomeController.cs`)
- Home actions → Food list: returns list view (evidence: `Controllers/HomeController.cs`)
- Home actions → Edit form: returns edit view (evidence: `Controllers/HomeController.cs`)
