This project is a production-oriented Learning Management System (LMS) designed to closely resemble real-world edtech platforms. It focuses on scalability, security, and maintainable architecture, with a professional UI/UX that rivals commercial LMS solutions.
The system supports role-based users, secure payments, AI-powered learning tools, and comprehensive analytics, making it suitable for startup-grade applications and paid full-stack internships.
This project was built with a backend-first, production mindset, prioritizing correctness, security, extensibility, and professional design.
- JWT-based authentication with httpOnly cookies
- Role-based access control (Admin/User)
- Secure password hashing with bcrypt
- Protected routes and API endpoints
- Session management
- Automatic token refresh
- Admin Features:
- Create, read, update, and delete courses
- Hide/unhide courses for visibility control
- Edit course details and pricing
- Bulk course management dashboard
- User Features:
- Browse all available courses
- AI-powered intelligent course search
- Course detail pages with purchase options
- Quick access to purchased courses from header
- Module and video content management
- Course enrollment tracking
- Quick Access: View count badge in header
- Dropdown Menu: Click to see all purchased courses
- Easy Navigation: Direct links to learning pages
- Course Preview: Thumbnail and price display in dropdown
- Stripe Checkout integration
- Secure payment processing
- Order and enrollment management
- Purchase success handling
- Payment verification
- Google Gemini AI integration
- Intelligent course search with natural language processing
- Automatic quiz generation from course content
- 10 MCQ questions with explanations per quiz
- Total users, courses, and enrollments
- Revenue tracking and reporting
- Daily analytics with date range filtering
- Visual data representation
- Course management interface
- Video player for course modules
- Comments system for each module
- AI-generated quizzes with instant feedback
- Progress tracking
- Responsive learning interface
- Profile photo upload (Cloudinary)
- Name and information updates
- Profile management
- Professional profile interface
- Modern, responsive design with premium aesthetics
- Dark/Light theme toggle with smooth transitions
- Intuitive navigation
- Loading states and error handling
- Mobile-first design approach
- Gradient backgrounds and card-based layouts
- Smooth animations and transitions
- Professional typography and color schemes
- React 19 - Modern UI library
- Vite - Fast build tool and dev server
- Tailwind CSS 3 - Utility-first CSS framework
- React Router DOM - Client-side routing
- Axios - HTTP client for API calls
- Lucide React - Professional icon library
- Context API - State management (no Redux needed)
- Node.js - JavaScript runtime
- Express.js 5 - Web framework
- MongoDB - NoSQL database
- Mongoose - MongoDB object modeling
- JWT - Authentication tokens
- bcrypt - Password hashing
- Stripe - Payment processing
- Cloudinary - Media storage
- Google Gemini AI - AI capabilities
- ESLint - Code linting
- Nodemon - Auto-restart server
- dotenv - Environment variables
LMS platform project/
βββ server/ # Backend API
β βββ index.js # Server entry point
β βββ package.json # Backend dependencies
β βββ README.md # Backend documentation
β βββ src/
β βββ config/ # Configuration files
β β βββ db.js # MongoDB connection
β β βββ env.js # Environment variables
β β βββ cloudinary.js # Cloudinary setup
β β βββ stripe.js # Stripe configuration
β βββ controllers/ # Business logic
β β βββ user.controller.js
β β βββ course.controller.js (NEW: edit, delete, hide)
β β βββ module.controller.js
β β βββ quiz.controller.js
β β βββ comment.controller.js
β β βββ payment.controller.js
β β βββ analytic.controller.js
β βββ middleware/ # Custom middleware
β β βββ auth.middleware.js # Authentication & authorization
β β βββ upload.js # Image upload handler
β β βββ video.upload.js # Video upload handler
β βββ models/ # Database schemas
β β βββ user.model.js
β β βββ course.model.js (NEW: isHidden field)
β β βββ modules.model.js
β β βββ enrollment.model.js
β β βββ order.model.js
β β βββ quiz.model.js
β β βββ questions.model.js
β β βββ comment.model.js
β βββ routes/ # API routes
β βββ user.route.js
β βββ course.route.js (NEW: edit, delete, hide endpoints)
β βββ module.route.js
β βββ quiz.route.js
β βββ comment.route.js
β βββ payment.route.js
β βββ analytic.route.js
β
βββ client/ # Frontend Application
βββ package.json # Frontend dependencies
βββ README.md # Frontend documentation
βββ FRONTEND_EXPLAINED.md # Beginner's guide
βββ BACKEND_INTEGRATION_CHECKLIST.md
βββ vite.config.js # Vite configuration
βββ tailwind.config.js # Tailwind configuration
βββ src/
βββ main.jsx # React entry point
βββ App.jsx # Main app component
βββ index.css # Global styles (ENHANCED)
βββ lib/ # Utilities
β βββ api.js # Axios configuration
β βββ auth.jsx # Authentication context
β βββ theme.jsx # Theme context
β βββ utils.js # Helper functions
βββ components/ # Reusable components
β βββ ui/ # Basic UI components
β β βββ button.jsx
β β βββ input.jsx
β β βββ card.jsx
β β βββ textarea.jsx
β βββ layout/ # Layout components
β β βββ Header.jsx (NEW: purchased courses dropdown)
β β βββ Footer.jsx
β β βββ Layout.jsx
β βββ ProtectedRoute.jsx # Route protection
βββ pages/ # Page components
βββ LoginPage.jsx (ENHANCED UI)
βββ RegisterPage.jsx (ENHANCED UI)
βββ DashboardPage.jsx (ENHANCED UI)
βββ CourseDetailPage.jsx (ENHANCED UI)
βββ CourseLearnPage.jsx (ENHANCED UI)
βββ QuizPage.jsx (ENHANCED UI)
βββ ProfilePage.jsx (ENHANCED UI)
βββ AdminDashboardPage.jsx (NEW: course management section)
βββ PurchaseSuccessPage.jsx (ENHANCED UI)
- Node.js (v18 or higher)
- MongoDB (v6 or higher) or MongoDB Atlas account
- npm or yarn
- Cloudinary account (for media storage)
- Stripe account (for payments)
- Google AI Studio account (for Gemini API)
-
Clone the repository
git clone <repository-url> cd "LMS platform project"
-
Backend Setup
cd server npm installCreate
server/.envfile:PORT=5000 NODE_ENV=development MONGO_URI=mongodb://localhost:27017/lms-platform JWT_SECRET=your-super-secret-jwt-key-min-32-characters ADMIN=admin@example.com CLIENT_URL=http://localhost:5173 CLOUD_NAME=your-cloudinary-cloud-name CLOUD_API_KEY=your-cloudinary-api-key CLOUD_API_SECRET=your-cloudinary-api-secret STRIPE_PUBLISHABLE_KEY=pk_test_your-stripe-publishable-key STRIPE_SECRET_KEY=sk_test_your-stripe-secret-key GEMINI_API_KEY=your-google-gemini-api-key
-
Frontend Setup
cd ../client npm installCreate
client/.envfile:VITE_API_URL=http://localhost:5000 VITE_ADMIN_EMAIL=admin@example.com
-
Start Development Servers
Terminal 1 (Backend):
cd server npm run devTerminal 2 (Frontend):
cd client npm run dev -
Access the Application
- Frontend: http://localhost:5173
- Backend API: http://localhost:5000
| Variable | Description | Required | Example |
|---|---|---|---|
PORT |
Server port | Yes | 5000 |
MONGO_URI |
MongoDB connection string | Yes | mongodb://localhost:27017/lms |
JWT_SECRET |
Secret for JWT tokens | Yes | your-secret-key-32-chars |
ADMIN |
Admin email address | Yes | admin@example.com |
CLIENT_URL |
Frontend URL | Yes | http://localhost:5173 |
CLOUD_NAME |
Cloudinary cloud name | Yes | your-cloud-name |
CLOUD_API_KEY |
Cloudinary API key | Yes | 123456789012345 |
CLOUD_API_SECRET |
Cloudinary API secret | Yes | your-api-secret |
STRIPE_PUBLISHABLE_KEY |
Stripe publishable key | Yes | pk_test_... |
STRIPE_SECRET_KEY |
Stripe secret key | Yes | sk_test_... |
GEMINI_API_KEY |
Google Gemini API key | Yes | your-gemini-key |
NODE_ENV |
Environment mode | No | development |
| Variable | Description | Required | Example |
|---|---|---|---|
VITE_API_URL |
Backend API URL | Yes | http://localhost:5000 |
VITE_ADMIN_EMAIL |
Admin email | Yes | admin@example.com |
Note: All frontend env vars must start with VITE_
| Method | Endpoint | Description | Auth Required |
|---|---|---|---|
| POST | /api/register |
Register new user | No |
| POST | /api/login |
Login user | No |
| GET | /api/getUser |
Get current user | Yes |
| POST | /api/logout |
Logout user | Yes |
| POST | /api/updateProfile |
Update profile | Yes |
| Method | Endpoint | Description | Auth | Admin |
|---|---|---|---|---|
| POST | /api/createCourse |
Create course | Yes | Yes |
| GET | /api/getCourse |
Get all visible courses | Yes | No |
| GET | /api/getSingleCourse/:id |
Get course details | Yes | No |
| GET | /api/purchasedCourse/:id |
Get purchased course | Yes | No |
| GET | /api/getAllCoursePurchase |
Get all purchased | Yes | No |
| PUT | /api/editCourse/:id |
Edit course (NEW) | Yes | Yes |
| DELETE | /api/deleteCourse/:id |
Delete course (NEW) | Yes | Yes |
| PATCH | /api/hideCourse/:id |
Hide/unhide course (NEW) | Yes | Yes |
| Method | Endpoint | Description | Auth | Admin |
|---|---|---|---|---|
| POST | /api/createModule |
Create module | Yes | Yes |
| GET | /api/getModule/:id |
Get module | Yes | No |
| GET | /api/comment/:id |
Get comments | Yes | No |
| Method | Endpoint | Description | Auth |
|---|---|---|---|
| GET | /api/quiz/checkQuiz/:id |
Check quiz exists | Yes |
| POST | /api/quiz/generateQuiz |
Generate quiz | Yes |
| GET | /api/quiz/getQuiz/:id |
Get quiz | Yes |
| Method | Endpoint | Description | Auth |
|---|---|---|---|
| POST | /api/comment/createComment/:id |
Add comment | Yes |
| Method | Endpoint | Description | Auth |
|---|---|---|---|
| POST | /api/payment/checkout |
Create checkout | Yes |
| POST | /api/payment/checkout-success |
Verify payment | Yes |
| Method | Endpoint | Description | Auth | Admin |
|---|---|---|---|---|
| GET | /api/analytic/getAnalytic |
Get analytics | Yes | Yes |
| GET | /api/analytic/getDailyData |
Get daily data | Yes | Yes |