LearnifyBackend is a comprehensive backend API for an interactive learning platform. The platform provides management of courses, lessons, tests, certificates, and achievements.
- User Authentication - JWT-based registration, login, password reset
- Course Management - Create and manage courses, modules, and lessons
- Progress Tracking - Lesson completion, test submission, progress monitoring
- Certificates - Automatic certificate generation upon course completion
- Achievements System - Gamification with achievements and badges
- Admin Panel - User and content management
- API Documentation - Fully documented API with Swagger UI
- Node.js (v14 or higher)
- MongoDB
- npm or yarn
- Clone the repository:
git clone https://github.com/muzaffarbekmustafayevgit/LearnifyBackend.git
cd LearnifyBackend- Install dependencies:
npm install- Configure environment variables:
Create a
.envfile:
NODE_ENV=development
PORT=5000
MONGODB_URI=mongodb://localhost:27017/learnify
JWT_SECRET=your_super_secret_jwt_key
JWT_EXPIRE=30d
REFRESH_TOKEN_SECRET=your_refresh_token_secret
REFRESH_TOKEN_EXPIRE=90d
EMAIL_SERVICE=gmail
EMAIL_USERNAME=your_email@gmail.com
EMAIL_PASSWORD=your_app_password
CLIENT_URL=http://localhost:3000- Start the server:
# Development mode
npm run dev
# Production mode
npm startPOST /api/auth/register- User registrationPOST /api/auth/activate- Account activationPOST /api/auth/login- User loginPOST /api/auth/refresh-token- Token refreshPOST /api/auth/forgot-password- Password reset requestPOST /api/auth/reset-password- Password resetPOST /api/auth/logout- User logoutGET /api/auth/me- User profile
GET,POST /api/courses- List/create coursesGET /api/courses/my-courses- My enrolled coursesGET,PUT,DELETE /api/courses/:id- Get/update/delete coursePATCH /api/courses/:id/publish- Publish coursePATCH /api/courses/:id/complete- Complete course
POST /api/lessons/:id/complete- Complete lessonGET,PATCH /api/progress/:courseId- Get/update progressPOST /api/progress/:courseId/complete- Complete lesson
POST /api/certificates/:courseId- Generate certificateGET /api/certificates/my- My certificatesGET /api/achievements/my- My achievements
GET,POST /api/users/admin/users- User managementGET,PUT,DELETE /api/users/admin/users/:id- Manage user
- Users - Users (student, teacher, admin)
- Courses - Courses and their modules
- Lessons - Lessons and videos
- Progress - User progress tracking
- Certificates - Certificates
- Achievements - Achievements and badges
- JWT authentication
- Password hashing (bcrypt)
- XSS and SQL injection protection
- Rate limiting
- CORS configuration
- Helmet security headers
After starting the server, access the API documentation at: http://localhost:5000/api-docs
# Development mode (auto-reload)
npm run dev
# Update Swagger documentation
npm run build-swagger- Fork the project
- 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. See the LICENSE file for details.
If you have questions, encounter issues, or have suggestions, please create an issue in the GitHub issues section.
Special thanks to the LearnifyBackend team and all contributors who have helped shape this project.
⭐ If you like this project, please give it a star!
Learnify - Elevating Education to New Heights