How onlyoneaman/portfolio-website works
Project type and purpose
• This is a front-end single-page application (SPA) template built with React + TypeScript.
• It uses Vite as the dev server/bundler and Tailwind for styling.
• No “backend” per se—everything is static assets and client-side code.
High-level architectural components
A. Developer Toolchain
– Node.js + pnpm/npm
– linters/prettier (ESLint, Prettier)
– TypeScript compiler (tsc) & swc (for scripts)
– Vite dev server / build pipeline
B. Source Code (src/)
– entrypoint: index.html → index.tsx → App.tsx
– UI Components (src/components/ui)
– Page Components (HomePage, AboutPage, ContactPage under src/components)
– Layout (Sidebar, Container, Footer, SeoPart, etc.)
– Assets (src/assets/images)
– Utility library (src/lib/utils.ts)
C. Styling
– Tailwind CSS (tailwind.config.cjs + postcss.config.cjs)
D. Build Output
– Bundled JS/CSS → /dist (static files)
– Static host or CDN (Netlify, Vercel, GitHub Pages)
Relationships and data flow
• Developer runs pnpm dev → Vite dev server compiles TS/JS/CSS on the fly.
• Browser requests index.html → Vite injects dev client → React SPA boots.
• React router (if used) or internal state navigates between HomePage, AboutPage, ContactPage.
• Components assemble UI by importing common/ui subcomponents.
• Tailwind classes feed into PostCSS → final CSS served.
• On build (pnpm build), Vite outputs optimized static assets for hosting.
Important architectural patterns & design principles
• Component-based architecture (React functional components).
• Separation of concerns:
– “ui” folder for generic, reusable controls
– “Common” buttons/containers vs. page-specific components
– “Layout” folder handles frame (header/sidebar/footer)
• Configuration-as-code (all config in package.json + .cjs/.mjs files).
• Fast iterations via Vite’s HMR and swc for scripts.