A modern React portfolio website showcasing projects and work experience.
- Node.js (v16 or higher)
- npm or yarn
- Install dependencies:
npm install- Start the development server:
npm run dev- Build for production:
npm run buildThis project is configured to deploy to GitHub Pages using HashRouter for routing compatibility.
-
Build the project:
npm run build
-
Deploy to GitHub Pages:
Option A: Using GitHub Actions (Recommended)
- Create a
.github/workflows/deploy.ymlfile (see below) - Push to your repository
- GitHub Actions will automatically deploy on push to main
Option B: Manual Deployment
- After building, copy the
distfolder contents to thegh-pagesbranch - Or use a tool like
gh-pages:Add tonpm install --save-dev gh-pages
package.jsonscripts:Then run:"deploy": "npm run build && gh-pages -d dist"
npm run deploy
- Create a
-
Configure GitHub Pages:
- Go to your repository Settings > Pages
- Select source:
gh-pagesbranch (or the branch containing your built files) - Save
- The base path is set to
/portfolio/invite.config.js - If your repository name is different, update the
baseproperty invite.config.js - HashRouter is used instead of BrowserRouter for GitHub Pages compatibility
- All routes use hash-based routing (e.g.,
/#/smart-parking)
portfolio/
├── public/ # Static assets (images, etc.)
├── src/
│ ├── components/ # React components
│ ├── App.jsx # Main app component with routing
│ ├── main.jsx # Entry point
│ └── index.css # Global styles
├── index.html # HTML template
├── vite.config.js # Vite configuration
└── package.json # Dependencies
- React 18
- React Router DOM (HashRouter)
- Vite
- Bootstrap 5
- Font Awesome
© 2024 Dhruv Shah. All rights reserved.