# pbao9/portfolio-baro architecture

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

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

## Overview

##### Project type and purpose
- This is a React single-page application (SPA) built with React 18, React Router and Tailwind CSS, bundled by Vite and deployed as a static site (Netlify).
- It appears to be a personal/portfolio website that reads a local JSON data file (`public/api/projects.json`) to render a “Projects” section, with multiple UI “blocks” (animations, backgrounds, cards) and page routes (Home, About/Experience, Projects, Contact, Tools, NotFound).

##### File structure
- Top-level config & entry points:
- `index.html`, `package.json` / `package-lock.json`, `vite.config.ts`, `tsconfig*.json`, `eslint.config.js`
- Public assets:
- `public/` → `api/projects.json` (static data), `netlify.toml` (deployment config), any static images/manifest
- Source code (`src/`):
- `main.tsx` → application bootstrap
- `App.tsx` → root component + React Router setup
- `blocks/` → atomic‐style UI primitives (Animations, Backgrounds, TextAnimations, small UI “blocks”)
- `components/` → composite components & input elements (Buttons, Cards, Header/Footer, Hero, TechStack, etc.)
- `pages/` → route‐level views (Home, Experience, Projects/Detail, Contact, Tools, NotFound)
- `assets/`, `types/` (TypeScript definitions)

##### Key architectural patterns & tech stack
- SPA pattern with client-side routing (React Router)
- Atomic/Component-driven UI (blocks → components → pages)
- Unidirectional data flow (React state/props, JSON data fetch from `/api/projects.json`)
- Build-time bundling (Vite) → static assets → CDN (Netlify)

A. Developer / CI System (local dev & build)
B. Build Tool (Vite + Plugins)
C. Artifact Storage / Hosting (Netlify CDN + `public/` folder)
D. Client (User’s Browser)
1. `index.html` + JS/CSS bundles
2. React Runtime
3. Router
4. Components hierarchy:
– Blocks (atoms)
– Components (molecules/organisms)
– Pages (views)
5. Static Data Fetch (`/api/projects.json`)

##### Relationships & data flows
- Developer commits → CI/build triggers Vite → outputs minified JS/CSS → uploaded to Netlify
- Browser requests `/` → receives `index.html`, JS/CSS bundles → React app mounts
- User navigation → React Router loads corresponding Page component
- “Projects” page loads data via fetch from `/api/projects.json` → passed down to Page → Components → Blocks
- UI updates via React’s reconciliation

##### Final checklist
- [ ] All components labeled (Blocks, Components, Pages, Router, Build, Host)
- [ ] Notes on key frameworks/tech: React 18, React Router, Tailwind CSS, Vite, Netlify

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph "Build & CI"
        Dev["Developer / CI System"]:::build
        ViteConfig["vite.config.ts"]:::build
        Vite["Vite Build"]:::build
    end

    subgraph "Hosting & CDN"
        Netlify["Netlify CDN"]:::hosting
        NetlifyToml["netlify.toml"]:::hosting
        PublicAssets["Public Assets (public/)"]:::hosting
    end

    subgraph "Client (Browser)"
        Browser["User's Browser"]:::client
        IndexHTML["index.html"]:::client
        Bundles["JS/CSS Bundles"]:::client
        ReactRuntime["React Runtime (React 18)"]:::client
        Router["React Router"]:::client

        subgraph "Pages"
            Home["Page: Home"]:::client
            Exp["Page: Experience"]:::client
            ProjectsPage["Page: Projects"]:::client
            Contact["Page: Contact"]:::client
            Tools["Page: Tools"]:::client
            NotFound["Page: NotFound"]:::client
        end

        subgraph "Composite Components"
            CompList["Components"]:::client
        end

        subgraph "Blocks (Atoms)"
            Anim1["PixelTransition"]:::client
            Anim2["StarBorder"]:::client
            Bg["Squares (Background)"]:::client
            Dock["Dock"]:::client
            PC["PixelCard"]:::client
            SC["SpotlightCard"]:::client
            CU["CountUp"]:::client
            ST["ShinyText"]:::client
        end

        JSONData[(projects.json)]:::data
    end

    %% Build & CI flow
    Dev -->|"triggers build"| Vite
    ViteConfig --> Vite
    Vite -->|"outputs bundles & assets"| PublicAssets
    Vite -->|"deploys"| Netlify

    %% Hosting & CDN
    PublicAssets --> Netlify

    %% Client runtime flow
    Browser -->|HTTP GET /| Netlify
    Browser -->|serves| IndexHTML
    Browser -->|serves| Bundles
    IndexHTML --> ReactRuntime
    Bundles --> ReactRuntime
    ReactRuntime --> Router

    %% Routing to pages
    Router --> Home
    Router --> Exp
    Router --> ProjectsPage
    Router --> Contact
    Router --> Tools
    Router --> NotFound

    %% Projects data flow
    ProjectsPage -->|fetch /api/projects.json| JSONData
    JSONData -->|data passed to| ProjectsPage

    %% Component hierarchy
    ProjectsPage --> CompList
    CompList --> Anim1
    CompList --> Anim2
    CompList --> Bg
    CompList --> Dock
    CompList --> PC
    CompList --> SC
    CompList --> CU
    CompList --> ST

    %% Click Events
    click IndexHTML "https://github.com/pbao9/portfolio-baro/blob/main/index.html"
    click ViteConfig "https://github.com/pbao9/portfolio-baro/blob/main/vite.config.ts"
    click NetlifyToml "https://github.com/pbao9/portfolio-baro/blob/main/public/netlify.toml"
    click JSONData "https://github.com/pbao9/portfolio-baro/blob/main/public/api/projects.json"
    click Anim1 "https://github.com/pbao9/portfolio-baro/blob/main/src/blocks/Animations/PixelTransition/PixelTransition.tsx"
    click Anim2 "https://github.com/pbao9/portfolio-baro/blob/main/src/blocks/Animations/StarBorder/StarBorder.tsx"
    click Bg "https://github.com/pbao9/portfolio-baro/blob/main/src/blocks/Backgrounds/Squares/Squares.tsx"
    click Dock "https://github.com/pbao9/portfolio-baro/blob/main/src/blocks/Components/Dock/Dock.tsx"
    click PC "https://github.com/pbao9/portfolio-baro/blob/main/src/blocks/Components/PixelCard/PixelCard.tsx"
    click SC "https://github.com/pbao9/portfolio-baro/blob/main/src/blocks/Components/SpotlightCard/SpotlightCard.tsx"
    click CU "https://github.com/pbao9/portfolio-baro/blob/main/src/blocks/TextAnimations/CountUp/CountUp.tsx"
    click ST "https://github.com/pbao9/portfolio-baro/blob/main/src/blocks/TextAnimations/ShinyText/ShinyText.tsx"
    click CompList "https://github.com/pbao9/portfolio-baro/tree/main/src/components"
    click Home "https://github.com/pbao9/portfolio-baro/blob/main/src/pages/Home.tsx"
    click Exp "https://github.com/pbao9/portfolio-baro/blob/main/src/pages/Experience.tsx"
    click ProjectsPage "https://github.com/pbao9/portfolio-baro/blob/main/src/pages/Projects.tsx"
    click Contact "https://github.com/pbao9/portfolio-baro/blob/main/src/pages/Contact.tsx"
    click Tools "https://github.com/pbao9/portfolio-baro/blob/main/src/pages/Tools.tsx"
    click NotFound "https://github.com/pbao9/portfolio-baro/blob/main/src/pages/NotFound.tsx"
    click Dev "https://github.com/pbao9/portfolio-baro/blob/main/src/main.tsx"
    click Router "https://github.com/pbao9/portfolio-baro/blob/main/src/App.tsx"

    classDef build fill:#e3fcec,stroke:#2ecc71,stroke-width:2px
    classDef hosting fill:#e8f4fc,stroke:#3498db,stroke-width:2px
    classDef client fill:#fff5e6,stroke:#f39c12,stroke-width:2px
    classDef data fill:#f0f0f0,stroke:#95a5a6,stroke-width:2px
```
