# pruthvirajc288-cmyk/macrosnaps architecture

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

- Interactive diagram: https://gitdiagram.com/pruthvirajc288-cmyk/macrosnaps
- Repository: https://github.com/pruthvirajc288-cmyk/macrosnaps

## Overview

MacroSnap is a Streamlit nutrition assistant: users provide a name and WhatsApp number, then ask about meals by text or photo. The app maintains a Gemini chat, displays replies, and can request a conversation-wide nutrition summary and send it through Twilio. Prompt text is maintained separately. The graph reflects the calls shown in app.py; it does not assume persistence beyond Streamlit session state or inspect any unsampled implementation.

Main entry points: [`app.py`](https://github.com/pruthvirajc288-cmyk/macrosnaps/blob/main/app.py) (Streamlit interface), [`prompts.py`](https://github.com/pruthvirajc288-cmyk/macrosnaps/blob/main/prompts.py) (Nutrition prompts)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interaction["User interaction"]
  node_streamlit_app["Streamlit interface<br/>[app.py]"]
  node_conversation_state["Chat session<br/>[app.py]"]
end

subgraph group_nutrition["Nutrition assistant"]
  node_prompt_config["Nutrition prompts<br/>[prompts.py]"]
  node_gemini{{"Gemini API"}}
end

subgraph group_delivery["Summary delivery"]
  node_summary_request["Summary request<br/>[app.py]"]
  node_whatsapp_sender["WhatsApp sender<br/>[app.py]"]
  node_twilio{{"Twilio API"}}
end

node_user(("User"))

node_user -->|"provides input"| node_streamlit_app
node_streamlit_app -->|"updates session"| node_conversation_state
node_streamlit_app -->|"uses prompts"| node_prompt_config
node_streamlit_app -->|"sends chat input"| node_gemini
node_streamlit_app -->|"requests summary"| node_summary_request
node_summary_request -->|"requests summary text"| node_gemini
node_streamlit_app -->|"passes summary"| node_whatsapp_sender
node_whatsapp_sender -->|"creates message"| node_twilio

click node_streamlit_app "https://github.com/pruthvirajc288-cmyk/macrosnaps/blob/main/app.py"
click node_conversation_state "https://github.com/pruthvirajc288-cmyk/macrosnaps/blob/main/app.py"
click node_prompt_config "https://github.com/pruthvirajc288-cmyk/macrosnaps/blob/main/prompts.py"
click node_summary_request "https://github.com/pruthvirajc288-cmyk/macrosnaps/blob/main/app.py"
click node_whatsapp_sender "https://github.com/pruthvirajc288-cmyk/macrosnaps/blob/main/app.py"

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_streamlit_app,node_conversation_state,node_user toneBlue
class node_prompt_config,node_gemini toneAmber
class node_summary_request,node_whatsapp_sender,node_twilio toneMint
```

## Components

### User interaction

- [Streamlit interface](https://github.com/pruthvirajc288-cmyk/macrosnaps/blob/main/app.py): `app.py`
- [Chat session](https://github.com/pruthvirajc288-cmyk/macrosnaps/blob/main/app.py): `app.py`

### Nutrition assistant

- [Nutrition prompts](https://github.com/pruthvirajc288-cmyk/macrosnaps/blob/main/prompts.py): `prompts.py`
- **Gemini API**

### Summary delivery

- [Summary request](https://github.com/pruthvirajc288-cmyk/macrosnaps/blob/main/app.py): `app.py`
- [WhatsApp sender](https://github.com/pruthvirajc288-cmyk/macrosnaps/blob/main/app.py): `app.py`
- **Twilio API**

### Other components

- **User**

## Connections

- User → Streamlit interface: provides input (evidence: `app.py`)
- Streamlit interface → Chat session: updates session (evidence: `app.py`)
- Streamlit interface → Nutrition prompts: uses prompts (evidence: `app.py`)
- Streamlit interface → Gemini API: sends chat input (evidence: `app.py`)
- Streamlit interface → Summary request: requests summary (evidence: `app.py`)
- Summary request → Gemini API: requests summary text (evidence: `app.py`)
- Streamlit interface → WhatsApp sender: passes summary (evidence: `app.py`)
- WhatsApp sender → Twilio API: creates message (evidence: `app.py`)
