A full-stack e-learning platform built with the MERN (MongoDB, Express.js, React, Node.js) stack that enables instructors to create and manage courses while allowing students to enroll, learn, and earn certificates.
- π Browse and search available courses
- π Enroll in courses with integrated payment system (Stripe)
- πΉ Watch video lectures with progress tracking
- π Take tests and quizzes
- π Earn certificates upon course completion
- π Track learning progress
- π Dark mode support
- β Create and manage courses
- πΉ Upload and organize lectures
- π Create tests and quizzes for courses
- π Dashboard with analytics
- π₯ View enrolled students
- βοΈ Edit course content and structure
- π· Upload course thumbnails and media
- π Secure authentication with JWT
- π³ Payment integration with Stripe
- βοΈ Media storage with Cloudinary
- π± Responsive design with Tailwind CSS
- π¨ Modern UI with Radix UI components
- π Real-time progress tracking
- π State management with Redux Toolkit
- React 18 - UI library
- Vite - Build tool and dev server
- Redux Toolkit - State management
- React Router - Navigation
- Tailwind CSS - Styling
- Radix UI - Component library
- React Player - Video playback
- React Quill - Rich text editor
- Recharts - Data visualization
- Axios - HTTP client
- Lucide React - Icons
- Node.js - Runtime environment
- Express.js - Web framework
- MongoDB - Database
- Mongoose - ODM
- JWT - Authentication
- bcryptjs - Password hashing
- Stripe - Payment processing
- Cloudinary - Media storage
- Multer - File uploads
- PDFKit - Certificate generation
Before you begin, ensure you have the following installed:
- Node.js (v18 or higher)
- MongoDB (local or Atlas account)
- npm or yarn package manager
git clone https://github.com/ShreyashDesai021/E-learning_Platform_using_MERN.git
cd E-learning_Platform_using_MERNcd server
npm installCreate a .env file in the server directory:
# Database
MONGODB_URI=your_mongodb_connection_string
# Server
PORT=8080
# JWT
JWT_SECRET=your_jwt_secret
# Cloudinary (for media uploads)
CLOUDINARY_CLOUD_NAME=your_cloudinary_cloud_name
CLOUDINARY_API_KEY=your_cloudinary_api_key
CLOUDINARY_API_SECRET=your_cloudinary_api_secret
# Stripe (for payments)
STRIPE_SECRET_KEY=your_stripe_secret_key
STRIPE_WEBHOOK_SECRET=your_stripe_webhook_secret
# Client URL
CLIENT_URL=http://localhost:5173cd ../client
npm installCreate a .env file in the client directory:
VITE_API_URL=http://localhost:8080
VITE_STRIPE_PUBLISHABLE_KEY=your_stripe_publishable_keyTerminal 1 - Start Backend:
cd server
npm run devTerminal 2 - Start Frontend:
cd client
npm run devThe application will be available at:
- Frontend:
http://localhost:5173 - Backend API:
http://localhost:8080
E-learning_Platform_using_MERN/
βββ client/ # Frontend React application
β βββ public/ # Static files
β βββ src/
β β βββ app/ # Redux store configuration
β β βββ assets/ # Images and static assets
β β βββ components/ # Reusable UI components
β β βββ features/ # Redux slices/features
β β βββ layout/ # Layout components
β β βββ lib/ # Utility functions
β β βββ pages/ # Page components
β β β βββ admin/ # Admin/Instructor pages
β β β βββ student/ # Student pages
β β βββ App.jsx # Main App component
β β βββ main.jsx # Entry point
β βββ package.json
β βββ vite.config.js
β
βββ server/ # Backend Node.js application
βββ controllers/ # Request handlers
βββ database/ # Database configuration
βββ middlewares/ # Custom middleware
βββ models/ # Mongoose models
βββ routes/ # API routes
βββ utils/ # Utility functions
βββ index.js # Server entry point
βββ package.json
- User - Student and instructor profiles
- Course - Course information and metadata
- Lecture - Individual video lectures
- Test - Quizzes and assessments
- TestAttempt - Student test submissions
- CoursePurchase - Payment and enrollment records
- CourseProgress - Student progress tracking
POST /api/v1/user/register- Register new userPOST /api/v1/user/login- User loginPOST /api/v1/user/logout- User logout
GET /api/v1/course- Get all coursesPOST /api/v1/course- Create course (admin)PUT /api/v1/course/:id- Update course (admin)DELETE /api/v1/course/:id- Delete course (admin)
GET /api/v1/course/:courseId/lecture- Get course lecturesPOST /api/v1/course/:courseId/lecture- Create lecture (admin)
POST /api/v1/purchase/checkout- Create checkout sessionPOST /api/v1/purchase/webhook- Stripe webhook handler
GET /api/v1/progress/:courseId- Get course progressPOST /api/v1/progress/:courseId/lecture/:lectureId- Update progress
The platform includes test functionality for courses:
# Run client tests (if available)
cd client
npm run lint
# Run server in development mode
cd server
npm run devcd client
npm run buildcd server
npm start- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is licensed under the ISC License.
Shreyash Desai
- MERN Stack Community
- React and Node.js documentation
- Stripe for payment integration
- Cloudinary for media management
- All open-source libraries used in this project
For support, please open an issue in the GitHub repository.
Made with β€οΈ using MERN Stack