A modern, full-stack portfolio website built with React, TypeScript, Node.js, Express, and MongoDB Atlas. Features a beautiful, responsive frontend with dark/light theme support and a robust RESTful API backend with admin panel for content management.
- π¨ Modern UI/UX - Beautiful, responsive design with glassmorphism effects
- π Dark/Light Theme - System-aware theme switching with smooth transitions
- π± Fully Responsive - Optimized for all device sizes
- π Smooth Animations - Powered by Framer Motion
- π Admin Portal - Secure admin panel for content management
- π Contact Form - Functional contact form with validation
- π― SEO Optimized - Meta tags and semantic HTML
- β‘ Fast Performance - Optimized with Vite and code splitting
- π JWT Authentication - Secure admin authentication
- π RESTful API - Well-structured API endpoints
- ποΈ MongoDB Atlas - Cloud database integration
- π€ File Upload - CV/resume upload support
- β Input Validation - Request validation with express-validator
- π‘οΈ Security - CORS, password hashing, secure headers
- π§ Contact Management - Contact form submissions with admin dashboard
portfolio-website/
βββ frontend/ # React + TypeScript frontend
β βββ src/
β β βββ components/ # React components
β β β βββ About.tsx
β β β βββ Admin.tsx # Admin content management panel
β β β βββ BackgroundParticles.tsx
β β β βββ Certifications.tsx
β β β βββ Contact.tsx
β β β βββ Experience.tsx
β β β βββ Hero.tsx
β β β βββ Login.tsx
β β β βββ Navbar.tsx
β β β βββ Projects.tsx
β β β βββ Skills.tsx
β β β βββ ...
β β βββ contexts/ # React Context providers
β β β βββ SiteDataContext.tsx
β β β βββ ThemeContext.tsx
β β βββ types/ # TypeScript type definitions
β β βββ constants/ # Application constants
β β βββ services/ # API service functions
β β βββ utils/ # Utility functions
β β βββ App.tsx # Main application component
β β βββ main.tsx # Application entry point
β βββ public/ # Static assets
β βββ index.html
β βββ package.json
β
βββ backend/ # Node.js + Express backend
β βββ config/
β β βββ database.js # MongoDB connection
β βββ models/ # MongoDB Mongoose models
β β βββ User.js
β β βββ PersonalInfo.js
β β βββ ProfessionalSummary.js
β β βββ Experience.js
β β βββ SkillCategory.js
β β βββ Project.js
β β βββ Certification.js
β β βββ ContactMessage.js
β βββ routes/ # API route handlers
β β βββ auth.js # Authentication routes
β β βββ siteData.js # Portfolio data CRUD
β β βββ contact.js # Contact form routes
β β βββ upload.js # File upload routes
β βββ middleware/ # Express middleware
β β βββ auth.js # JWT authentication
β β βββ upload.js # File upload handling
β βββ scripts/ # Utility scripts
β β βββ seedDatabase.js # Database seeding
β β βββ testConnection.js # Connection testing
β βββ uploads/ # Uploaded files directory
β βββ server.js # Application entry point
β βββ package.json
β
βββ docs/ # Documentation
- Node.js >= 18.0.0
- npm >= 9.0.0
- MongoDB Atlas account (or local MongoDB instance)
-
Clone the repository:
git clone <repository-url> cd portfolio-website
-
Install all dependencies:
npm run install:all
-
Set up environment variables:
Backend:
cd backend cp ENV_TEMPLATE.txt .env # Edit .env with your MongoDB connection string and settings
Frontend:
cd frontend cp .env.example .env # Edit .env with your API URL
-
Seed the database (optional but recommended):
cd backend npm run seedThis creates an admin user and populates initial portfolio data.
-
Start development servers:
# From root directory - starts both frontend and backend npm run dev # Or start individually: npm run dev:frontend # Frontend on http://localhost:5173 npm run dev:backend # Backend on http://localhost:5000
- React 19 - UI library
- TypeScript - Type safety
- Vite - Build tool and dev server
- Tailwind CSS - Utility-first CSS framework
- Framer Motion - Animation library
- Lucide React - Icon library
- Context API - State management
- Node.js - Runtime environment
- Express.js - Web framework
- MongoDB Atlas - Cloud database
- Mongoose - MongoDB ODM
- JWT - Authentication tokens
- bcryptjs - Password hashing
- Multer - File upload handling
- express-validator - Input validation
POST /api/auth/login- Admin loginGET /api/auth/verify- Verify JWT token
GET /api/site-data- Get all portfolio dataGET /api/site-data/personal-info- Get personal informationGET /api/site-data/professional-summary- Get professional summaryGET /api/site-data/experiences- Get all experiencesGET /api/site-data/skill-categories- Get all skill categoriesGET /api/site-data/projects- Get all projectsGET /api/site-data/certifications- Get all certifications
PUT /api/site-data/personal-info- Update personal infoPUT /api/site-data/professional-summary- Update professional summaryPOST /api/site-data/experiences- Create experiencePUT /api/site-data/experiences/:id- Update experienceDELETE /api/site-data/experiences/:id- Delete experience- Similar CRUD operations for projects, certifications, and skill categories
POST /api/contact- Submit contact form (public)GET /api/contact- Get all messages (admin)GET /api/contact/:id- Get single message (admin)PATCH /api/contact/:id/read- Mark as read (admin)PATCH /api/contact/:id/replied- Mark as replied (admin)DELETE /api/contact/:id- Delete message (admin)
POST /api/upload/cv- Upload CV file (admin)GET /api/upload/:filename- Serve uploaded file
GET /api/health- Server health check
Create a .env file in the backend/ directory with the following variables:
PORT- Server port (default: 5000)NODE_ENV- Environment (development/production)MONGODB_URI- Your MongoDB Atlas connection string (get from MongoDB Atlas dashboard)JWT_SECRET- A strong random string for JWT token signingADMIN_USERNAME- Admin username for loginADMIN_PASSWORD- Admin password (use a strong password in production)FRONTEND_URL- Frontend URL for CORS (default: http://localhost:5173)UPLOAD_DIR- Directory for uploaded files (default: ./uploads)MAX_FILE_SIZE- Maximum file size in bytes (default: 5242880)
.env file to version control. Use ENV_TEMPLATE.txt as a reference.
# API Configuration
VITE_API_URL=http://localhost:5000/api
# Environment
VITE_NODE_ENV=developmentnpm run dev- Start both frontend and backend in development modenpm run build- Build both frontend and backend for productionnpm run install:all- Install dependencies for all workspacesnpm run dev:frontend- Start only frontendnpm run dev:backend- Start only backendnpm run build:frontend- Build only frontendnpm run build:backend- Build only backend
npm run dev- Start Vite dev server (http://localhost:5173)npm run build- Build for productionnpm run preview- Preview production buildnpm run lint- Run ESLintnpm run type-check- Type check without emitting filesnpm run clean- Clean build artifacts
npm run dev- Start development server with watch modenpm start- Start production servernpm run seed- Seed database with initial datanpm run test-connection- Test MongoDB connectionnpm run lint- Run linternpm run clean- Clean build artifacts
- Admin user for authentication
- Username and hashed password
- Role-based access
- Personal information (name, email, phone, social links, etc.)
- Singleton model (only one document)
- Professional summary with highlights
- Singleton model
- Work experience entries
- Role, company, period, description
- Skill categories with skills array
- Ordering support
- Portfolio projects
- Title, description, tech stack, GitHub URL, images
- Professional certifications
- Issuer, dates, credential URLs
- Contact form submissions
- Name, email, subject, message
- Read/replied status tracking
The admin panel uses JWT (JSON Web Tokens) for authentication:
- Login:
POST /api/auth/loginwith username and password - Receive: JWT token in response
- Use: Include token in
Authorization: Bearer <token>header for protected routes - Expiry: Tokens expire after 24 hours (configurable)
Access the admin panel by:
- Navigate to the website
- Click the admin button (usually in navbar)
- Login with admin credentials
- Manage all portfolio content:
- Personal information
- Professional summary
- Work experiences
- Skills and categories
- Projects
- Certifications
# Test MongoDB connection
cd backend
npm run test-connection
# Type checking (frontend)
cd frontend
npm run type-check
# Linting
npm run lint- Verify your MongoDB connection string in
.envis correct - Check MongoDB Atlas IP whitelist includes your IP
- Ensure database user credentials are correct
- Test connection:
npm run test-connection(in backend)
- Change
PORTin backend.env - Change port in
frontend/vite.config.ts
- Run
npm installin the affected workspace - Check import paths use
@/alias (frontend) - Verify TypeScript path mapping in
tsconfig.json
- Verify your JWT secret is set correctly in
.env - Check token hasn't expired (24 hours default)
- Ensure
Authorization: Bearer <token>header format is correct
- Verify
FRONTEND_URLin backend.envmatches frontend URL - Check CORS configuration in
backend/server.js
Frontend:
- Vercel (recommended)
- Netlify
- GitHub Pages
- AWS S3 + CloudFront
Backend:
- Railway
- Render
- Heroku
- AWS EC2/Elastic Beanstalk
- Google Cloud Run
-
Build frontend:
cd frontend npm run build -
Set production environment variables:
- Use a strong JWT secret
- Update MongoDB connection string to production database
- Change admin credentials to secure values
- Set
NODE_ENV=production - Update
FRONTEND_URLto production domain
-
Deploy backend:
- Push to your hosting platform
- Configure environment variables
- Start the server
-
Deploy frontend:
- Upload
dist/folder or connect repository - Set
VITE_API_URLto your backend API URL
- Upload
- TypeScript - Strict mode enabled
- ESLint - Code linting
- Prettier - Code formatting
- EditorConfig - Consistent editor settings
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
ISC
- React team for the amazing framework
- Vite for the blazing-fast build tool
- MongoDB Atlas for cloud database hosting
- All open-source contributors
For support, email kavishkacherath@gmail.com or open an issue in the repository.
Built with β€οΈ using React, TypeScript, Node.js, and MongoDB