# hammadii123/strategic-insights-generator architecture

> Architecture diagram of the GitHub repository hammadii123/strategic-insights-generator, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-06-16). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/hammadii123/strategic-insights-generator
- Repository: https://github.com/hammadii123/strategic-insights-generator

## Overview

##### Project type and purpose
- This is a single‐page AI-powered web application built in Python using Streamlit.
- Purpose: Let end users generate polished business reports (SWOT, market research, financial outlook, etc.) by interacting with a Streamlit UI that calls Google’s Gemini generative AI.

##### File structure
- Top-level files only:
- .gitattributes (Git config)
- README.md (project overview & setup)
- app.py (all application code)
- No separate frontend/backend folders: everything lives in app.py.
- Configuration via a `.env` file (dotenv).
- Dependencies declared in requirements.txt (not shown, but referenced).

##### README for additional insights
- Tech stack: Python + Streamlit + Google Gemini + python-dotenv
- Features: multiple report types, tone slider, word-length slider, live progress bar, download.
- Flow described: user sets parameters → app queries Gemini → app renders progress → app displays/downloads report.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Presentation Layer
    subgraph "Presentation Layer"
        UI["Streamlit UI Layer"]:::internal
    end

    %% Logic & Integration Layer
    subgraph "Logic & Integration Layer"
        Config["Configuration Manager<br/>(dotenv loader)"]:::internal
        Parser["Parameter Parser/Validator"]:::internal
        Builder["Prompt Builder"]:::internal
        Formatter["Response Parser/Formatter"]:::internal
    end

    %% Output Module
    Output["Output/Download Module"]:::io

    %% External Service
    External(("Google Gemini API")):::external

    %% Documentation
    README["Project Documentation<br/>(README.md)"]:::documentation

    %% Connections
    UI -->|"load config"| Config
    UI -->|"user input"| Parser
    Config -->|"env vars"| Builder
    Parser -->|"validated params"| Builder
    Builder -->|"API request"| External
    External -->|"AI response"| Formatter
    Formatter -->|"formatted report"| UI
    Formatter -->|"update progress"| UI
    UI -->|"click Download"| Output

    %% Click Events
    click UI "https://github.com/hammadii123/strategic-insights-generator/blob/main/app.py"
    click Config "https://github.com/hammadii123/strategic-insights-generator/blob/main/app.py"
    click Parser "https://github.com/hammadii123/strategic-insights-generator/blob/main/app.py"
    click Builder "https://github.com/hammadii123/strategic-insights-generator/blob/main/app.py"
    click Formatter "https://github.com/hammadii123/strategic-insights-generator/blob/main/app.py"
    click Output "https://github.com/hammadii123/strategic-insights-generator/blob/main/app.py"
    click README "https://github.com/hammadii123/strategic-insights-generator/blob/main/README.md"

    %% Styles
    classDef internal fill:#ADD8E6,stroke:#000,stroke-width:1px
    classDef external fill:#90EE90,stroke:#000,stroke-width:1px
    classDef io fill:#FFA500,stroke:#000,stroke-width:1px
    classDef documentation fill:#D3D3D3,stroke:#000,stroke-width:1px
```
