# rittik9/my-website architecture

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

- Interactive diagram: https://gitdiagram.com/rittik9/my-website
- Repository: https://github.com/rittik9/my-website

## Overview

##### Project type and purpose (from README + tree)
This repo is a **personal website** deployed to **GitHub Pages**. Architecturally it’s best modeled as a **static-site system** with:
- a **build-time “backend”** (Python scripts that assemble content and generate static artifacts), and
- a **run-time “frontend”** (HTML/CSS served as static files to browsers; no server-side runtime).

Key indicators:
- `.github/workflows/deploy-pages.yml` ⇒ CI/CD publishing to GitHub Pages.
- `backend/build_static.py`, `backend/content.py` ⇒ static generation pipeline / content processing.
- `frontend/templates/*.html` + `frontend/static/css/style.css` ⇒ templated HTML + static assets.

##### How to read the file structure as architecture
Top-level components implied by the tree:

##### Build/Generation layer (build-time “backend”)
- `backend/build_static.py`
Likely the entrypoint that produces the final static site output (renders templates, copies assets, etc.).
- `backend/content.py`
Likely defines content structures, loads/normalizes content, or provides data passed into templates.
- `backend/assets/`
Assets used during build (images, files, etc.) or copied into output.

##### Deployment pipeline
- `.github/workflows/deploy-pages.yml`
GitHub Actions workflow that builds and publishes site artifacts to GitHub Pages.
- `requirements.txt`
Python dependencies needed to run the build scripts in CI and locally.

##### Build/Delivery Architecture (most important here)
- Inputs (templates, content/assets, python code)
- Build process (static generation)
- Artifact output (static HTML/CSS/assets)
- CI/CD publishing (GitHub Actions → GitHub Pages)

##### Runtime Serving Architecture
- Browser requests pages
- GitHub Pages serves static files
- No application server / database (unless content.py pulls from something external—which is not shown in the tree)

##### Browser → fetches linked → CSS/assets from GitHub Pages

- **render-time dependencies** (templates/content/python) vs
- **runtime dependencies** (browser + static host).

##### Architectural patterns / principles to call out
- **Static Site Generation (SSG)** pattern:
- Build step converts templates + content into static HTML.
- Runtime has no dynamic backend.
- **Separation of concerns**:
- `backend/` = generation logic + content modeling
- `frontend/` = presentation templates + static styling
- **CI/CD to static hosting**:
- GitHub Actions is the “deployment orchestrator”
- GitHub Pages is the runtime environment

##### Break the repo into as many components as practical (without guessing)
- `backend/build_static.py`
- `backend/content.py`
- `frontend/templates/*` (note key templates)
- `frontend/static/css/style.css`
- `.github/workflows/deploy-pages.yml`
- `requirements.txt`

- “Python environment (requirements.txt)”
- “Build step: run build_static.py”
- “Artifact: generated static site (HTML/CSS/assets)”

- “GitHub Pages (static hosting/CDN)”
- “Browser (client)”

Examples:
- “renders templates with content”
- “copies static assets”
- “produces site artifact”
- “deploys to Pages”
- “serves HTML/CSS”

## Diagram (Mermaid)

```mermaid
flowchart TD

%% ========= ZONE 1: SOURCE / INPUTS (REPO) =========
subgraph "Source / Inputs (Repository)"
direction TB

subgraph "Backend (Build-time Python)"
direction TB
B_BUILD["backend/build_static.py\n(Static generator entrypoint)"]:::code
B_CONTENT["backend/content.py\n(Content/data provider)"]:::code
B_ASSETS["backend/assets/\n(Build-time assets)"]:::assets
end

subgraph "Frontend (Templates + Static Assets)"
direction TB
T_DIR["frontend/templates/\n(HTML template set)"]:::templates
T_BASE["base.html\n(Layout)"]:::doc
T_ABOUT["about.html\n(Page)"]:::doc
T_BLOGS["blogs.html\n(Page)"]:::doc
T_RESEARCH["research.html\n(Page)"]:::doc

S_DIR["frontend/static/\n(Static assets root)"]:::assets
S_CSS["style.css\n(CSS stylesheet)"]:::assets
end

subgraph "CI/CD Config"
direction TB
WF[".github/workflows/deploy-pages.yml\n(GitHub Actions workflow)"]:::pipeline
REQ["requirements.txt\n(Python deps)"]:::config
end
end

%% ========= ZONE 2: BUILD & CI/CD =========
subgraph "Build & CI/CD (Local Dev + GitHub Actions)"
direction TB
DEV["Developer Machine\n(Local build)"]:::external
CI["GitHub Actions Runner\n(CI environment)"]:::pipeline

PIP["Install deps\n(pip -r requirements.txt)"]:::process
BUILD["Run static build\n(python backend/build_static.py)"]:::process
ART["Generated Site Artifact\n(HTML/CSS/assets)\n(dist/site)"]:::artifact
end

%% ========= ZONE 3: HOSTING & RUNTIME =========
subgraph "Hosting & Runtime (Static Delivery)"
direction TB
PAGES["GitHub Pages\n(Static hosting/CDN)"]:::cloud
BROWSER["End User Browser\n(HTTP client)"]:::external
end

%% ========= INTERNAL RELATIONSHIPS (GENERATOR COMPONENTS) =========
B_CONTENT -->|"provides_content/context"| B_BUILD
T_DIR -->|"template_inputs"| B_BUILD
T_BASE -->|"layout_template"| T_DIR
T_ABOUT -->|"page_template"| T_DIR
T_BLOGS -->|"page_template"| T_DIR
T_RESEARCH -->|"page_template"| T_DIR

S_DIR -->|"static_assets_input"| B_BUILD
S_CSS -->|"stylesheet"| S_DIR
B_ASSETS -->|"build_assets_input"| B_BUILD

%% ========= BUILD FLOWS (LOCAL + CI) =========
DEV -->|"runs_locally"| BUILD
REQ -->|"dependency_list"| PIP
CI -->|"executes"| PIP -->|"enables"| BUILD
B_BUILD -->|"renders_templates_with_content"| BUILD
BUILD -->|"produces"| ART
WF -->|"orchestrates_build+deploy"| CI

%% ========= DEPLOYMENT =========
ART -->|"published_by_workflow"| CI
CI -->|"deploys_to_Pages"| PAGES

%% ========= RUNTIME REQUEST FLOW =========
BROWSER -->|"HTTP_GET_pages/assets"| PAGES
PAGES -->|"serves_HTML/CSS/assets"| BROWSER

%% ========= CLICK EVENTS (FROM COMPONENT MAPPING) =========
click WF "https://github.com/rittik9/my-website/blob/master/.github/workflows/deploy-pages.yml"
click REQ "https://github.com/rittik9/my-website/blob/master/requirements.txt"
click B_BUILD "https://github.com/rittik9/my-website/blob/master/backend/build_static.py"
click B_CONTENT "https://github.com/rittik9/my-website/blob/master/backend/content.py"
click B_ASSETS "https://github.com/rittik9/my-website/tree/master/backend/assets/"
click T_DIR "https://github.com/rittik9/my-website/tree/master/frontend/templates/"
click T_BASE "https://github.com/rittik9/my-website/blob/master/frontend/templates/base.html"
click T_ABOUT "https://github.com/rittik9/my-website/blob/master/frontend/templates/about.html"
click T_BLOGS "https://github.com/rittik9/my-website/blob/master/frontend/templates/blogs.html"
click T_RESEARCH "https://github.com/rittik9/my-website/blob/master/frontend/templates/research.html"
click S_DIR "https://github.com/rittik9/my-website/tree/master/frontend/static/"
click S_CSS "https://github.com/rittik9/my-website/blob/master/frontend/static/css/style.css"

%% ========= STYLES =========
classDef code fill:#4C78A8,stroke:#2E5E86,color:#FFFFFF,stroke-width:1.2px
classDef templates fill:#E6F0FA,stroke:#4C78A8,color:#0B1F33,stroke-width:1px
classDef doc fill:#FFFFFF,stroke:#7A8DA6,color:#0B1F33,stroke-width:1px
classDef assets fill:#D9D9D9,stroke:#666666,color:#111111,stroke-width:1px
classDef pipeline fill:#F4A261,stroke:#C56E2D,color:#111111,stroke-width:1.2px
classDef config fill:#FFF3C4,stroke:#C8A64B,color:#111111,stroke-width:1px
classDef process fill:#FAD2CF,stroke:#C06C67,color:#111111,stroke-width:1.2px
classDef artifact fill:#B8EBD0,stroke:#2A9D6B,color:#0B1F33,stroke-width:1.2px
classDef cloud fill:#7BD389,stroke:#2E7D32,color:#0B1F33,stroke-width:1.2px
classDef external fill:#111111,stroke:#000000,color:#FFFFFF,stroke-width:1.2px
```
