This is a personal portfolio website built with React to showcase projects, skills, and provide contact information.
The Problem: The original implementation loaded project data directly from the GitHub API in the browser, using a GITHUB_TOKEN that was stored in the client-side code. This created a critical security vulnerability, as the secret token was visible to any visitor of the website.
The Solution:
github.secret.js file containing the token has been removed from the project to eliminate the exposure.mock-repos.js to display sample data for the project list. This ensures the website is fully functional and secure.Future Recommendation: To load real, dynamic data securely, a backend solution (like a serverless function on Vercel/Netlify or a small Node.js server) should be implemented. This backend would store the API key safely and make the requests to the GitHub API, never exposing the key in the browser.
To run the project locally, follow these steps.
You will need Node.js (version 14 or higher) and npm on your system.
git clone <YOUR_REPOSITORY_URL>
cd personal-portfolio
npm install
Configure Environment Variables:
Create a .env file in the project root directory:
cp .env.example .env
Then edit .env and add your credentials:
# EmailJS Configuration (required for contact form)
REACT_APP_EMAILJS_SERVICE_ID=your_service_id_here
REACT_APP_EMAILJS_TEMPLATE_ID=your_template_id_here
REACT_APP_EMAILJS_PUBLIC_KEY=your_public_key_here
# GitHub Configuration (optional, for Projects component)
REACT_APP_GITHUB_USERNAME=your_github_username
REACT_APP_GITHUB_TOKEN=your_github_token_here
How to get EmailJS credentials:
Note: The .env file is gitignored and will not be committed to version control.
To start the development server (usually on http://localhost:8080):
npm start
To create an optimized production build in the dist/ directory:
npm run build
Run ESLint to check code quality:
npm run lint
Auto-fix linting issues:
npm run lint:fix
Run tests:
npm test
Contact form not working:
.env file with valid EmailJS credentialsBuild errors:
node_modules and package-lock.json, then run npm install again/
├── public/
│ └── index.html # HTML template
├── src/
│ ├── components/ # Reusable React components
│ │ ├── AboutMe/
│ │ ├── Contact/
│ │ ├── Header/
│ │ ├── Hero/
│ │ ├── Projects/ # Project list component (now using mock data)
│ │ └── ...
│ ├── styles/ # Global styles
│ ├── App.jsx # Main app component
│ └── index.js # Application entry point
├── package.json # Project dependencies and scripts
└── webpack.config.js # Webpack configuration