# amirtharaju/workout_plan_generator architecture

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

- Interactive diagram: https://gitdiagram.com/amirtharaju/workout_plan_generator
- Repository: https://github.com/amirtharaju/workout_plan_generator

## Overview

This is a small Streamlit application that collects workout preferences, validates them, asks Groq to generate a personalized plan, and displays the result. Its main runtime stages are represented within app.py, not separate packages. The README documents the overall flow; the excerpts show validation, prompt construction, Groq client use, response handling, and display, but omit some call-site details. Future enhancements and setup tooling are excluded because they are not current runtime capabilities.

Main entry points: [`app.py`](https://github.com/amirtharaju/workout_plan_generator/blob/main/app.py) (Plan Generator)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["User Interface"]
  node_streamlit_ui["Streamlit UI<br/>[app.py]"]
  node_plan_display["Plan Display<br/>[app.py]"]
end

subgraph group_planning["Plan Generation"]
  node_input_validation["Input Validation<br/>[app.py]"]
  node_prompt_builder["Prompt Builder<br/>[app.py]"]
  node_plan_generator["Plan Generator<br/>[app.py]"]
  node_response_handling["Response Handling<br/>[app.py]"]
end

subgraph group_integration["LLM Integration"]
  node_groq_client["Groq Client Setup<br/>[app.py]"]
  node_groq_api["Groq API"]
end

node_user(("User"))

node_user -->|"enters preferences"| node_streamlit_ui
node_streamlit_ui -->|"validates inputs"| node_input_validation
node_streamlit_ui -->|"requests plan"| node_plan_generator
node_plan_generator -->|"checks inputs"| node_input_validation
node_plan_generator -->|"builds prompt"| node_prompt_builder
node_plan_generator -->|"creates client"| node_groq_client
node_plan_generator -->|"sends completion request"| node_groq_api
node_groq_api -->|"returns response"| node_plan_generator
node_plan_generator -->|"checks response"| node_response_handling
node_plan_generator -->|"returns plan"| node_streamlit_ui
node_streamlit_ui -->|"renders Markdown"| node_plan_display

click node_streamlit_ui "https://github.com/amirtharaju/workout_plan_generator/blob/main/app.py"
click node_input_validation "https://github.com/amirtharaju/workout_plan_generator/blob/main/app.py"
click node_prompt_builder "https://github.com/amirtharaju/workout_plan_generator/blob/main/app.py"
click node_plan_generator "https://github.com/amirtharaju/workout_plan_generator/blob/main/app.py"
click node_groq_client "https://github.com/amirtharaju/workout_plan_generator/blob/main/app.py"
click node_response_handling "https://github.com/amirtharaju/workout_plan_generator/blob/main/app.py"
click node_plan_display "https://github.com/amirtharaju/workout_plan_generator/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_ui,node_plan_display,node_user toneBlue
class node_input_validation,node_prompt_builder,node_plan_generator,node_response_handling toneAmber
class node_groq_client,node_groq_api toneMint
```

## Components

### User Interface

- [Streamlit UI](https://github.com/amirtharaju/workout_plan_generator/blob/main/app.py): `app.py`
- [Plan Display](https://github.com/amirtharaju/workout_plan_generator/blob/main/app.py): `app.py`

### Plan Generation

- [Input Validation](https://github.com/amirtharaju/workout_plan_generator/blob/main/app.py): `app.py`
- [Prompt Builder](https://github.com/amirtharaju/workout_plan_generator/blob/main/app.py): `app.py`
- [Plan Generator](https://github.com/amirtharaju/workout_plan_generator/blob/main/app.py): `app.py`
- [Response Handling](https://github.com/amirtharaju/workout_plan_generator/blob/main/app.py): `app.py`

### LLM Integration

- [Groq Client Setup](https://github.com/amirtharaju/workout_plan_generator/blob/main/app.py): `app.py`
- **Groq API**

### Other components

- **User**

## Connections

- User → Streamlit UI: enters preferences (evidence: `README.md`)
- Streamlit UI → Input Validation: validates inputs (evidence: `README.md`)
- Streamlit UI → Plan Generator: requests plan (evidence: `README.md`)
- Plan Generator → Input Validation: checks inputs (evidence: `app.py`)
- Plan Generator → Prompt Builder: builds prompt (evidence: `README.md`)
- Plan Generator → Groq Client Setup: creates client (evidence: `app.py`)
- Plan Generator → Groq API: sends completion request (evidence: `app.py`)
- Groq API → Plan Generator: returns response (evidence: `README.md`)
- Plan Generator → Response Handling: checks response (evidence: `app.py`)
- Plan Generator → Streamlit UI: returns plan (evidence: `README.md`)
- Streamlit UI → Plan Display: renders Markdown (evidence: `app.py`)
