# fowlfarmer/website architecture

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

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

## Overview

##### What this project is (type + purpose)
This repo is a **personal website / portfolio** deployed at **tzhu.dev**, primarily a **React single-page app (SPA)** built with **Vite**. The file tree also contains a small **Python “api” folder** (likely serverless functions/endpoints) used for a couple of integrations (e.g., Spotify).

So architecturally it’s a **static frontend + optional lightweight API endpoints + static assets**, deployed on **Vercel**.

##### Frontend (Vite + React)
Key indicators:
- `index.html`, `vite.config.js`, `package.json`, `src/main.jsx` → Vite + React entrypoints
- `src/App.jsx` → main app shell
- `src/components/*` → UI components
- `src/components/cards/*` → “card” subcomponents (portfolio items / gallery tiles)
- `src/data/projects.js` → local data model powering the UI (projects content)

This suggests a classic SPA layout:
- **Entry**: `index.html` → mounts React root via `src/main.jsx`
- **Composition root**: `App.jsx` wires major sections (NavBar, Self, Gallery, Contact, etc.)
- **Presentation components**: in `components/` and `components/cards/`
- **Content**: driven by `src/data/projects.js`

##### Static assets
- `public/*` contains PDFs, zips, and `.well-known/discord`
- The presence of `.well-known` implies some **domain verification / identity** endpoint (Discord verification or similar), served as static files.

##### Backend/API (lightweight)
- `api/macbook.py`
- `api/spotify.py`
- `requirements.txt`

This pattern strongly resembles **Vercel serverless functions** (or a similar serverless convention) where files in `api/` are deployed as HTTP endpoints.
Even if unused, it’s important to represent them as a separate runtime from the SPA.

##### Deployment
- `package-lock.json` and `requirements.txt` → two build ecosystems (Node for frontend; Python for serverless endpoints)

##### What the README adds
The README is minimal, but it confirms:
- purpose: “personal webpage”
- tech: “Built with react”
- production URL: tzhu.dev

##### Serverless API (Python)
- `/api/spotify` (from `api/spotify.py`)
- `/api/macbook` (from `api/macbook.py`)
##### External Services
- **Spotify Web API** (very likely, given `spotify.py`)

Optionally (but useful for principal-level clarity), add:
##### Build pipeline
- “Vite build (Node)” producing static bundle
- “Python deps” for serverless functions

- Browser → Vercel Hosting: `GET /`
- Vercel Hosting → Browser: serves `index.html`, JS/CSS bundle (from Vite build)
- Browser → Vercel Static Assets: `GET /Theodore_Resume.pdf`, etc. (served from `public/`)
- SPA (in browser) → Vercel Serverless API: `GET /api/spotify` (or whatever endpoints are called)
- Vercel Serverless API → Spotify Web API: authenticated API calls (if applicable)
- Spotify Web API → Serverless API → SPA: response payload
- Browser → Vercel Static `.well-known/...` for verification (if relevant to domain integrations)

- React code runs in the browser
- serverless functions run on Vercel (separate compute)
- external services are off-platform

##### Architectural patterns/design principles present
For this project, explicitly label:
- **SPA architecture** (client-side rendering; React component tree)
- **Static hosting + serverless** (BFF-style endpoints for third-party integration)
- **Content-as-data** (projects driven by `src/data/projects.js`)
- **Component composition** (sections + cards)

##### Relevant technologies/frameworks
- Frontend: **React**, **Vite**, (optionally “JSX”, “CSS”)
- Hosting: **Vercel**
- API: **Python serverless functions** (Vercel Functions)
- External: **Spotify API**
- Assets: `public/` (PDF/ZIP), `.well-known`

- User Browser
- Vercel (hosting + serverless)
- React SPA static bundle
- public assets
- serverless endpoints
- Spotify API

This is where you “separate into as many components as possible” based on `src/components`:
- `App.jsx` at the center
- `NavBar`, `Self`, `Gallery`, `Contact`
- `Gallery` → `cards/*` (each card component)
- Data flow: `projects.js` feeding `Gallery/cards`
This gives a highly accurate picture of how the UI is structured, which matters for a portfolio site.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% =========================================================
    %% Diagram 1: Deployment + Runtime Context (C4-ish)
    %% =========================================================
    subgraph "Clients"
        U["User Browser"]:::client
    end

    subgraph "Vercel Platform (tzhu.dev)"
        VE["Vercel Edge / Hosting"]:::platform

        subgraph "Static Frontend (Vite build output)"
            HTML["HTML Shell (index.html)"]:::doc
            BUNDLE["React SPA Bundle (JS/CSS)"]:::frontend
        end

        subgraph "Static Assets (public/)"
            PUB["Static Assets Root"]:::assets
            WELL[".well-known/discord (verification)"]:::assets
            subgraph "Downloads (PDF/ZIP)"
                RESUME["Theodore_Resume.pdf"]:::assetfile
                DOC1["breathmentor_doc.pdf"]:::assetfile
                DOC2["ethereum.pdf"]:::assetfile
                ZIP1["geesespotter.zip"]:::assetfile
                DOC3["lab_paper.pdf"]:::assetfile
                ZIP2["momoney.zip"]:::assetfile
            end
        end

        subgraph "Serverless API (Python on Vercel Functions)"
            APIROOT["API Root (/api)"]:::api
            SPOT["/api/spotify (spotify.py)"]:::api
            MAC["/api/macbook (macbook.py)"]:::api
            REQ["Python deps (requirements.txt)"]:::build
        end

        subgraph "Deployment & Build Config"
            VERCELCFG["Routing/Build Config (vercel.json)"]:::config
            VITECFG["Vite Config (vite.config.js)"]:::config
            PKG["Node scripts & deps (package.json)"]:::config
            LOCK["Node lockfile (package-lock.json)"]:::config
        end
    end

    subgraph "External Services"
        SPOTIFY["Spotify Web API"]:::external
        EXT["External API / Device info service (if used by macbook)"]:::external
    end

    %% Runtime flows (vertical emphasis)
    U -->|"GET /"| VE
    VE -->|"serve index.html"| HTML
    HTML -->|"load JS/CSS"| BUNDLE
    VE -->|"static files"| PUB
    U -->|"GET /Theodore_Resume.pdf"| RESUME
    U -->|"GET /.well-known/discord/..."| WELL

    %% SPA to API
    U -->|"HTTPS GET /api/spotify"| SPOT
    U -->|"HTTPS GET /api/macbook"| MAC

    %% API to external services
    SPOT -->|"HTTP calls"| SPOTIFY
    MAC -->|"HTTP calls (if any)"| EXT

    %% Build-time relations (dashed)
    PKG -.->|"vite build"| BUNDLE
    VITECFG -.->|"controls build"| BUNDLE
    LOCK -.->|"pins deps"| BUNDLE
    REQ -.->|"installs deps"| SPOT
    REQ -.->|"installs deps"| MAC
    VERCELCFG -.->|"routes/rewrites"| VE

    %% =========================================================
    %% Diagram 2: Frontend Internal Component Map (React SPA)
    %% =========================================================
    subgraph "React SPA Internal (src/)"
        MAIN["Client Entry (main.jsx)"]:::frontend
        APP["App Shell (App.jsx)"]:::frontend
        CSS["Global Styling (App.css)"]:::appstyle
        COMPDIR["Components Folder (src/components/)"]:::component

        subgraph "Core UI Components (components/)"
            NAV["NavBar"]:::component
            SELF["Self / About"]:::component
            GAL["Gallery / Portfolio"]:::component
            CON["Contact"]:::component

            subgraph "Gallery Cards (components/cards/)"
                CARDROOT["Cards Folder"]:::component
                C1["cosplay"]:::card
                C2["dbh"]:::card
                C3["ga"]:::card
                C4["gerb2"]:::card
                C5["gh"]:::card
                C6["imaginecraft"]:::card
                C7["lab"]:::card
                C8["ross"]:::card
                C9["ships"]:::card
                C10["shoebill"]:::card
                C11["smallProjects"]:::card
                C12["test"]:::card
            end
        end

        DATA["Projects Data Model (data/projects.js)"]:::data
    end

    %% Component wiring
    MAIN -->|"mounts"| APP
    APP -->|"applies"| CSS
    COMPDIR -.->|"contains"| NAV
    COMPDIR -.->|"contains"| SELF
    COMPDIR -.->|"contains"| GAL
    COMPDIR -.->|"contains"| CON

    APP -->|"renders"| NAV
    APP -->|"renders"| SELF
    APP -->|"renders"| GAL
    APP -->|"renders"| CON

    DATA -->|"feeds content"| GAL
    GAL -->|"composes"| CARDROOT
    CARDROOT -->|"includes"| C1
    CARDROOT -->|"includes"| C2
    CARDROOT -->|"includes"| C3
    CARDROOT -->|"includes"| C4
    CARDROOT -->|"includes"| C5
    CARDROOT -->|"includes"| C6
    CARDROOT -->|"includes"| C7
    CARDROOT -->|"includes"| C8
    CARDROOT -->|"includes"| C9
    CARDROOT -->|"includes"| C10
    CARDROOT -->|"includes"| C11
    CARDROOT -->|"includes"| C12

    %% Optional integration path (if called by UI)
    GAL -.->|"fetch /api/spotify (if used)"| SPOT

    %% =========================================================
    %% Click events (component mappings)
    %% =========================================================
    click HTML "https://github.com/fowlfarmer/website/blob/devel/index.html"
    click MAIN "https://github.com/fowlfarmer/website/blob/devel/src/main.jsx"
    click APP "https://github.com/fowlfarmer/website/blob/devel/src/App.jsx"
    click CSS "https://github.com/fowlfarmer/website/blob/devel/src/App.css"
    click COMPDIR "https://github.com/fowlfarmer/website/tree/devel/src/components/"
    click NAV "https://github.com/fowlfarmer/website/blob/devel/src/components/NavBar.jsx"
    click SELF "https://github.com/fowlfarmer/website/blob/devel/src/components/Self.jsx"
    click GAL "https://github.com/fowlfarmer/website/blob/devel/src/components/Gallery.jsx"
    click CON "https://github.com/fowlfarmer/website/blob/devel/src/components/Contact.jsx"
    click CARDROOT "https://github.com/fowlfarmer/website/tree/devel/src/components/cards/"
    click C1 "https://github.com/fowlfarmer/website/blob/devel/src/components/cards/cosplay.jsx"
    click C2 "https://github.com/fowlfarmer/website/blob/devel/src/components/cards/dbh.jsx"
    click C3 "https://github.com/fowlfarmer/website/blob/devel/src/components/cards/ga.jsx"
    click C4 "https://github.com/fowlfarmer/website/blob/devel/src/components/cards/gerb2.jsx"
    click C5 "https://github.com/fowlfarmer/website/blob/devel/src/components/cards/gh.jsx"
    click C6 "https://github.com/fowlfarmer/website/blob/devel/src/components/cards/imaginecraft.jsx"
    click C7 "https://github.com/fowlfarmer/website/blob/devel/src/components/cards/lab.jsx"
    click C8 "https://github.com/fowlfarmer/website/blob/devel/src/components/cards/ross.jsx"
    click C9 "https://github.com/fowlfarmer/website/blob/devel/src/components/cards/ships.jsx"
    click C10 "https://github.com/fowlfarmer/website/blob/devel/src/components/cards/shoebill.jsx"
    click C11 "https://github.com/fowlfarmer/website/blob/devel/src/components/cards/smallProjects.jsx"
    click C12 "https://github.com/fowlfarmer/website/blob/devel/src/components/cards/test.jsx"
    click DATA "https://github.com/fowlfarmer/website/blob/devel/src/data/projects.js"
    click PUB "https://github.com/fowlfarmer/website/tree/devel/public/"
    click RESUME "https://github.com/fowlfarmer/website/blob/devel/public/Theodore_Resume.pdf"
    click DOC1 "https://github.com/fowlfarmer/website/blob/devel/public/breathmentor_doc.pdf"
    click DOC2 "https://github.com/fowlfarmer/website/blob/devel/public/ethereum.pdf"
    click ZIP1 "https://github.com/fowlfarmer/website/blob/devel/public/geesespotter.zip"
    click DOC3 "https://github.com/fowlfarmer/website/blob/devel/public/lab_paper.pdf"
    click ZIP2 "https://github.com/fowlfarmer/website/blob/devel/public/momoney.zip"
    click WELL "https://github.com/fowlfarmer/website/blob/devel/public/.well-known/discord"
    click APIROOT "https://github.com/fowlfarmer/website/tree/devel/api/"
    click SPOT "https://github.com/fowlfarmer/website/blob/devel/api/spotify.py"
    click MAC "https://github.com/fowlfarmer/website/blob/devel/api/macbook.py"
    click REQ "https://github.com/fowlfarmer/website/blob/devel/requirements.txt"
    click VERCELCFG "https://github.com/fowlfarmer/website/blob/devel/vercel.json"
    click VITECFG "https://github.com/fowlfarmer/website/blob/devel/vite.config.js"
    click PKG "https://github.com/fowlfarmer/website/blob/devel/package.json"
    click LOCK "https://github.com/fowlfarmer/website/blob/devel/package-lock.json"

    %% =========================================================
    %% Styles (color-coded)
    %% =========================================================
    classDef client fill:#D6ECFF,stroke:#1B6AAE,stroke-width:1.5px,color:#0B2B45
    classDef platform fill:#BFE3FF,stroke:#155A8A,stroke-width:2px,color:#07304F
    classDef frontend fill:#CFE8FF,stroke:#2E6FA6,stroke-width:1.5px,color:#0B2B45
    classDef component fill:#E6F2FF,stroke:#2E6FA6,stroke-width:1px,color:#0B2B45
    classDef card fill:#EAF6FF,stroke:#3A78AB,stroke-width:1px,color:#0B2B45
    classDef api fill:#D5F5E3,stroke:#1E8449,stroke-width:1.5px,color:#0B3B1E
    classDef external fill:#FFE2B8,stroke:#C56A00,stroke-width:1.5px,color:#5A2D00
    classDef assets fill:#ECECEC,stroke:#6B6B6B,stroke-width:1.5px,color:#222
    classDef assetfile fill:#F5F5F5,stroke:#7A7A7A,stroke-width:1px,color:#222
    classDef data fill:#E9DDFF,stroke:#6C4AA7,stroke-width:1.5px,color:#2D1B52
    classDef config fill:#FFF2CC,stroke:#B7950B,stroke-width:1.5px,color:#4D3B00
    classDef build fill:#FDEBD0,stroke:#CA6F1E,stroke-width:1.2px,color:#4D2A00
    classDef appstyle fill:#FADBD8,stroke:#B03A2E,stroke-width:1.2px,color:#4A1410
    classDef doc fill:#FFFFFF,stroke:#2E6FA6,stroke-width:1.5px,color:#0B2B45
```
