# plascore/pwcs-calorie-tracker architecture

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

- Interactive diagram: https://gitdiagram.com/plascore/pwcs-calorie-tracker
- Repository: https://github.com/plascore/pwcs-calorie-tracker

## Overview

This is a school-menu browser app with a calorie counter. A user selects a date; the client requests that day’s menu through a serverless proxy, which forwards the GraphQL request to the nutrition service. The client filters and displays menu items, and users can add or remove items to update a local calorie total. The available excerpts show the client and proxy behavior; no README or HTML excerpt was provided, so page structure and other capabilities are not inferred.

Main entry points: [`script.js`](https://github.com/plascore/pwcs-calorie-tracker/blob/main/script.js) (Menu client), [`functions/api/menu.js`](https://github.com/plascore/pwcs-calorie-tracker/blob/main/functions/api/menu.js) (Menu API proxy)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Browser app"]
  node_menu_client["Menu client<br/>[script.js]"]
  node_counter["Calorie counter<br/>[script.js]"]
end

subgraph group_integration["Menu integration"]
  node_proxy["Menu API proxy<br/>[menu.js]"]
  node_nutrition_api["Nutrition GraphQL API"]
end

node_user(("User"))

node_user -->|"selects date"| node_menu_client
node_menu_client -->|"requests menu"| node_proxy
node_proxy -->|"forwards query"| node_nutrition_api
node_nutrition_api -->|"returns response"| node_proxy
node_proxy -->|"returns menu"| node_menu_client
node_user -->|"adds or removes"| node_counter
node_menu_client -->|"adds item"| node_counter

click node_menu_client "https://github.com/plascore/pwcs-calorie-tracker/blob/main/script.js"
click node_counter "https://github.com/plascore/pwcs-calorie-tracker/blob/main/script.js"
click node_proxy "https://github.com/plascore/pwcs-calorie-tracker/blob/main/functions/api/menu.js"

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_menu_client,node_counter,node_user toneBlue
class node_proxy,node_nutrition_api toneAmber
```

## Components

### Browser app

- [Menu client](https://github.com/plascore/pwcs-calorie-tracker/blob/main/script.js): `script.js`
- [Calorie counter](https://github.com/plascore/pwcs-calorie-tracker/blob/main/script.js): `script.js`

### Menu integration

- [Menu API proxy](https://github.com/plascore/pwcs-calorie-tracker/blob/main/functions/api/menu.js): `functions/api/menu.js`
- **Nutrition GraphQL API**

### Other components

- **User**

## Connections

- User → Menu client: selects date (evidence: `script.js`)
- Menu client → Menu API proxy: requests menu (evidence: `script.js`)
- Menu API proxy → Nutrition GraphQL API: forwards query (evidence: `functions/api/menu.js`)
- Nutrition GraphQL API → Menu API proxy: returns response (evidence: `functions/api/menu.js`)
- Menu API proxy → Menu client: returns menu (evidence: `script.js`)
- User → Calorie counter: adds or removes (evidence: `script.js`)
- Menu client → Calorie counter: adds item (evidence: `script.js`)
