# wenwen123-ban/nutri_track architecture

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

- Interactive diagram: https://gitdiagram.com/wenwen123-ban/nutri_track
- Repository: https://github.com/wenwen123-ban/nutri_track

## Overview

Nutri Tracker is a Flask-based child nutrition and feeding-program tracker. Staff use the browser interface to enter and review child measurements; the interface previews WHO growth indicators and supports child/parent records, requirement clearances, announcements, and feeding-record documents. The Flask application provides page, authentication, and JSON API behavior, with a second Termux-oriented copy. The excerpts establish some browser-to-API links, but not the full persistence wiring, so storage relationships are omitted.

Main entry points: [`nutri_tracker/static/Script/main.js`](https://github.com/wenwen123-ban/nutri_track/blob/main/nutri_tracker/static/Script/main.js) (Nutrition interface), [`nutri_tracker/app.py`](https://github.com/wenwen123-ban/nutri_track/blob/main/nutri_tracker/app.py) (Flask application)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Browser interface"]
  node_browser["Nutrition interface<br/>[main.js]"]
  node_pages["Page templates<br/>[main.html]"]
  node_styles["Interface styles<br/>[main.css]"]
end

subgraph group_server["Application server"]
  node_flask["Flask application<br/>[app.py]"]
  node_termux["Termux app copy<br/>[app1.py]"]
end

subgraph group_data["JSON data"]
  node_children[("Child records<br/>[data.json]")]
  node_parents[("Parent records<br/>[parents.json]")]
  node_clearance[("Clearance data<br/>[clearance.json]")]
  node_requirements[("Requirements<br/>[requirements.json]")]
  node_announcements[("Announcements<br/>[announcement.json]")]
  node_feeding[("Feeding records")]
  node_program[("Feeding program")]
  node_login[("Login attempts")]
  node_adminsession[("Admin session<br/>[admin_session.json]")]
end

node_staff(("Staff user"))

node_staff -->|"uses"| node_browser
node_browser -->|"requests clearance"| node_flask
node_flask -->|"returns clearance"| node_browser

click node_browser "https://github.com/wenwen123-ban/nutri_track/blob/main/nutri_tracker/static/Script/main.js"
click node_pages "https://github.com/wenwen123-ban/nutri_track/blob/main/nutri_tracker/templates/main.html"
click node_styles "https://github.com/wenwen123-ban/nutri_track/blob/main/nutri_tracker/static/Styles/main.css"
click node_flask "https://github.com/wenwen123-ban/nutri_track/blob/main/nutri_tracker/app.py"
click node_termux "https://github.com/wenwen123-ban/nutri_track/blob/main/nutri_tracker/app1.py"
click node_children "https://github.com/wenwen123-ban/nutri_track/blob/main/nutri_tracker/data.json"
click node_parents "https://github.com/wenwen123-ban/nutri_track/blob/main/nutri_tracker/parents.json"
click node_clearance "https://github.com/wenwen123-ban/nutri_track/blob/main/nutri_tracker/clearance.json"
click node_requirements "https://github.com/wenwen123-ban/nutri_track/blob/main/nutri_tracker/requirements.json"
click node_announcements "https://github.com/wenwen123-ban/nutri_track/blob/main/nutri_tracker/announcement.json"
click node_feeding "https://github.com/wenwen123-ban/nutri_track/blob/main/nutri_tracker/feeding_records.json"
click node_program "https://github.com/wenwen123-ban/nutri_track/blob/main/nutri_tracker/feeding_program.json"
click node_login "https://github.com/wenwen123-ban/nutri_track/blob/main/nutri_tracker/login_attempts.json"
click node_adminsession "https://github.com/wenwen123-ban/nutri_track/blob/main/nutri_tracker/admin_session.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_browser,node_pages,node_styles,node_staff toneBlue
class node_flask,node_termux toneAmber
class node_children,node_parents,node_clearance,node_requirements,node_announcements,node_feeding,node_program,node_login,node_adminsession toneMint
```

## Components

### Browser interface

- [Nutrition interface](https://github.com/wenwen123-ban/nutri_track/blob/main/nutri_tracker/static/Script/main.js): `nutri_tracker/static/Script/main.js`
- [Page templates](https://github.com/wenwen123-ban/nutri_track/blob/main/nutri_tracker/templates/main.html): `nutri_tracker/templates/main.html`
- [Interface styles](https://github.com/wenwen123-ban/nutri_track/blob/main/nutri_tracker/static/Styles/main.css): `nutri_tracker/static/Styles/main.css`

### Application server

- [Flask application](https://github.com/wenwen123-ban/nutri_track/blob/main/nutri_tracker/app.py): `nutri_tracker/app.py`
- [Termux app copy](https://github.com/wenwen123-ban/nutri_track/blob/main/nutri_tracker/app1.py): `nutri_tracker/app1.py`

### JSON data

- [Child records](https://github.com/wenwen123-ban/nutri_track/blob/main/nutri_tracker/data.json): `nutri_tracker/data.json`
- [Parent records](https://github.com/wenwen123-ban/nutri_track/blob/main/nutri_tracker/parents.json): `nutri_tracker/parents.json`
- [Clearance data](https://github.com/wenwen123-ban/nutri_track/blob/main/nutri_tracker/clearance.json): `nutri_tracker/clearance.json`
- [Requirements](https://github.com/wenwen123-ban/nutri_track/blob/main/nutri_tracker/requirements.json): `nutri_tracker/requirements.json`
- [Announcements](https://github.com/wenwen123-ban/nutri_track/blob/main/nutri_tracker/announcement.json): `nutri_tracker/announcement.json`
- [Feeding records](https://github.com/wenwen123-ban/nutri_track/blob/main/nutri_tracker/feeding_records.json): `nutri_tracker/feeding_records.json`
- [Feeding program](https://github.com/wenwen123-ban/nutri_track/blob/main/nutri_tracker/feeding_program.json): `nutri_tracker/feeding_program.json`
- [Login attempts](https://github.com/wenwen123-ban/nutri_track/blob/main/nutri_tracker/login_attempts.json): `nutri_tracker/login_attempts.json`
- [Admin session](https://github.com/wenwen123-ban/nutri_track/blob/main/nutri_tracker/admin_session.json): `nutri_tracker/admin_session.json`

### Other components

- **Staff user**

## Connections

- Staff user → Nutrition interface: uses
- Nutrition interface → Flask application: requests clearance (evidence: `nutri_tracker/static/Script/main.js`)
- Flask application → Nutrition interface: returns clearance (evidence: `nutri_tracker/app.py`)
