# guilhermealmeidao/caloriesday architecture

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

- Interactive diagram: https://gitdiagram.com/guilhermealmeidao/caloriesday
- Repository: https://github.com/guilhermealmeidao/caloriesday

## Overview

Calories Day is a browser-based meal and nutrient tracker. A first-time user enters personal measurements to establish daily nutrient limits; the main screen then records meals, totals their nutrients, and shows progress against those limits. Users can also manage reusable saved foods and share their local history and personal data through a shortened link and QR code. The README documents these capabilities; some setup, settings, and import details are represented at subsystem level because their implementations were not excerpted.

Main entry points: [`src/components/index.tsx`](https://github.com/guilhermealmeidao/caloriesday/blob/master/src/components/index.tsx) (Dashboard coordinator), [`src/components/logsTable/index.tsx`](https://github.com/guilhermealmeidao/caloriesday/blob/master/src/components/logsTable/index.tsx) (Daily log & totals), [`src/components/barTools/index.tsx`](https://github.com/guilhermealmeidao/caloriesday/blob/master/src/components/barTools/index.tsx) (Action toolbar), [`src/app/page.tsx`](https://github.com/guilhermealmeidao/caloriesday/blob/master/src/app/page.tsx) (Home route)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_setup["Setup &amp; limits"]
  node_home["Home route<br/>[page.tsx]"]
  node_onboarding["Personal setup<br/>[startModule.tsx]"]
  node_settings["Personal settings"]
  node_localdata[("Browser storage")]
end

subgraph group_tracking["Daily food tracking"]
  node_dashboard["Dashboard coordinator<br/>[index.tsx]"]
  node_foodentry["Meal entry<br/>[index.tsx]"]
  node_logs["Daily log &amp; totals<br/>[index.tsx]"]
  node_logedit["Edit daily entry<br/>[editDialog.tsx]"]
  node_logdelete["Delete daily entry<br/>[trashDialog.tsx]"]
  node_progress["Nutrient progress<br/>[barProgress.tsx]"]
  node_toolbar["Action toolbar<br/>[index.tsx]"]
end

subgraph group_sharing["Saved foods &amp; sharing"]
  node_foodpresets["Saved foods<br/>[index.tsx]"]
  node_presetedit["Edit saved food<br/>[index.tsx]"]
  node_share["Share history<br/>[shareDialog.tsx]"]
  node_shortener["URL shortener client<br/>[getSmallUrl.ts]"]
  node_tinyurl["TinyURL service"]
  node_sharepage["Shared-data route<br/>[page.tsx]"]
end

subgraph group_ui["Interface foundation"]
  node_ui["UI primitives"]
end

node_user(("User"))

node_user -->|"opens"| node_home
node_home -->|"starts setup"| node_onboarding
node_home -->|"renders"| node_dashboard
node_onboarding -.->|"stores profile"| node_localdata
node_settings -.->|"updates profile"| node_localdata
node_dashboard -->|"loads daily data"| node_localdata
node_dashboard -->|"renders log"| node_logs
node_dashboard -->|"renders progress"| node_progress
node_dashboard -->|"renders actions"| node_toolbar
node_logs -.->|"reads food log"| node_localdata
node_logs -->|"opens editor"| node_logedit
node_logs -->|"opens deletion"| node_logdelete
node_toolbar -->|"opens entry"| node_foodentry
node_toolbar -->|"opens settings"| node_settings
node_toolbar -->|"opens sharing"| node_share
node_foodentry -.->|"saves meal"| node_localdata
node_foodentry -->|"shows saved foods"| node_foodpresets
node_foodpresets -->|"adds saved meal"| node_localdata
node_foodpresets -->|"opens editor"| node_presetedit
node_share -->|"reads share data"| node_localdata
node_share -->|"requests short link"| node_shortener
node_shortener -->|"shortens URL"| node_tinyurl
node_user -.->|"opens shared link"| node_sharepage
node_ui -.->|"supports interface"| node_dashboard

click node_home "https://github.com/guilhermealmeidao/caloriesday/blob/master/src/app/page.tsx"
click node_onboarding "https://github.com/guilhermealmeidao/caloriesday/blob/master/src/components/startModule.tsx"
click node_dashboard "https://github.com/guilhermealmeidao/caloriesday/blob/master/src/components/index.tsx"
click node_settings "https://github.com/guilhermealmeidao/caloriesday/tree/master/src/components/barTools/settingsDialog"
click node_foodentry "https://github.com/guilhermealmeidao/caloriesday/blob/master/src/components/barTools/addFoodDialog/index.tsx"
click node_foodpresets "https://github.com/guilhermealmeidao/caloriesday/blob/master/src/components/barTools/addFoodDialog/addFoodSaved/index.tsx"
click node_presetedit "https://github.com/guilhermealmeidao/caloriesday/blob/master/src/components/barTools/addFoodDialog/addFoodSaved/editFoodDialog/index.tsx"
click node_logs "https://github.com/guilhermealmeidao/caloriesday/blob/master/src/components/logsTable/index.tsx"
click node_logedit "https://github.com/guilhermealmeidao/caloriesday/blob/master/src/components/logsTable/editDialog.tsx"
click node_logdelete "https://github.com/guilhermealmeidao/caloriesday/blob/master/src/components/logsTable/trashDialog.tsx"
click node_progress "https://github.com/guilhermealmeidao/caloriesday/blob/master/src/components/barProgress.tsx"
click node_toolbar "https://github.com/guilhermealmeidao/caloriesday/blob/master/src/components/barTools/index.tsx"
click node_share "https://github.com/guilhermealmeidao/caloriesday/blob/master/src/components/barTools/shareDialog.tsx"
click node_shortener "https://github.com/guilhermealmeidao/caloriesday/blob/master/src/http/getSmallUrl.ts"
click node_sharepage "https://github.com/guilhermealmeidao/caloriesday/blob/master/src/app/getShare/page.tsx"
click node_ui "https://github.com/guilhermealmeidao/caloriesday/tree/master/src/components/ui"

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_home,node_onboarding,node_settings,node_localdata,node_user toneBlue
class node_dashboard,node_foodentry,node_logs,node_logedit,node_logdelete,node_progress,node_toolbar toneAmber
class node_foodpresets,node_presetedit,node_share,node_shortener,node_tinyurl,node_sharepage toneMint
class node_ui toneRose
```

## Components

### Setup & limits

- [Home route](https://github.com/guilhermealmeidao/caloriesday/blob/master/src/app/page.tsx): `src/app/page.tsx`
- [Personal setup](https://github.com/guilhermealmeidao/caloriesday/blob/master/src/components/startModule.tsx): `src/components/startModule.tsx`
- [Personal settings](https://github.com/guilhermealmeidao/caloriesday/tree/master/src/components/barTools/settingsDialog): `src/components/barTools/settingsDialog`
- **Browser storage**

### Daily food tracking

- [Dashboard coordinator](https://github.com/guilhermealmeidao/caloriesday/blob/master/src/components/index.tsx): `src/components/index.tsx`
- [Meal entry](https://github.com/guilhermealmeidao/caloriesday/blob/master/src/components/barTools/addFoodDialog/index.tsx): `src/components/barTools/addFoodDialog/index.tsx`
- [Daily log & totals](https://github.com/guilhermealmeidao/caloriesday/blob/master/src/components/logsTable/index.tsx): `src/components/logsTable/index.tsx`
- [Edit daily entry](https://github.com/guilhermealmeidao/caloriesday/blob/master/src/components/logsTable/editDialog.tsx): `src/components/logsTable/editDialog.tsx`
- [Delete daily entry](https://github.com/guilhermealmeidao/caloriesday/blob/master/src/components/logsTable/trashDialog.tsx): `src/components/logsTable/trashDialog.tsx`
- [Nutrient progress](https://github.com/guilhermealmeidao/caloriesday/blob/master/src/components/barProgress.tsx): `src/components/barProgress.tsx`
- [Action toolbar](https://github.com/guilhermealmeidao/caloriesday/blob/master/src/components/barTools/index.tsx): `src/components/barTools/index.tsx`

### Saved foods & sharing

- [Saved foods](https://github.com/guilhermealmeidao/caloriesday/blob/master/src/components/barTools/addFoodDialog/addFoodSaved/index.tsx): `src/components/barTools/addFoodDialog/addFoodSaved/index.tsx`
- [Edit saved food](https://github.com/guilhermealmeidao/caloriesday/blob/master/src/components/barTools/addFoodDialog/addFoodSaved/editFoodDialog/index.tsx): `src/components/barTools/addFoodDialog/addFoodSaved/editFoodDialog/index.tsx`
- [Share history](https://github.com/guilhermealmeidao/caloriesday/blob/master/src/components/barTools/shareDialog.tsx): `src/components/barTools/shareDialog.tsx`
- [URL shortener client](https://github.com/guilhermealmeidao/caloriesday/blob/master/src/http/getSmallUrl.ts): `src/http/getSmallUrl.ts`
- **TinyURL service**
- [Shared-data route](https://github.com/guilhermealmeidao/caloriesday/blob/master/src/app/getShare/page.tsx): `src/app/getShare/page.tsx`

### Interface foundation

- [UI primitives](https://github.com/guilhermealmeidao/caloriesday/tree/master/src/components/ui): `src/components/ui`

### Other components

- **User**

## Connections

- User → Home route: opens (evidence: `README.md`)
- Home route → Personal setup: starts setup (evidence: `src/app/page.tsx`)
- Home route → Dashboard coordinator: renders (evidence: `src/app/page.tsx`)
- Personal setup → Browser storage: stores profile (evidence: `README.md`)
- Personal settings → Browser storage: updates profile (evidence: `README.md`)
- Dashboard coordinator → Browser storage: loads daily data (evidence: `src/components/index.tsx`)
- Dashboard coordinator → Daily log & totals: renders log (evidence: `src/components/index.tsx`)
- Dashboard coordinator → Nutrient progress: renders progress (evidence: `src/components/index.tsx`)
- Dashboard coordinator → Action toolbar: renders actions (evidence: `src/components/index.tsx`)
- Daily log & totals → Browser storage: reads food log (evidence: `README.md`)
- Daily log & totals → Edit daily entry: opens editor (evidence: `src/components/logsTable/index.tsx`)
- Daily log & totals → Delete daily entry: opens deletion (evidence: `src/components/logsTable/index.tsx`)
- Action toolbar → Meal entry: opens entry (evidence: `src/components/barTools/index.tsx`)
- Action toolbar → Personal settings: opens settings (evidence: `src/components/barTools/index.tsx`)
- Action toolbar → Share history: opens sharing (evidence: `src/components/barTools/index.tsx`)
- Meal entry → Browser storage: saves meal (evidence: `README.md`)
- Meal entry → Saved foods: shows saved foods (evidence: `src/components/barTools/addFoodDialog/index.tsx`)
- Saved foods → Browser storage: adds saved meal (evidence: `src/components/barTools/addFoodDialog/addFoodSaved/index.tsx`)
- Saved foods → Edit saved food: opens editor (evidence: `src/components/barTools/addFoodDialog/addFoodSaved/index.tsx`)
- Share history → Browser storage: reads share data (evidence: `src/components/barTools/shareDialog.tsx`)
- Share history → URL shortener client: requests short link (evidence: `src/components/barTools/shareDialog.tsx`)
- URL shortener client → TinyURL service: shortens URL (evidence: `README.md`)
- User → Shared-data route: opens shared link (evidence: `README.md`)
- UI primitives → Dashboard coordinator: supports interface (evidence: `src/components/index.tsx`)
