# avinandan-mukherjee/localhost---portfolio-generator architecture

> Architecture diagram of the GitHub repository avinandan-mukherjee/localhost---portfolio-generator, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-08-09). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/avinandan-mukherjee/localhost---portfolio-generator
- Repository: https://github.com/avinandan-mukherjee/localhost---portfolio-generator

## Overview

##### Project type and purpose
- This is a full-stack Flask web application (“LocalHost – AI Portfolio Generator”).
- Purpose: Accept user data via a form, call Google Gemini AI to generate a personalized portfolio site (HTML/CSS/JS), provide live preview, and allow download as a ZIP.

##### File structure
- Top-level Python modules:
- main.py – Flask app entry point, routes, AI orchestration
- input_form.py – WTForms definitions for user input
- Static assets (“static/”):
- inputstyle.css, mystyle.css, myscript.js – styling and behavior for the input & preview pages
- codes/ – dynamically generated portfolio output (images/, index.html, style.css, script.js)
- Templates (“templates/”):
- data.html – form page
- generated.html – preview/download UI
- Config/deployment:
- requirements.txt, .gitignore, Procfile, vercel.json

##### README for additional insights
- Architecture described verbally: Flask back end + Jinja2 templates + static preview + Google Gemini API integration.
- Key features: live preview toggle, download ZIP, theme customization.

##### Final recommendations
- Essential components—don’t omit the code-generation folder as it is central to the flow.
- Data flow end-to-end: user fills form → AI generates code → preview served → ZIP download.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Presentation Layer
    subgraph "Presentation Layer"
        ClientForm["Client Browser UI: Form"]:::frontend
        ClientPreview["Client Browser UI: Preview & Download"]:::frontend
    end

    %% Application Layer
    subgraph "Application Layer"
        FlaskApp["Flask Application Server"]:::backend
        InputForm["Input Validation (WTForms)"]:::backend
        Templates["Jinja2 Templates"]:::backend
        DownloadService["Download/ZIP Generator"]:::backend
    end

    %% Artifact Layer
    subgraph "Artifact Layer"
        StaticAssets["Static Asset Hosting"]:::storage
        CodeStorage["Code Artifact Storage"]:::storage
    end

    %% External Services
    subgraph "External Services"
        GoogleGemini["Google Gemini AI Service"]:::external
    end

    %% Deployment
    subgraph "Deployment Configuration"
        Deployment["Procfile / vercel.json / requirements.txt / .gitignore"]:::config
    end

    %% Connections
    ClientForm -->|"GET /"| FlaskApp
    ClientForm -->|"POST /generate"| FlaskApp
    FlaskApp -->|"uses"| InputForm
    FlaskApp -->|"renders templates"| Templates
    FlaskApp -->|"calls AI (JSON)"| GoogleGemini
    GoogleGemini -->|"returns code (JSON)"| FlaskApp
    FlaskApp -->|"writes files"| CodeStorage
    FlaskApp -->|"serves static assets"| StaticAssets
    ClientPreview -->|"fetches generated files"| StaticAssets
    ClientPreview -->|"downloads ZIP"| DownloadService
    DownloadService -->|"reads files"| CodeStorage

    %% Click Events
    click ClientForm "https://github.com/avinandan-mukherjee/localhost---portfolio-generator/blob/main/templates/data.html"
    click ClientForm "https://github.com/avinandan-mukherjee/localhost---portfolio-generator/blob/main/static/inputstyle.css"
    click ClientForm "https://github.com/avinandan-mukherjee/localhost---portfolio-generator/blob/main/static/mystyle.css"
    click ClientForm "https://github.com/avinandan-mukherjee/localhost---portfolio-generator/blob/main/static/myscript.js"
    click ClientPreview "https://github.com/avinandan-mukherjee/localhost---portfolio-generator/blob/main/templates/generated.html"
    click ClientPreview "https://github.com/avinandan-mukherjee/localhost---portfolio-generator/blob/main/static/codes/index.html"
    click ClientPreview "https://github.com/avinandan-mukherjee/localhost---portfolio-generator/blob/main/static/codes/style.css"
    click ClientPreview "https://github.com/avinandan-mukherjee/localhost---portfolio-generator/blob/main/static/codes/script.js"
    click ClientPreview "https://github.com/avinandan-mukherjee/localhost---portfolio-generator/tree/main/static/codes/images/"
    click FlaskApp "https://github.com/avinandan-mukherjee/localhost---portfolio-generator/blob/main/main.py"
    click InputForm "https://github.com/avinandan-mukherjee/localhost---portfolio-generator/blob/main/input_form.py"
    click CodeStorage "https://github.com/avinandan-mukherjee/localhost---portfolio-generator/tree/main/static/codes/"
    click StaticAssets "https://github.com/avinandan-mukherjee/localhost---portfolio-generator/tree/main/static/"
    click Templates "https://github.com/avinandan-mukherjee/localhost---portfolio-generator/tree/main/templates/"
    click DownloadService "https://github.com/avinandan-mukherjee/localhost---portfolio-generator/blob/main/main.py"

    %% Styles
    classDef frontend fill:#D0E8FF,stroke:#0366d6,color:#024b7a;
    classDef backend fill:#D3F9D8,stroke:#2e7d32,color:#1b5e20;
    classDef external fill:#FFEDD5,stroke:#f57c00,color:#e65100;
    classDef storage fill:#E2E8F0,stroke:#64748b,color:#334155;
    classDef config fill:#F3E5F5,stroke:#8e24aa,color:#6a1b9a;
```
