A comprehensive, full-stack Learning Management System built with the MERN stack that enables seamless online course creation, distribution, and learning. This platform provides a complete ecosystem for instructors to monetize their content and students to access high-quality educational materials.
- Overview
- Key Features
- Technology Stack
- Architecture
- Getting Started
- Environment Configuration
- API Documentation
- Deployment
- Contributing
- Author
This Learning Management System is a production-ready platform that facilitates online education through a modern, scalable architecture. The application supports multiple user roles (students and instructors), secure payment processing, media management, and real-time progress tracking.
- Complete Course Management: Full CRUD operations for courses and lectures
- Secure Payments: Integrated Stripe payment gateway with webhook support
- Media Handling: Cloudinary integration for efficient video and image storage
- User Experience: Responsive design with dark/light mode support
- Progress Tracking: Real-time course completion monitoring
- Advanced Search: Keyword and category-based course filtering
- Role-Based Access: Separate dashboards for students and instructors
- Course Discovery: Browse and search courses with advanced filtering options
- Secure Checkout: Purchase courses through Stripe payment gateway
- Learning Dashboard: Track course progress and continue where you left off
- Video Learning: Stream high-quality video lectures
- Profile Management: Manage personal information and view purchase history
- Course Creation: Create and publish courses with rich media content
- Lecture Management: Add, edit, and organize course lectures
- Content Upload: Upload videos and images with automatic optimization
- Analytics Dashboard: Monitor course performance and student enrollment
- Course Controls: Toggle course visibility and manage pricing
- Authentication & Authorization: JWT-based secure authentication system
- State Management: Redux Toolkit with RTK Query for efficient data fetching
- Responsive Design: Mobile-first approach with TailwindCSS
- Theme Support: Dynamic dark/light mode switching
- Protected Routes: Role-based route protection and authentication guards
- Real-time Updates: Instant UI updates with optimistic responses
- Error Handling: Comprehensive error handling and user feedback
- Framework: React 18 with Vite for lightning-fast development
- State Management: Redux Toolkit with RTK Query
- Styling: TailwindCSS with custom configurations
- UI Components: Radix UI primitives and ShadCN UI
- Routing: React Router v6 with protected routes
- Rich Text: React Quill for course descriptions
- Video Player: React Player for lecture streaming
- Icons: Lucide React icon library
- HTTP Client: Axios with interceptors
- Runtime: Node.js with Express.js framework
- Database: MongoDB with Mongoose ODM
- Authentication: JWT (JSON Web Tokens) and bcrypt
- Payment Processing: Stripe API with webhook integration
- File Upload: Multer for multipart form handling
- Cloud Storage: Cloudinary for media management
- Security: Cookie-parser, CORS configuration
- Development: Nodemon for auto-reloading
- Environment Management: dotenv for configuration
- Deployment: Vercel (Frontend) and Render (Backend)
- Version Control: Git
LMS/
βββ client/ # Frontend application
β βββ src/
β β βββ app/ # Redux store configuration
β β βββ assets/ # Static assets
β β βββ components/ # Reusable React components
β β βββ features/ # Redux slices and API endpoints
β β βββ layout/ # Layout components
β β βββ lib/ # Utility functions
β β βββ pages/ # Page components
β β βββ admin/ # Instructor dashboard pages
β β βββ student/ # Student-facing pages
β βββ public/ # Public assets
β
βββ server/ # Backend application
βββ controllers/ # Request handlers
βββ database/ # Database connection
βββ middlewares/ # Custom middleware
βββ models/ # Mongoose schemas
βββ routes/ # API route definitions
βββ uploads/ # Temporary file storage
βββ utils/ # Helper functions
The backend follows a RESTful API design with the following main endpoints:
/api/v1/user: User authentication and profile management/api/v1/course: Course CRUD operations and search/api/v1/media: Media upload to Cloudinary/api/v1/purchase: Payment processing and webhooks/api/v1/progress: Course progress tracking
- Node.js (v16 or higher)
- MongoDB (local or cloud instance)
- Stripe Account for payment processing
- Cloudinary Account for media storage
- npm or yarn package manager
-
Clone the repository
git clone https://github.com/adityashriwas/e-learning.git cd LMS-main -
Install Server Dependencies
cd server npm install -
Install Client Dependencies
cd ../client npm install
-
Start the Backend Server
cd server npm run devThe server will start on
http://localhost:8080 -
Start the Frontend Application (in a new terminal)
cd client npm run devThe client will start on
http://localhost:5173
# Build the client
cd client
npm run build
# Start the server (serves both API and static files)
cd ../server
npm startCreate a .env file in the server directory:
# Server Configuration
PORT=8080
NODE_ENV=development
# Database
MONGO_URI=your_mongodb_connection_string
# JWT Secret
JWT_SECRET=your_jwt_secret_key
# Cloudinary Configuration
CLOUDINARY_CLOUD_NAME=your_cloud_name
CLOUDINARY_API_KEY=your_api_key
CLOUDINARY_API_SECRET=your_api_secret
# Stripe Configuration
STRIPE_SECRET_KEY=your_stripe_secret_key
STRIPE_WEBHOOK_SECRET=your_webhook_secret
# Frontend URL (for CORS)
FRONTEND_URL=http://localhost:5173Create a .env file in the client directory:
VITE_API_URL=http://localhost:8080To test payment webhooks locally, use the Stripe CLI:
# Install Stripe CLI
# https://stripe.com/docs/stripe-cli
# Login to Stripe
stripe login
# Forward webhook events to your local server
stripe listen --forward-to localhost:8080/api/v1/purchase/webhook| Method | Endpoint | Description |
|---|---|---|
| POST | /api/v1/user/register |
Register a new user |
| POST | /api/v1/user/login |
User login |
| GET | /api/v1/user/logout |
User logout |
| GET | /api/v1/user/profile |
Get user profile |
| PUT | /api/v1/user/profile/update |
Update user profile |
| Method | Endpoint | Description |
|---|---|---|
| POST | /api/v1/course |
Create a new course |
| GET | /api/v1/course |
Get all published courses |
| GET | /api/v1/course/search |
Search courses with filters |
| GET | /api/v1/course/:id |
Get course by ID |
| PUT | /api/v1/course/:id |
Update course |
| DELETE | /api/v1/course/:id |
Delete course |
| PATCH | /api/v1/course/:id/publish |
Toggle course publish status |
| Method | Endpoint | Description |
|---|---|---|
| POST | /api/v1/course/:id/lecture |
Create lecture |
| GET | /api/v1/course/:id/lecture |
Get all lectures |
| PUT | /api/v1/course/:courseId/lecture/:lectureId |
Update lecture |
| DELETE | /api/v1/course/:courseId/lecture/:lectureId |
Delete lecture |
| Method | Endpoint | Description |
|---|---|---|
| POST | /api/v1/purchase/checkout/create-checkout-session |
Create Stripe checkout |
| POST | /api/v1/purchase/webhook |
Stripe webhook handler |
| GET | /api/v1/purchase/course/:id/detail-with-status |
Get course with purchase status |
| GET | /api/v1/purchase |
Get all purchased courses |
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/v1/progress/:courseId |
Get course progress |
| POST | /api/v1/progress/:courseId/lecture/:lectureId |
Update lecture progress |
| POST | /api/v1/progress/:courseId/complete |
Mark course as complete |
| POST | /api/v1/progress/:courseId/incomplete |
Mark course as incomplete |
- Push your code to GitHub
- Connect your repository to Vercel
- Configure environment variables in Vercel dashboard
- Deploy
- Create a new web service
- Connect your GitHub repository
- Set environment variables
- Configure build and start commands:
- Build:
npm install - Start:
npm start
- Build:
We welcome contributions to improve this LMS platform! Here's how you can help:
- Fork the repository
- Create a 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
- Follow the existing code style and structure
- Write meaningful commit messages
- Test your changes thoroughly before submitting
- Update documentation as needed
- For major changes, open an issue first to discuss your proposal
Aditya Shriwas
- GitHub: @adityashriwas
- Live Demo: E-Learning Platform