Prerequisites
Before you begin, ensure you have the following installed:- Node.js 18+ - Required for running Vite and React 19
- Git - For cloning the repository
- npm - Package manager (comes with Node.js)
Installation
Install Dependencies
Install all required npm packages:This installs:
- React 19 and React DOM 19
- Vite build tool
- Tailwind CSS v4 with Vite plugin
- GSAP and Lenis for animations
- react-github-calendar for GitHub activity
- @vercel/analytics and @vercel/speed-insights
- @microsoft/clarity for user analytics
Environment Configuration (Optional)
The portfolio uses an optional Available environment variables:
.env file for configuration. Create one if needed:.env
Available Scripts
The portfolio includes the following npm scripts (defined inpackage.json):
Script Details
| Script | Command | Description |
|---|---|---|
dev | vite --port=3000 --host=0.0.0.0 | Starts development server with HMR |
build | vite build | Creates optimized production build |
preview | vite preview | Previews production build locally |
clean | rm -rf dist | Removes build output directory |
lint | tsc --noEmit | Type-checks TypeScript without compilation |
Development Features
Hot Module Replacement (HMR)
The dev server includes Hot Module Replacement for instant updates without page refresh. You can disable HMR if needed:Path Aliases
The project uses@ as an alias for the root directory:
vite.config.ts:18:
Troubleshooting
Port Already in Use
If port 3000 is already in use:Module Not Found Errors
If you encounter module resolution issues:TypeScript Errors
Run type checking to identify TypeScript issues:Tailwind CSS Not Working
Ensure Tailwind CSS v4 is properly configured:- Check that
@import "tailwindcss"is insrc/index.css:1 - Verify
@tailwindcss/viteplugin is loaded invite.config.ts:13 - Clear Vite cache:
rm -rf node_modules/.vite
HMR Not Working
If hot module replacement stops working:Performance Issues
If the dev server is slow:- Disable HMR:
DISABLE_HMR=true npm run dev - Check your browser’s DevTools console for errors
- Ensure no other intensive processes are running
