# shronal/portfolio- architecture

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

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

## Overview

##### Project type and purpose
- This is a **static personal portfolio website** built with plain HTML, CSS, and JavaScript, hosted on GitHub Pages (with Cloudflare as CDN and a custom domain). It showcases the author’s bio, projects, skills, and contact form.

##### File structure
- Top-level HTML pages:
- index.html (home/about)
- project.html, retrievalhub.html, hotelreservation.html, tree_traversal.html (individual project pages)
- Styles and scripts:
- project.css, style.css
- script.js
- Static assets:
- videos/ (demo mp4)
- doc/cv.pdf
- Deployment config:
- .github/workflows/static.yml (CI for GitHub Pages)
- CNAME (custom domain)

##### Key insights from README
- Tech Stack: HTML, CSS, JS, Bootstrap
- Hosted on GitHub Pages behind Cloudflare CDN
- Fully responsive, mobile-friendly
- No backend components (purely client-side)

##### Main components
a. Client (web browser)
b. DNS & CDN layer (Cloudflare + CNAME)
c. Static hosting (GitHub Pages origin)
d. Static asset storage (HTML, CSS, JS, images, videos, PDF)
e. External services (optional contact-form mail service or GitHub Actions CI)

##### Relationships & data flows
- User opens browser → DNS lookup (register.com.np) → Cloudflare CDN →
→ CDN serves cached static files or fetches from GitHub Pages origin →
→ Browser downloads HTML, CSS, JS, assets → renders portfolio →
- If contact form is implemented as third-party JS call → Browser → external email API

##### Architectural patterns & design principles
- Static site architecture (no server-side code)
- CDN caching for performance and DDoS protection
- Component separation:
- Content (HTML)
- Presentation (CSS, Bootstrap)
- Behavior (JavaScript)
- Assets (images, videos, PDF)
- GitOps deployment via GitHub Actions

- DNS lookup → “register.com.np / Cloudflare DNS”
- CDN layer → “Cloudflare CDN (cache)”
- Origin hosting → “GitHub Pages”
- (Optional) “Contact Form API” external service

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Client Side
    subgraph "Client Side" 
        direction TB
        EndUser(["End-user (Browser)"]):::client
    end

    %% DNS & CDN Layer
    subgraph "DNS & CDN Layer"
        direction TB
        DNSLookup(["register.com.np / Cloudflare DNS"]):::dns
        CDN(["Cloudflare CDN (cache)"]):::dns
    end

    %% Hosting Origin
    subgraph "Origin Hosting"
        direction TB
        GitHubPages(["GitHub Pages"]):::hosting
    end

    %% Continuous Deployment
    subgraph "CI/CD"
        direction TB
        GHActions(["GitHub Actions Workflow"]):::hosting
    end

    %% Static Assets
    subgraph "Static Assets"
        direction TB
        HTMLPages["HTML Pages"]:::assets
        CSSFiles["CSS Styles"]:::assets
        JSFiles["JavaScript"]:::assets
        Images["Images"]:::assets
        Videos["Videos"]:::assets
        Documents["Documents"]:::assets
    end

    %% External Service
    subgraph "External Services"
        direction TB
        ContactAPI(["Contact Form API"]):::external
    end

    %% Asset Details
    HTMLPages --> index(["index.html"]):::assets
    HTMLPages --> project(["project.html"]):::assets
    HTMLPages --> retrievalhub(["retrievalhub.html"]):::assets
    HTMLPages --> hotelreservation(["hotelreservation.html"]):::assets
    HTMLPages --> treetraversal(["tree_traversal.html"]):::assets

    CSSFiles --> stylecss(["style.css"]):::assets
    CSSFiles --> projectcss(["project.css"]):::assets

    JSFiles --> scriptjs(["script.js"]):::assets

    Images --> imagesDir(["images/"]):::assets

    Videos --> treevideo(["tree.mp4"]):::assets

    Documents --> cvdoc(["cv.pdf"]):::assets

    %% Flows
    EndUser -->|DNS lookup| DNSLookup
    DNSLookup -->|resolves| CDN
    CDN -->|serves or fetches| GitHubPages
    GitHubPages -->|delivers assets| CDN
    CDN -->|responds| EndUser

    EndUser -->|requests HTML/CSS/JS/assets| CDN

    EndUser -->|submits form| ContactAPI

    GHActions -->|deploy on push| GitHubPages

    %% Click Events
    click DNSLookup "https://github.com/shronal/portfolio-/tree/main/CNAME"
    click GHActions "https://github.com/shronal/portfolio-/blob/main/.github/workflows/static.yml"
    click index "https://github.com/shronal/portfolio-/blob/main/index.html"
    click project "https://github.com/shronal/portfolio-/blob/main/project.html"
    click retrievalhub "https://github.com/shronal/portfolio-/blob/main/retrievalhub.html"
    click hotelreservation "https://github.com/shronal/portfolio-/blob/main/hotelreservation.html"
    click treetraversal "https://github.com/shronal/portfolio-/blob/main/tree_traversal.html"
    click stylecss "https://github.com/shronal/portfolio-/blob/main/style.css"
    click projectcss "https://github.com/shronal/portfolio-/blob/main/project.css"
    click scriptjs "https://github.com/shronal/portfolio-/blob/main/script.js"
    click imagesDir "https://github.com/shronal/portfolio-/tree/main/images/"
    click treevideo "https://github.com/shronal/portfolio-/blob/main/videos/tree.mp4"
    click cvdoc "https://github.com/shronal/portfolio-/blob/main/doc/cv.pdf"

    %% Styles
    classDef client fill:#AED6F1,stroke:#1F618D,color:#1B4F72
    classDef dns fill:#F5B041,stroke:#A04000,color:#641E16
    classDef hosting fill:#58D68D,stroke:#1D8348,color:#145A32
    classDef assets fill:#85C1E9,stroke:#2E86C1,color:#1B4F72
    classDef external fill:#D7DBDD,stroke:#7B7D7D,color:#424949
```
