# slab10000/porfolio-web architecture

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

- Interactive diagram: https://gitdiagram.com/slab10000/porfolio-web
- Repository: https://github.com/slab10000/porfolio-web

## Overview

This repository is a **static, single-page portfolio website**:
- **Frontend-only SPA** built with **React + TypeScript**, bundled by **Vite**
- Runs entirely in the browser; no server-side backend, no database
- “Dynamic” content is mostly **data-driven UI** (from `constants.ts` / `types.ts`) plus **visual effects** (Framer Motion + Three.js)
- External integrations appear limited to **outbound social links** (via `services/socialMediaService.ts`), not API calls

- **Build/deploy pipeline** (source → Vite build → `dist/` → static hosting/CDN)
- **Runtime architecture in the browser** (React component tree + data/service modules + assets)

##### File structure analysis (map folders/files to architectural components)
From the tree and README:

##### Entry points / composition
- `index.html` – Vite HTML entry
- `index.tsx` – React root render (mounts into DOM)
- `App.tsx` – top-level composition of the page sections

##### UI component layer (`components/`)
- `Navbar.tsx`
- `Hero.tsx`
- `Experience.tsx`
- `Projects.tsx`
- `ProjectModal.tsx` (overlay/modal interaction pattern)
- `Skills.tsx`
- `Socials.tsx`
- Visual/FX components:
- `StarBackground.tsx`, `ShootingStars.tsx` (Three.js / canvas/WebGL background)
- `LiquidGlassCard.tsx` (reusable UI look & feel / card primitive)

##### Data + types
- `constants.ts` – likely holds arrays/objects for projects, experience, skills, etc.
- `types.ts` – TypeScript types for those models

##### Service layer
- `services/socialMediaService.ts` – “integration boundary” for social links (even if it’s just a mapping/formatter). Treat it as a service module that isolates “external destinations” and keeps UI components clean.

##### Build outputs / static assets
- `public/astronaut/...` – static assets copied as-is by Vite
- `project images/` – project imagery (treat as static assets)
- `dist/` – production build output (deployment artifact)
- `vite.config.ts`, `tsconfig.json`, `package.json` – build/tooling configuration

##### What the README adds (architecture cues)
- **Component-based architecture** with separation of concerns
- **Animations**: Framer Motion is central to the interaction design
- **3D background**: Three.js is a notable subsystem (render loop, canvas/WebGL)
- Fully responsive (implies layout/styling layer is important, but still a browser-only system)

For this particular project, accuracy comes from representing:
- **No backend**: don’t invent APIs, databases, auth, or server components.
- **Two “engines” at runtime**:
1) React rendering lifecycle (DOM updates, state)
2) Three.js render loop (canvas/WebGL)
- **Stateful interaction hotspot**: `Projects` + `ProjectModal` (selection state, modal visibility)
- **Build vs runtime**: Vite/Tailwind/TypeScript are build-time concerns; React/Three.js/Framer Motion are runtime concerns.

##### Don’t overthink, separate into many components (but keep them truthful)
- Calling out the two major subsystems: **UI sections** and **3D/animation**
- Separating **data/constants**, **types**, and **service(s)** as distinct modules

That will be both accurate and as componentized as possible given the codebase.

## Diagram (Mermaid)

```mermaid
flowchart TD
  %% =========================
  %% Context / Delivery
  %% =========================
  User(["End User"]):::actor

  subgraph "Static Hosting / CDN"
    Host(["Static Host (vendor-neutral)"]):::external
    CDN(["Edge/CDN Caching"]):::external
  end

  subgraph "Browser Runtime (SPA)"
    Browser(["Web Browser"]):::runtime
    DOM["DOM (index.html mount point)"]:::runtime
    Canvas["Canvas/WebGL Context"]:::runtime
  end

  User -->|"requests_static_assets"| Host
  Host -->|"serves_cached_assets"| CDN
  CDN -->|"delivers_HTML_CSS_JS_assets"| Browser
  Browser -->|"renders_to"| DOM

  %% =========================
  %% Build / Tooling Pipeline
  %% =========================
  subgraph "Build & Tooling (Vite + TypeScript)"
    Dev(["Developer / CI Build Step"]):::build

    subgraph "Source (TypeScript/React)"
      HTML["index.html (Vite HTML entry)"]:::source
      Boot["index.tsx (React bootstrap)"]:::source
      App["App.tsx (App shell)"]:::source

      ComponentsDir["components/"]:::source

      subgraph "UI Sections (React Components)"
        Navbar["Navbar.tsx"]:::ui
        Hero["Hero.tsx"]:::ui
        Experience["Experience.tsx"]:::ui
        Projects["Projects.tsx"]:::ui
        ProjectModal["ProjectModal.tsx"]:::ui
        Skills["Skills.tsx"]:::ui
        Socials["Socials.tsx"]:::ui
        LiquidGlassCard["LiquidGlassCard.tsx"]:::ui
      end

      subgraph "Visual Effects Subsystem"
        StarBackground["StarBackground.tsx"]:::fx
        ShootingStars["ShootingStars.tsx"]:::fx
        ThreeJS["Three.js (runtime library)"]:::lib
        Framer["Framer Motion (runtime library)"]:::lib
      end

      subgraph "Data & Services"
        Constants["constants.ts (portfolio content)"]:::data
        Types["types.ts (domain types)"]:::data
        ServicesDir["services/"]:::data
        SocialService["socialMediaService.ts"]:::data
      end

      subgraph "Styling & Icons (Libraries)"
        Tailwind["Tailwind CSS (build-time + runtime classes)"]:::lib
        Lucide["Lucide React (icons)"]:::lib
      end

      subgraph "Static Assets (Source)"
        AstronautAssets["public/astronaut (static assets)"]:::asset
        ProjectImages["project images/ (static imagery)"]:::asset
      end

      subgraph "Config & Manifests"
        ViteConfig["vite.config.ts"]:::config
        TSConfig["tsconfig.json"]:::config
        Package["package.json"]:::config
        Lock["package-lock.json"]:::config
      end
    end

    subgraph "Build Output (Deployment Artifact)"
      Dist["dist/"]:::artifact
      DistIndex["dist/index.html"]:::artifact
      DistAstronaut["dist/astronaut"]:::artifact
      Bundles["JS/CSS Bundles (compiled)"]:::artifact
    end

    Vite["Vite Build Tool"]:::build
  end

  Dev -->|"runs_vite_build"| Vite
  ViteConfig -->|"configures"| Vite
  TSConfig -->|"typechecks_with"| Vite
  Package -->|"declares_deps"| Vite
  Lock -->|"pins_deps"| Vite

  HTML -->|"input_to"| Vite
  Boot -->|"bundled_by"| Vite
  App -->|"bundled_by"| Vite
  ComponentsDir -->|"bundled_by"| Vite
  ServicesDir -->|"bundled_by"| Vite
  Constants -->|"bundled_by"| Vite
  Types -->|"bundled_by"| Vite
  AstronautAssets -->|"copied_to_dist"| Vite
  ProjectImages -->|"copied_to_dist"| Vite

  Vite -->|"produces"| Dist
  Dist -->|"contains"| DistIndex
  Dist -->|"contains"| Bundles
  Dist -->|"contains"| DistAstronaut

  Dist -->|"deployed_to"| Host

  %% =========================
  %% Browser Runtime: App Composition & Data Flows
  %% =========================
  Browser -->|"loads"| DistIndex
  Browser -->|"executes"| Bundles

  DistIndex -.->|"mounts_react_root"| Boot
  Boot -->|"renders_into"| DOM
  Boot -->|"renders"| App

  App -->|"renders_section"| Navbar
  App -->|"renders_section"| Hero
  App -->|"renders_section"| Experience
  App -->|"renders_section"| Projects
  App -->|"renders_section"| Skills
  App -->|"renders_section"| Socials
  App -->|"renders_fx_layer"| StarBackground
  App -->|"renders_fx_layer"| ShootingStars

  %% Data-driven UI
  Navbar -->|"reads_data"| Constants
  Hero -->|"reads_data"| Constants
  Experience -->|"reads_data"| Constants
  Projects -->|"reads_data"| Constants
  Skills -->|"reads_data"| Constants
  Socials -->|"reads_data"| Constants

  Constants -->|"typed_by"| Types

  %% Services boundary (outbound links)
  Socials -->|"uses"| SocialService
  SocialService -->|"returns_URLs"| Socials
  Socials -->|"navigates_to_external_links"| ExternalLinks

  ExternalLinks(["External Social Platforms (X/YouTube/TikTok/etc.)"]):::external

  %% Visual FX engines
  StarBackground -->|"uses"| ThreeJS
  ShootingStars -->|"uses"| ThreeJS
  ThreeJS -->|"renders_to"| Canvas

  %% Animation usage
  Navbar -->|"animates_with"| Framer
  Hero -->|"animates_with"| Framer
  Experience -->|"animates_with"| Framer
  Projects -->|"animates_with"| Framer
  ProjectModal -->|"animates_with"| Framer
  Skills -->|"animates_with"| Framer
  Socials -->|"animates_with"| Framer

  %% Styling & icons usage
  Navbar -->|"styles_with"| Tailwind
  Hero -->|"styles_with"| Tailwind
  Experience -->|"styles_with"| Tailwind
  Projects -->|"styles_with"| Tailwind
  ProjectModal -->|"styles_with"| Tailwind
  Skills -->|"styles_with"| Tailwind
  Socials -->|"styles_with"| Tailwind
  LiquidGlassCard -->|"styles_with"| Tailwind

  Navbar -->|"icons"| Lucide
  Hero -->|"icons"| Lucide
  Projects -->|"icons"| Lucide
  Socials -->|"icons"| Lucide

  %% =========================
  %% Zoom-in: Projects + Modal Interaction Hotspot
  %% =========================
  subgraph "Projects Interaction (Component Detail)"
    Projects -->|"renders_project_cards"| LiquidGlassCard
    Projects -.->|"click_select_project"| ProjectModal
    ProjectModal -.->|"close_resets_state"| Projects
    ProjectModal -->|"reads_project_details"| Constants
    ProjectModal -->|"loads_images_from"| ProjectImages
  end

  %% Assets usage at runtime
  Hero -->|"loads_assets"| AstronautAssets
  StarBackground -->|"loads_assets_optional"| AstronautAssets
  Projects -->|"loads_images"| ProjectImages

  %% =========================
  %% Click Events (from mappings)
  %% =========================
  click HTML "https://github.com/slab10000/porfolio-web/blob/main/index.html"
  click Boot "https://github.com/slab10000/porfolio-web/blob/main/index.tsx"
  click App "https://github.com/slab10000/porfolio-web/blob/main/App.tsx"

  click ComponentsDir "https://github.com/slab10000/porfolio-web/tree/main/components/"
  click Navbar "https://github.com/slab10000/porfolio-web/blob/main/components/Navbar.tsx"
  click Hero "https://github.com/slab10000/porfolio-web/blob/main/components/Hero.tsx"
  click Experience "https://github.com/slab10000/porfolio-web/blob/main/components/Experience.tsx"
  click Projects "https://github.com/slab10000/porfolio-web/blob/main/components/Projects.tsx"
  click ProjectModal "https://github.com/slab10000/porfolio-web/blob/main/components/ProjectModal.tsx"
  click Skills "https://github.com/slab10000/porfolio-web/blob/main/components/Skills.tsx"
  click Socials "https://github.com/slab10000/porfolio-web/blob/main/components/Socials.tsx"
  click StarBackground "https://github.com/slab10000/porfolio-web/blob/main/components/StarBackground.tsx"
  click ShootingStars "https://github.com/slab10000/porfolio-web/blob/main/components/ShootingStars.tsx"
  click LiquidGlassCard "https://github.com/slab10000/porfolio-web/blob/main/components/LiquidGlassCard.tsx"

  click Constants "https://github.com/slab10000/porfolio-web/blob/main/constants.ts"
  click Types "https://github.com/slab10000/porfolio-web/blob/main/types.ts"

  click ServicesDir "https://github.com/slab10000/porfolio-web/tree/main/services/"
  click SocialService "https://github.com/slab10000/porfolio-web/blob/main/services/socialMediaService.ts"

  click AstronautAssets "https://github.com/slab10000/porfolio-web/tree/main/public/astronaut"
  click ProjectImages "https://github.com/slab10000/porfolio-web/tree/main/project images/"

  click Dist "https://github.com/slab10000/porfolio-web/tree/main/dist/"
  click DistIndex "https://github.com/slab10000/porfolio-web/blob/main/dist/index.html"
  click DistAstronaut "https://github.com/slab10000/porfolio-web/tree/main/dist/astronaut"

  click ViteConfig "https://github.com/slab10000/porfolio-web/blob/main/vite.config.ts"
  click TSConfig "https://github.com/slab10000/porfolio-web/blob/main/tsconfig.json"
  click Package "https://github.com/slab10000/porfolio-web/blob/main/package.json"
  click Lock "https://github.com/slab10000/porfolio-web/blob/main/package-lock.json"

  %% =========================
  %% Styles
  %% =========================
  classDef actor fill:#0b1220,stroke:#60a5fa,stroke-width:2px,color:#e5e7eb
  classDef external fill:#111827,stroke:#a78bfa,stroke-width:2px,color:#e5e7eb
  classDef runtime fill:#0f172a,stroke:#38bdf8,stroke-width:2px,color:#e5e7eb
  classDef build fill:#0b1220,stroke:#94a3b8,stroke-width:2px,color:#e5e7eb
  classDef source fill:#0b1220,stroke:#64748b,stroke-width:1.5px,color:#e5e7eb
  classDef ui fill:#0b3b5a,stroke:#38bdf8,stroke-width:2px,color:#e6f6ff
  classDef fx fill:#2a1846,stroke:#a78bfa,stroke-width:2px,color:#f3e8ff
  classDef data fill:#052e1a,stroke:#22c55e,stroke-width:2px,color:#dcfce7
  classDef asset fill:#3a2500,stroke:#f59e0b,stroke-width:2px,color:#fffbeb
  classDef config fill:#1f2937,stroke:#9ca3af,stroke-width:2px,color:#f3f4f6
  classDef artifact fill:#111827,stroke:#f97316,stroke-width:2px,color:#fff7ed
  classDef lib fill:#1f1433,stroke:#c4b5fd,stroke-width:2px,color:#f5f3ff
```
