Technology Stack
React 19
Latest React with improved performance and modern features
Vite 7
Next-generation build tool with lightning-fast HMR
React Router DOM 7
Client-side routing for seamless navigation
CSS Modules
Scoped styling with zero runtime overhead
Why This Stack?
React 19
The latest version of React brings several key improvements:- Improved performance: Faster rendering and reconciliation
- Server Components ready: Future-proof architecture
- Better error handling: Enhanced developer experience
- Modern patterns: Full support for hooks and concurrent features
Vite 7
Vite provides a superior development experience compared to traditional bundlers:Near-instant Hot Module Replacement (HMR)
Near-instant Hot Module Replacement (HMR)
Changes to your components appear in the browser in milliseconds, not seconds. Vite achieves this by serving ES modules directly during development and only transforming files on demand.
Optimized Production Builds
Optimized Production Builds
Vite uses Rollup under the hood to create highly optimized production bundles with automatic code splitting, tree shaking, and minification.
Native ES Modules
Native ES Modules
During development, Vite serves your code via native ES modules, eliminating the need for bundling during development entirely.
vite.config.js
Component Architecture
The portfolio follows a component-based architecture where the UI is broken down into reusable, self-contained components.Component Structure
Each component follows a consistent pattern:Main Application Flow
src/App.jsx
Component Hierarchy
CSS Modules Architecture
The portfolio uses CSS Modules for component styling, providing:- Scoped styles: Class names are locally scoped, preventing conflicts
- Zero runtime overhead: Styles are extracted at build time
- TypeScript-friendly: Can be typed for better developer experience
- Component co-location: Styles live next to components
How CSS Modules Work
Example Component
hero into unique identifiers like Hero_hero__a1b2c, ensuring no naming conflicts across components.
Global Styles
Global styles and CSS variables live insrc/index.css:
src/index.css
State Management
This portfolio uses React’s built-in state management with hooks:useStatefor local component state (e.g., form inputs, menu open/closed)useParamsfrom React Router for reading URL parametersuseNavigatefor programmatic navigation
For a portfolio site with limited state complexity, React’s built-in hooks are sufficient. As your needs grow, consider adding Context API or a state management library like Zustand.
Data Architecture
Project data is centralized in a single source of truth:src/data/projects.js
Build & Dev Server
Development Server
- Serves files at
http://localhost:5173 - Enables HMR (hot module replacement)
- Runs on your local network with
--hostflag - Provides instant feedback for code changes
Production Build
- Bundles and minifies JavaScript/CSS
- Tree-shakes unused code
- Splits code for optimal loading
- Generates static assets in
dist/
Preview Production Build
Performance Optimizations
The architecture includes several built-in optimizations:Code Splitting
Routes are automatically split into separate chunks
Tree Shaking
Unused code is eliminated from production builds
Asset Optimization
Images and assets are optimized during build
CSS Extraction
CSS is extracted and minified separately
Image Optimization
WebP images are used throughout for optimal performance:Development Workflow
Edit components
Make changes to components in
src/components/. Changes appear instantly in the browser.Next Steps
Project Structure
Explore the complete directory layout
Routing
Learn about React Router integration
Components
Dive into individual components
Customization
Customize the portfolio for your brand