A comprehensive full-stack e-learning platform with built-in gamification features to boost student engagement and motivation.
- Student Registration & Login: Secure authentication with JWT
- View Courses: Browse all available courses
- Watch Lessons: Access video and text-based lessons
- Attempt Quizzes: Take quizzes and get instant feedback
- Earn Points & Badges: Gain rewards for completing activities
- View Profile: Manage personal information and achievements
- Course List: Browse all available courses by category and level
- Video/Text Lessons: Rich multimedia learning content
- Progress Tracking: Monitor your learning journey
- Resource Management: Access supplementary materials
- Points System: Earn points for quiz completion
- Badges: Collect achievements based on milestones
- Levels: Progress through levels based on total points
- Leaderboard: Compete with other learners globally
- Add Courses & Lessons: Create comprehensive course content
- Add Quizzes: Design assessments for lessons
- Manage Badges: Create achievement milestones
- View Student Performance: Track individual and class progress
- Dashboard Statistics: Overview of platform metrics
- Runtime: Node.js
- Framework: Express.js
- Database: MongoDB
- Authentication: JWT
- Password Hashing: bcryptjs
- Library: React 18
- Routing: React Router v6
- HTTP Client: Axios
- Icons: React Icons
- Styling: CSS3
e-learn/
โโโ backend/
โ โโโ models/
โ โ โโโ User.js
โ โ โโโ Course.js
โ โ โโโ Lesson.js
โ โ โโโ Quiz.js
โ โ โโโ QuizAttempt.js
โ โ โโโ Badge.js
โ โ โโโ Progress.js
โ โโโ controllers/
โ โ โโโ authController.js
โ โ โโโ userController.js
โ โ โโโ courseController.js
โ โ โโโ gamificationController.js
โ โ โโโ adminController.js
โ โโโ routes/
โ โ โโโ auth.js
โ โ โโโ users.js
โ โ โโโ courses.js
โ โ โโโ quizzes.js
โ โ โโโ gamification.js
โ โ โโโ admin.js
โ โโโ middleware/
โ โ โโโ auth.js
โ โโโ server.js
โ โโโ package.json
โ โโโ .env.example
โโโ frontend/
โโโ src/
โ โโโ pages/
โ โ โโโ Login.js
โ โ โโโ Register.js
โ โ โโโ Dashboard.js
โ โ โโโ Courses.js
โ โ โโโ CourseDetail.js
โ โ โโโ Quiz.js
โ โ โโโ Profile.js
โ โ โโโ Leaderboard.js
โ โ โโโ AdminDashboard.js
โ โโโ components/
โ โ โโโ Navbar.js
โ โโโ services/
โ โโโ App.js
โ โโโ App.css
โ โโโ index.js
โ โโโ index.css
โโโ public/
โ โโโ index.html
โโโ package.json
- Node.js (v14 or higher)
- MongoDB (local or cloud instance)
- npm or yarn
-
Navigate to backend directory
cd backend -
Install dependencies
npm install
-
Create .env file
cp .env.example .env
-
Update .env with your configuration
PORT=5000 MONGODB_URI=mongodb://localhost:27017/elearn JWT_SECRET=your_secret_key_here NODE_ENV=development FRONTEND_URL=http://localhost:3000 -
Start MongoDB (if local)
mongod
-
Run backend server
npm start # production npm run dev # development with auto-reload
-
Navigate to frontend directory
cd frontend -
Install dependencies
npm install
-
Start development server
npm start
-
Build for production
npm run build
The app will open at http://localhost:3000
POST /api/auth/register- Register new userPOST /api/auth/login- Login user
GET /api/users/profile- Get user profilePUT /api/users/profile- Update profilePOST /api/users/enroll- Enroll in courseGET /api/users/courses- Get enrolled courses
GET /api/courses- Get all coursesGET /api/courses/:id- Get course detailsGET /api/courses/:courseId/progress- Get course progressPOST /api/courses/mark-complete- Mark lesson complete
POST /api/gamification/submit-quiz- Submit quiz answersGET /api/gamification/attempts/:quizId- Get quiz attemptsGET /api/gamification/leaderboard- Get leaderboardGET /api/gamification/rank- Get user rank
POST /api/admin/course- Create coursePOST /api/admin/lesson- Create lessonPOST /api/admin/quiz- Create quizPOST /api/admin/badge- Create badgeGET /api/admin/students- Get all studentsGET /api/admin/students/:studentId/performance- Get student performanceGET /api/admin/dashboard/stats- Get dashboard statistics
Students earn points when they:
- Complete quizzes successfully
- Points are calculated based on quiz difficulty
- Points contribute to level progression
Badges are awarded for:
- Reaching certain point milestones (100, 500, 1000, etc.)
- Completing specific number of quizzes
- Custom achievements set by admin
- Level 1: Starting level
- Each 100 points = 1 level increase
- Levels displayed on leaderboard
- Shows top 100 students globally
- Ranked by total points
- Displays user level and badges
- Shows user's current rank
- JWT Authentication: Secure token-based authentication
- Password Hashing: Passwords hashed with bcryptjs
- Authorization Middleware: Role-based access control
- CORS Enabled: Cross-origin requests handled safely
- Environment Variables: Sensitive data in .env files
name: Stringemail: String (unique)password: String (hashed)role: String ('student' or 'admin')points: Numberlevel: Numberbadges: Array of Badge IDsenrolledCourses: Array of Course IDs
title: Stringdescription: Stringcategory: Stringlevel: Stringinstructor: ObjectId (User)lessons: Array of Lesson IDsstudentCount: Number
title: Stringcourse: ObjectIdcontent: StringcontentType: StringvideoUrl: String (optional)quiz: ObjectId (optional)
lesson: ObjectIdquestions: Array of questionspassingScore: NumbertotalPoints: Number
student: ObjectIdquiz: ObjectIdanswers: Array of answersscore: Numberpercentage: NumberpointsEarned: Number
Contributions are welcome! Please follow these steps:
- Fork the repository
- Create a feature branch (
git checkout -b feature/AmazingFeature) - Commit changes (
git commit -m 'Add AmazingFeature') - Push to branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
For support, email support@elearn.com or open an issue in the repository.
- Real-time notifications
- Video streaming optimization
- Social features (comments, discussions)
- Mobile app
- Advanced analytics
- Payment integration
- Certification system
- AI-powered recommendations
Made with โค๏ธ for educators and learners