A full-stack e-learning platform built with React, Node.js, and MongoDB. SkillSwap allows users to browse, purchase, and enroll in courses with a modern, responsive design inspired by platforms like Udemy and Physics Wallah.
- User Authentication: Register, login, and logout with JWT tokens
- Course Browsing: Search, filter, and sort courses by category, price, and popularity
- Course Details: Detailed course information with instructor details and curriculum
- Shopping Cart: Add courses to cart and manage items
- Wishlist: Save courses for later purchase
- Enrollment: Enroll in courses after successful payment
- Responsive Design: Mobile-first design that works on all devices
- Dashboard: Analytics and overview of platform metrics
- User Management: View and manage user accounts
- Course Management: Create, edit, and delete courses
- Order Management: Track and manage orders and payments
- Analytics: Revenue, enrollment, and user statistics
- Modern UI: Built with React 18, Vite, and Tailwind CSS
- State Management: Redux Toolkit for predictable state management
- API: RESTful API with Express.js and MongoDB
- Authentication: JWT-based authentication with role-based access control
- Payment Integration: Ready for Stripe integration (mock implementation)
- Responsive: Mobile-first design with smooth animations
- React 18 - UI library
- Vite - Build tool and dev server
- Tailwind CSS - Utility-first CSS framework
- Redux Toolkit - State management
- React Router v6 - Client-side routing
- Axios - HTTP client
- Font Awesome - Icons
- Node.js - Runtime environment
- Express.js - Web framework
- MongoDB - Database
- Mongoose - ODM for MongoDB
- JWT - Authentication
- bcryptjs - Password hashing
- Express Validator - Input validation
- Node.js (v16 or higher)
- MongoDB (v4.4 or higher)
- npm or yarn
-
Navigate to backend directory
cd skillswap-backend -
Install dependencies
npm install
-
Create environment file
cp .env.example .env
-
Configure environment variables
MONGODB_URI=mongodb://localhost:27017/skillswap JWT_SECRET=your_super_secret_jwt_key_here JWT_EXPIRE=7d PORT=5000 NODE_ENV=development CORS_ORIGIN=http://localhost:5173
-
Start the server
npm run dev
The backend will be running on http://localhost:5000
-
Navigate to frontend directory
cd skillswap-frontend -
Install dependencies
npm install
-
Create environment file
cp .env.example .env
-
Configure environment variables
VITE_API_BASE_URL=http://localhost:5000
-
Start the development server
npm run dev
The frontend will be running on http://localhost:5173
name: String (required)email: String (required, unique)password: String (required, hashed)role: String (student, instructor, admin)isAdmin: Booleanprofile: Object (avatar, bio, phone, address)preferences: Object (notifications, theme)enrolledCourses: Array of course IDs
course_name: String (required)description: String (required)price: Number (required)category: String (required)subcategory: Stringcourse_image: String (required)instructor: String (required)instructor_email: String (required)duration: Stringlevel: String (beginner, intermediate, advanced)language: StringisActive: BooleanenrolledCount: Numberrating: NumberreviewCount: Number
user: ObjectId (ref: User)courses: Array of course objectstotalAmount: Numberdiscount: NumberfinalAmount: Numberstatus: String (pending, processing, completed, cancelled, refunded)paymentStatus: String (pending, paid, failed, refunded)paymentMethod: StringtransactionId: StringbillingAddress: Object
user: ObjectId (ref: User)course: ObjectId (ref: Course)order: ObjectId (ref: Order)progress: Number (0-100)completed: BooleancertificateIssued: Boolean
user: ObjectId (ref: User, unique)courses: Array of course objectstotalItems: NumbertotalAmount: Number
user: ObjectId (ref: User, unique)courses: Array of course objects
POST /api/auth/register- Register new userPOST /api/auth/login- Login userGET /api/auth/me- Get current userGET /api/auth/logout- Logout user
GET /api/courses- Get all courses (with filtering, search, pagination)GET /api/courses/latest- Get latest coursesGET /api/courses/trending- Get trending coursesGET /api/courses/search- Search coursesGET /api/courses/category/:category- Get courses by categoryGET /api/courses/:id- Get course by IDPOST /api/courses- Create course (Admin/Instructor)PUT /api/courses/:id- Update course (Admin/Instructor)DELETE /api/courses/:id- Delete course (Admin)
GET /api/cart- Get user's cartGET /api/cart/count- Get cart item countPOST /api/cart- Add course to cartDELETE /api/cart/:courseId- Remove course from cartDELETE /api/cart- Clear entire cart
POST /api/orders- Place order from cartPOST /api/orders/payment- Process paymentGET /api/orders- Get user's ordersGET /api/orders/:orderId- Get order by IDGET /api/orders/admin/all- Get all orders (Admin)PUT /api/orders/:id- Update order status (Admin)GET /api/orders/stats- Get order statistics (Admin)
POST /api/enrollments- Enroll in courseGET /api/enrollments- Get user's enrollmentsGET /api/enrollments/:enrollmentId- Get enrollment by IDPUT /api/enrollments/:enrollmentId/progress- Update progressGET /api/enrollments/check/:courseId- Check enrollment status
GET /api/wishlist- Get user's wishlistPOST /api/wishlist- Add course to wishlistDELETE /api/wishlist/:courseId- Remove from wishlistDELETE /api/wishlist- Clear wishlistGET /api/wishlist/check/:courseId- Check if in wishlist
- Home: Hero section, categories, latest courses, trending courses
- Shop: Course listing with search, filters, and pagination
- Course Details: Course information, enrollment, and related courses
- Cart: Shopping cart management
- Login/Register: Authentication forms
- Admin Dashboard: Analytics and management interface
- Responsive Design: Mobile-first approach with Tailwind CSS
- Smooth Animations: CSS transitions and hover effects
- Modern UI: Clean, professional design inspired by Udemy
- Accessibility: Proper ARIA labels and keyboard navigation
- Performance: Optimized with React 18 features
- Set up MongoDB Atlas or use a MongoDB hosting service
- Configure environment variables for production
- Deploy to platforms like Heroku, Railway, or DigitalOcean
- Set up CORS for your frontend domain
- Build the production version:
npm run build - Deploy to platforms like Vercel, Netlify, or AWS S3
- Configure environment variables for production API URL
- Fork the repository
- Create a feature branch:
git checkout -b feature-name - Commit changes:
git commit -am 'Add feature' - Push to branch:
git push origin feature-name - Submit a pull request
This project is licensed under the MIT License - see the LICENSE file for details.
For support, email support@skillswap.com or create an issue in the repository.
This project was migrated from a PHP-based system. Key improvements include:
- Modern Frontend: React with component-based architecture
- Better State Management: Redux for predictable state updates
- Improved API: RESTful API with proper error handling
- Enhanced Security: JWT authentication with role-based access
- Better Performance: Optimized database queries and caching
- Responsive Design: Mobile-first approach with modern CSS
- Developer Experience: Hot reload, TypeScript support, and better tooling
- Frontend: Optimized with Vite for fast builds and hot reload
- Backend: Express.js with proper middleware and error handling
- Database: MongoDB with optimized queries and indexing
- Caching: Implemented where appropriate for better performance
- Images: Optimized and responsive image loading
Built with β€οΈ using React, Node.js, and MongoDB