How samuel-chow-demon/sam_info works
Project type and purpose
• This is a single-page frontend application (a portfolio site) built with React and Vite.
• It loads static data (YAML files) to drive site content and uses React Three Fiber for 3D badge displays.
File structure
• Top-level:
• package.json, vite.config.js, index.html – define dependencies, build & dev server config, and the single HTML entry.
• src/:
• main.jsx – bootstraps the React app into the DOM.
• App.jsx – root component orchestrating layout & routing-like tab state.
• components/ – all UI pieces: dashboard, about, education, work experience, portfolio, etc.
• data/ – YAML files with content for each section (About.yaml, SkillsAndLang.yaml, etc.).
• hook/ – custom hooks (useYamlCfgStyle) to load & style YAML configs.
• threeFiber/ – subfolders for React Three Fiber UI, 3D components, and badge groups.
README for additional insights
• Very brief: “Sam Info Project. An Embedded App for Sam Portfolio.” Confirms it’s a static portfolio SPA.
a. Main components
1. Developer & Build Tools (VSCode, CLI)
2. Vite Dev Server / Bundler
3. Static Entry (index.html)
4. React Runtime (main.jsx → App.jsx)
5. Content Loader (YAML parser via useYamlCfgStyle hook)
6. UI Components (About, Dashboard, Portfolio, etc.)
7. 3D Renderer (React Three Fiber + three.js)
8. Utility Modules (ImgLibrary, style.js, constant.js)
9. Public Assets (public/)
10. Deployment Target (Static host / CDN)
b. Relationships & interactions
• Developer invokes Vite → starts Dev Server or Build → outputs bundled JS/CSS.
• index.html loads bundle into browser.
• main.jsx calls ReactDOM.render(App) → mounts root component.
• App.jsx uses hooks to fetch YAML data and passes it to UI components.
• Some components delegate to threeFiber/ for 3D badge rendering: they mount a Canvas, load textures via utility/iconTexture, then render badge groups.
• Utility modules supply cross-cutting functions (e.g., ImgLibrary maps names to image URLs).
• Public/ assets are referenced by components or utility library at runtime.
c. Architectural patterns & principles
• Component-based UI (React).
• Separation of concerns: data (YAML) vs. presentation (JSX components).
• Hook abstraction for config‐style loading.
• Layered approach: data loader → UI components → 3D engine → browser.
d. Key technologies
• Vite (dev server & bundler)
• React & ReactDOM
• React Three Fiber + three.js
• YAML loader (JS-based parser via custom hook)
• CSS for styling (index.css & style.js helpers)