The backend server for Learnova, built with Node.js and Express.js, providing RESTful APIs, secure authentication, database management, and AI integration powered by Gemini.
- 🔐 Secure Authentication: JWT-based authentication with bcryptjs password hashing and HTTP-only cookies
- 🧠 AI Integration: Gemini API integration for intelligent chat responses and personalized learning recommendations
- 💾 Database Management: MongoDB with Mongoose ODM for efficient data storage and retrieval
- ☁️ Cloud Storage: Cloudinary integration for seamless image and file uploads
- 🍪 Session Management: Secure cookie-based session handling
- 🛡️ API Security: CORS configuration, input validation, and request sanitization
- 📡 RESTful Architecture: Clean, modular API design following REST principles
- 👥 User Management: Complete user profile and account management system
- 📚 Course System: Full CRUD operations for course management
- 🎯 Role-Based Access: Admin and user role permissions
- 📊 Progress Tracking: Student enrollment and learning progress monitoring
- 🔄 Real-time Updates: Efficient data synchronization between frontend and database
- Runtime: Node.js
- Framework: Express.js
- Database: MongoDB (Mongoose ODM)
- Authentication: JWT, bcryptjs, cookie-parser
- AI Engine: Gemini API (
@google/genai) - File Upload: Multer middleware
- Cloud Storage: Cloudinary SDK
- Date Utilities: Moment.js
- Environment Management: dotenv
- Security: Helmet, CORS
- User Registration: Create new user accounts with email verification
- User Login: Secure login with JWT token generation
- User Logout: Session termination and token invalidation
- Token Verification: Validate and refresh authentication tokens
- Password Reset: Secure password recovery flow
- Profile Retrieval: Fetch user profile information
- Profile Update: Modify user details and preferences
- Avatar Upload: Profile picture management
- Enrollment History: Track user's enrolled courses
- Learning Progress: Monitor and update course completion status
- Course Listing: Retrieve all available courses with pagination
- Course Details: Get comprehensive course information
- Course Creation: Admin-only course publishing
- Course Updates: Modify existing course content
- Course Deletion: Remove courses from platform
- Course Search: Filter and search courses by various criteria
- Enrollment Management: Handle student course enrollments
- AI Chat: Interactive conversations for learning assistance
- Smart Recommendations: Personalized course suggestions based on user history
- Content Analysis: AI-driven content understanding and explanation
- Learning Path Generation: Custom learning roadmaps
- Image Upload: Course thumbnails and user avatars
- Document Handling: Support for various file formats
- Cloud Storage Management: Efficient media storage and retrieval
Comprehensive user data including authentication credentials, profile information, role permissions, enrolled courses, learning progress, and account metadata.
Complete course information with title, description, instructor details, media assets, pricing, difficulty level, curriculum structure, and engagement metrics.
Tracks student-course relationships, progress tracking, completion status, and enrollment timestamps.
Detailed learning analytics including completed lessons, quiz scores, time spent, and achievement tracking.
- Password Encryption: Bcrypt hashing for secure password storage
- JWT Authentication: Stateless authentication with secure token generation
- HTTP-Only Cookies: Protected cookie storage preventing XSS attacks
- CORS Protection: Configured cross-origin resource sharing
- Input Validation: Comprehensive request data validation
- Rate Limiting: API request throttling to prevent abuse
- SQL Injection Prevention: Mongoose schema validation
- Environment Security: Sensitive data stored in environment variables
- Context-Aware Responses: AI maintains conversation context for relevant answers
- Educational Focus: Optimized prompts for learning assistance
- Multi-turn Conversations: Support for extended learning dialogues
- Smart Recommendations: Course suggestions based on user interests and history
- Content Generation: AI-assisted course descriptions and summaries
- Real-time chat responses for student queries
- Personalized learning path suggestions
- Difficulty assessment for course placement
- Automated content tagging and categorization
- Smart search enhancement
JWT tokens generated on login, stored in HTTP-only cookies, validated on each protected route request, and automatically refreshed for active sessions.
Admins create and publish courses, users browse and enroll, progress is tracked automatically, and AI provides personalized recommendations.
Images uploaded through Multer, processed and optimized, stored on Cloudinary, and URLs saved in MongoDB for efficient retrieval.
Centralized error middleware, custom error classes, appropriate HTTP status codes, and detailed error logging for debugging.
Developed by CyberNerd
"Where learning meets intelligence."
Licensed under the MIT License.