How pbao9/portfolio-baro works
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