How imnakul/my_portfolio works
Project type and purpose
• This is a front‑end single‑page application (SPA) built with React and Vite.
• Its purpose is to serve static content (portfolio pages, media assets, data-driven components) delivered via a modern dev/build toolchain and deployed as a static site (e.g. on Vercel).
File structure
• Top‑level config files:
• package.json, package-lock.json – NPM dependencies and scripts
• vite.config.js – Vite build/dev server config
• tailwind.config.js, postcss.config.js – Tailwind CSS & PostCSS setup
• eslint.config.js – linting rules
• vercel.json – deployment config
• Public assets:
• index.html – SPA bootstrap
• Source code under src/:
• main.jsx – entry point that renders <App/>
• App.jsx + App.css – root layout
• components/ – React UI components (Home, About, Projects, Navbar, etc.)
• data/ – JSON‑like modules (ProjectsData.js) passed into components
• design/ – custom cursor & design‑specific components + CSS
README for insights
• Confirms React + Vite template, using either @vitejs/plugin-react (Babel) or plugin-react-swc (SWC) for Fast Refresh.
• No backend or API layers—pure front‑end.
Main components
a. Developer Workstation
– Code editor
– npm/yarn scripts (dev, build, lint)
b. Build & Dev Toolchain (Node.js processes)
– Vite Dev Server (with HMR)
– Vite Production Build (Rollup under the hood)
– ESLint stage
– PostCSS/Tailwind CSS processor
c. React Application
– src/main.jsx → ReactDOM.render(App)
– App and nested components (Navbar, Home, Projects…)
– Data layer (ProjectsData.js)
– Custom design components (CustomCursor)
d. Static Assets
– index.html
e. Deployment Host
– Vercel (serves built static files)
Relationships and data flow
• Developer edits src/ → Vite Dev Server bundles & serves index.html + JS/CSS with HMR → Browser
• On build: Vite bundles React code, applies PostCSS/Tailwind, outputs static files → Vercel deployment
• At runtime: Browser fetches index.html, JS bundle, CSS → React hydrates UI, loads media assets via static URLs
Architectural patterns & design principles
• SPA architecture with component‑based UI
• Data‑driven rendering (ProjectsData.js)
• Modular CSS (App.css, CustomCursor.css) + utility‑first Tailwind
• Plugin‑based build pipeline (ESLint, Babel/SWC, PostCSS)
Final checklist
• All major components (Developer, Toolchain, React App, Assets, Deployment)
• Optional: annotate where HMR and Fast Refresh occur in Dev mode