A modern React portfolio website converted from static HTML, ready for backend integration.
- âś… React 18 with Vite for fast development
- âś… React Router for navigation
- âś… Context API for state management
- âś… AOS (Animate On Scroll) for animations
- âś… Swiper for testimonials carousel
- âś… Bootstrap for responsive design
- âś… Modular Components for easy maintenance
- âś… API Service Layer ready for backend integration
portfolio/
├── public/
│ └── assets/ # Static assets (images, CSS, JS)
├── src/
│ ├── components/ # React components
│ │ ├── Header.jsx
│ │ ├── Hero.jsx
│ │ ├── About.jsx
│ │ ├── Stats.jsx
│ │ ├── Skills.jsx
│ │ ├── Resume.jsx
│ │ ├── Portfolio.jsx
│ │ ├── Testimonials.jsx
│ │ ├── Contact.jsx
│ │ └── Footer.jsx
│ ├── context/ # React Context for state management
│ │ └── PortfolioContext.jsx
│ ├── services/ # API service layer
│ │ └── api.js
│ ├── hooks/ # Custom React hooks
│ │ └── useAPI.js
│ ├── App.jsx # Main App component
│ ├── App.css # App-specific styles
│ └── main.jsx # Entry point
- Node.js (v16 or higher)
- npm or yarn
- Install dependencies:
npm install- Start development server:
npm run dev- Open your browser and navigate to
http://localhost:5173
npm run buildThe application is ready for backend integration with the following API endpoints:
Create a .env file in the root directory:
REACT_APP_API_URL=http://localhost:3001/apiThe application expects the following backend endpoints:
GET /api/portfolio- Get all portfolio itemsGET /api/portfolio/:id- Get portfolio item by IDPOST /api/portfolio- Create new portfolio itemPUT /api/portfolio/:id- Update portfolio itemDELETE /api/portfolio/:id- Delete portfolio item
GET /api/testimonials- Get all testimonialsGET /api/testimonials/:id- Get testimonial by IDPOST /api/testimonials- Create new testimonialPUT /api/testimonials/:id- Update testimonialDELETE /api/testimonials/:id- Delete testimonial
GET /api/user- Get user profilePUT /api/user- Update user profile
POST /api/contact- Send contact message
GET /api/skills- Get all skillsPUT /api/skills- Update skills
GET /api/stats- Get all statsPUT /api/stats- Update stats
// server.js
const express = require('express');
const cors = require('cors');
const app = express();
app.use(cors());
app.use(express.json());
// Portfolio routes
app.get('/api/portfolio', (req, res) => {
// Return portfolio items
});
app.post('/api/portfolio', (req, res) => {
// Create new portfolio item
});
// Contact form
app.post('/api/contact', (req, res) => {
// Handle contact form submission
const { name, email, subject, message } = req.body;
// Send email or save to database
res.json({ success: true, message: 'Message sent successfully' });
});
app.listen(3001, () => {
console.log('Server running on port 3001');
});// routes/api.php
Route::get('/portfolio', [PortfolioController::class, 'index']);
Route::post('/portfolio', [PortfolioController::class, 'store']);
Route::put('/portfolio/{id}', [PortfolioController::class, 'update']);
Route::delete('/portfolio/{id}', [PortfolioController::class, 'destroy']);
Route::post('/contact', [ContactController::class, 'send']);CREATE TABLE portfolio_items (
id INT PRIMARY KEY AUTO_INCREMENT,
title VARCHAR(255) NOT NULL,
category VARCHAR(100) NOT NULL,
image VARCHAR(500) NOT NULL,
gallery VARCHAR(100),
link VARCHAR(500),
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
);CREATE TABLE testimonials (
id INT PRIMARY KEY AUTO_INCREMENT,
text TEXT NOT NULL,
author VARCHAR(255) NOT NULL,
image VARCHAR(500),
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);CREATE TABLE contact_messages (
id INT PRIMARY KEY AUTO_INCREMENT,
name VARCHAR(255) NOT NULL,
email VARCHAR(255) NOT NULL,
subject VARCHAR(255) NOT NULL,
message TEXT NOT NULL,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);The application uses React Context for state management:
- PortfolioContext: Manages portfolio data, testimonials, user info, and loading states
- usePortfolio: Custom hook to access portfolio context
- useAPI: Custom hooks for API calls
- Create component in
src/components/ - Import and use in
App.jsx - Add any necessary state to
PortfolioContext.jsx
- Main styles:
public/assets/css/main.css - App-specific styles:
src/App.css - Component-specific styles can be added as CSS modules
- Add endpoint to
src/services/api.js - Create corresponding hook in
src/hooks/useAPI.js - Update context if needed
- Connect your GitHub repository to Vercel
- Set environment variables
- Deploy automatically
- Build the project:
npm run build - Upload
distfolder to Netlify - Set environment variables
- Build the project:
npm run build - Upload
distfolder contents to your web server - Configure server to serve
index.htmlfor all routes
- Fork the repository
- Create a feature branch
- Make your changes
- Test thoroughly
- Submit a pull request
This project is open source and available under the MIT License.