# sagarreddypatil/portfolio-website architecture

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

- Interactive diagram: https://gitdiagram.com/sagarreddypatil/portfolio-website
- Repository: https://github.com/sagarreddypatil/portfolio-website

## Overview

##### Project Type & Purpose
- This is a static website built using a custom static site generator. Its primary goal is to compile markdown posts and reusable HTML templates into a deployable website.
- It combines Python scripts (for the build process and image optimization) with JavaScript tooling (for development tasks, Tailwind CSS integration, and a live dev server).

##### File Structure – Identify Main Components
- Build System & Scripts:
- src/build.py: Main entry point that orchestrates the build.
- build.sh: A shell script that triggers the production build.
- src/dev-server.py: Provides a live reload development server.
- src/optimize_images.py: Handles image optimization tasks.
- Templating & Rendering:
- src/templates folder (including subdirectories like components and posts): Contains the HTML templates (layout.html, index.html, button.html, fieldset.html, list.html, page.html).
- These templates are used to render the static pages and project posts.
- Content & Posts:
- posts folder: Contains markdown files under projects, which hold the content (project descriptions) to be transformed into HTML pages.
- Assets & Styling:
- public folder:
- photography: Holds raw, unoptimized images that might be processed during builds.
- src/index.css and tailwind.config.js indicate the use of Tailwind CSS for styling.
- Dependency Management & Configurations:
- package.json, pnpm-lock.yaml, yarn.lock: Used for JavaScript dependency management.
- pyproject.toml and poetry.lock: Used for Python dependency management.
- Other configuration files (.gitattributes, .gitignore, .prettierrc) are used for code styling and version control.

- A “Content Handler” that represents the markdown posts in the posts directory, flowing into the Build Engine.
- A “Template Renderer” component (represented by the content in src/templates) that the Build Engine uses to generate HTML pages.
- A “Static Assets & Styling” component connected to the output:
- Public folder (assets & photography).
- Tailwind (referenced by index.css and tailwind.config.js).
- A “Development Server” component (src/dev-server.py) that interacts with the Build Engine during development.
- Dependency management side for:
- JS side (package.json, yarn) and its build/development tools.
- Python side (pyproject.toml, poetry) used by Build Engine and scripts.
- Output directory (likely “dist” as mentioned in the README), where the complete site is generated and ready to be deployed.

##### Architectural Patterns and Interactions
- The system follows a build pipeline pattern: Taking content (markdown posts) + templates → processing them through the build engine → generating static HTML, optimized assets, and styles.
- A separation of concerns is visible: content, presentation templates, styling, and build orchestration are modularized into different directories.
- External tools (yarn for JavaScript dependencies and poetry for Python) indicate that the build and deployment processes combine multiple languages.

## Diagram (Mermaid)

```mermaid
flowchart TD
    subgraph "Build Pipeline"
        A("Markdown Posts"):::content
        B("HTML Templates"):::template
        C("Static Assets & Tailwind CSS"):::assets
        D("Build Engine"):::build
        E("Image Optimizer"):::build
        J("Optimized Output (dist)"):::output
    end

    subgraph "Development Tools"
        F("Development Server"):::dev
        G("Build Trigger Script"):::trigger
    end

    subgraph "Dependency Management"
        H("JS Dependencies"):::deps
        I("Python Dependencies"):::deps
    end

    A -->|"feeds"| D
    B -->|"templates"| D
    C -->|"assets"| D
    G -->|"triggers"| D
    D -->|"optimizes"| E
    E -->|"returns"| D
    D -->|"generates"| J
    F -->|"monitors"| D
    I -->|"supports"| D
    H -->|"enables"| F

    click A "https://github.com/sagarreddypatil/portfolio-website/tree/main/posts"
    click B "https://github.com/sagarreddypatil/portfolio-website/tree/main/src/templates"
    click C "https://github.com/sagarreddypatil/portfolio-website/tree/main/public"
    click D "https://github.com/sagarreddypatil/portfolio-website/blob/main/src/build.py"
    click E "https://github.com/sagarreddypatil/portfolio-website/blob/main/src/optimize_images.py"
    click F "https://github.com/sagarreddypatil/portfolio-website/blob/main/src/dev-server.py"
    click G "https://github.com/sagarreddypatil/portfolio-website/blob/main/build.sh"
    click H "https://github.com/sagarreddypatil/portfolio-website/blob/main/package.json"
    click I "https://github.com/sagarreddypatil/portfolio-website/blob/main/pyproject.toml"

    classDef content fill:#F4D03F,stroke:#B7950B,stroke-width:2px;
    classDef template fill:#F5B7B1,stroke:#C0392B,stroke-width:2px;
    classDef build fill:#AED6F1,stroke:#2471A3,stroke-width:2px;
    classDef assets fill:#D5F5E3,stroke:#27AE60,stroke-width:2px;
    classDef dev fill:#FAD7A0,stroke:#E67E22,stroke-width:2px;
    classDef trigger fill:#E8DAEF,stroke:#8E44AD,stroke-width:2px;
    classDef deps fill:#D7BDE2,stroke:#884EA0,stroke-width:2px;
    classDef output fill:#D6DBDF,stroke:#5D6D7E,stroke-width:2px;
```
