# platypusonmars/portfolio-site architecture

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

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

## Overview

##### Project type and purpose
- This is a single-page application (SPA) built with Create React App.
- Its purpose is purely front-end: it serves a React component tree that renders a UI (Banner, NavBar, Skills, ProjectCard, Footer, etc.) in the browser.

##### File structure
- Top level: package.json & lockfile, public/, src/
- public/: static assets served as-is (index.html, manifest.json, robots.txt, images/fonts under /public or /src/assets).
- src/: React entrypoint (index.js → App.js), CSS, test files, asset folders, component subfolder with presentational components.
- Build and dev config is hidden behind CRA scripts.

##### Extract insights from the README
- Standard CRA scripts: start (dev server + HMR), test, build (webpack-based bundling + optimization), eject (advanced custom config).
- No backend, no API endpoints—pure static site with JS bundle.

a. Main components
- Developer’s machine (IDE)
- Build pipeline (npm scripts + Webpack + Babel)
- Static asset server / hosting (e.g., NGINX, CDN, GitHub Pages)
- Client browser
- React runtime + Component tree (App → NavBar, Banner, LifeSpanner, Skills, ProjectCard, Footer)
- Asset repositories (images, fonts, CSS)

b. Relationships & interactions
1. Developer writes code in src/ → runs `npm start` or `npm run build`.
2. Webpack + Babel transpile & bundle JS/CSS/images → output to build/ folder.
3. CI/CD or manual deploy pushes build/ to hosting/CDN.
4. Browser requests index.html → static server returns index.html + bundle.js + other assets.
5. Browser runs bundle.js → React mounts to
→ renders component tree.

c. Architectural patterns & principles
- SPA pattern: client-side routing (if present) and rendering.
- Component-based design: UI broken into reusable presentation components.
- Asset pipeline: Webpack handles code splitting, tree shaking.
- Dev vs. Prod branching: Hot Module Replacement in dev, optimizations in prod build.

d. Key technologies/frameworks
- React (with react-dom)
- Webpack + Babel under the hood (via CRA)
- npm (or yarn) scripts for build/test/start
- CSS modules (global .css files)
- Optional test runner (Jest + React Testing Library)

## Diagram (Mermaid)

```mermaid
flowchart TD
  subgraph "Developer Environment"
    Dev["Developer IDE"]:::dev
    Pkg["package.json & npm scripts"]:::dev
    Dev --> SourceCodeGroup
    Dev --> Pkg
  end

  subgraph "Source Code"
    direction TB
    SourceCodeGroup(("Source Files")):::dev
    IndexJS["src/index.js"]:::dev
    Report["src/reportWebVitals.js"]:::dev
    AppJS["src/App.js"]:::dev
    IndexCSS["src/index.css"]:::dev
    AppCSS["src/App.css"]:::dev
    SetupTests["src/setupTests.js"]:::dev
    AppTest["src/App.test.js"]:::dev
    AssetsImg["src/assets/img/"]:::assets
    AssetsFont["src/assets/font/"]:::assets
    SourceCodeGroup --> IndexJS
    SourceCodeGroup --> Report
    SourceCodeGroup --> AppJS
    SourceCodeGroup --> IndexCSS
    SourceCodeGroup --> AppCSS
    SourceCodeGroup --> SetupTests
    SourceCodeGroup --> AppTest
    SourceCodeGroup --> AssetsImg
    SourceCodeGroup --> AssetsFont
  end

  subgraph "Public Assets"
    direction TB
    PublicDir(("public/")):::hosting
    PubIndex["public/index.html"]:::hosting
    PubManifest["public/manifest.json"]:::hosting
    PubRobots["public/robots.txt"]:::hosting
    PublicDir --> PubIndex
    PublicDir --> PubManifest
    PublicDir --> PubRobots
  end

  subgraph "Build Pipeline"
    Webpack["Webpack + Babel"]:::build
    BuildOutput["build/ (bundled assets)"]:::build
  end

  Pkg -->|"npm run build/start"| Webpack
  SourceCodeGroup -->|"input to"| Webpack
  Webpack -->|"transpile & bundle"| BuildOutput

  subgraph "Hosting / CDN"
    Server["Static Server / CDN"]:::hosting
  end

  BuildOutput --> Server
  PublicDir --> Server

  Server -->|"serves index.html & assets"| Browser["Browser"]:::client

  subgraph "Client Runtime"
    direction TB
    ReactRuntime["React runtime"]:::client
    AppComponent["App Component"]:::client
    Components(("Component Tree")):::client
    Browser --> ReactRuntime
    ReactRuntime -->|"executes src/index.js"| IndexJS
    IndexJS -->|"renders"| AppComponent
    AppComponent --> Components
    Components --> CompNav
    Components --> CompBanner
    Components --> CompLife
    Components --> CompSkills
    Components --> CompProject
    Components --> CompFooter
  end

  CompNav["NavBar"]:::client
  CompBanner["Banner"]:::client
  CompLife["LifeSpanner"]:::client
  CompSkills["Skills"]:::client
  CompProject["ProjectCard"]:::client
  CompFooter["Footer"]:::client

  click Pkg "https://github.com/platypusonmars/portfolio-site/blob/main/package.json"
  click PublicDir "https://github.com/platypusonmars/portfolio-site/tree/main/public/"
  click PubIndex "https://github.com/platypusonmars/portfolio-site/blob/main/public/index.html"
  click PubManifest "https://github.com/platypusonmars/portfolio-site/blob/main/public/manifest.json"
  click PubRobots "https://github.com/platypusonmars/portfolio-site/blob/main/public/robots.txt"
  click IndexJS "https://github.com/platypusonmars/portfolio-site/blob/main/src/index.js"
  click Report "https://github.com/platypusonmars/portfolio-site/blob/main/src/reportWebVitals.js"
  click AppJS "https://github.com/platypusonmars/portfolio-site/blob/main/src/App.js"
  click IndexCSS "https://github.com/platypusonmars/portfolio-site/blob/main/src/index.css"
  click AppCSS "https://github.com/platypusonmars/portfolio-site/blob/main/src/App.css"
  click SetupTests "https://github.com/platypusonmars/portfolio-site/blob/main/src/setupTests.js"
  click AppTest "https://github.com/platypusonmars/portfolio-site/blob/main/src/App.test.js"
  click AssetsImg "https://github.com/platypusonmars/portfolio-site/tree/main/src/assets/img/"
  click AssetsFont "https://github.com/platypusonmars/portfolio-site/tree/main/src/assets/font/"
  click CompBanner "https://github.com/platypusonmars/portfolio-site/blob/main/src/components/Banner.js"
  click CompNav "https://github.com/platypusonmars/portfolio-site/blob/main/src/components/NavBar.js"
  click CompLife "https://github.com/platypusonmars/portfolio-site/blob/main/src/components/LifeSpanner.js"
  click CompSkills "https://github.com/platypusonmars/portfolio-site/blob/main/src/components/Skills.js"
  click CompProject "https://github.com/platypusonmars/portfolio-site/blob/main/src/components/ProjectCard.js"
  click CompFooter "https://github.com/platypusonmars/portfolio-site/blob/main/src/components/Footer.js"

  classDef dev fill:#ACE7EF,stroke:#036280,color:#036280;
  classDef build fill:#FFD59E,stroke:#C46C00,color:#C46C00;
  classDef hosting fill:#C8E6C9,stroke:#2E7D32,color:#2E7D32;
  classDef client fill:#FFF59D,stroke:#F9A825,color:#F9A825;
  classDef assets fill:#E1BEE7,stroke:#6A1B9A,color:#6A1B9A;
```
