StudyNotion is a fully functional edtech platform built using the MERN stack (MongoDB, Express.js, React, Node.js). It enables users to create, consume, and rate educational content, providing an immersive learning experience for students and allowing instructors to showcase their expertise.
- Features
- Technologies Used
- Installation
- Environment Variables
- API Endpoints
- Models
- Frontend Features
- Backend Features
- Frontend
- Deployment
- Contributing
- License
- User authentication with OTP-based signup and login.
- User profiles with the ability to manage additional details.
- Course creation and management for instructors.
- Enrolled courses and progress tracking for students.
- Rating and reviewing system for courses.
- Contact form for inquiries and feedback.
- Admin functionalities for managing users and courses.
- Payment integration for course purchases.
- Frontend: React, Tailwind CSS
- Backend: Node.js, Express.js
- Database: MongoDB, Mongoose
- Cloud Storage: Cloudinary (for media management)
- Payment Gateway: Razorpay
- Email Service: Nodemailer (for sending emails)
- Twilio: For sending SMS notifications (if applicable)
-
Clone the repository:
git clone https://github.com/yourusername/studynotion.git cd studynotion -
Install backend dependencies:
cd backend npm install -
Install frontend dependencies:
cd frontend npm install -
Start the backend server:
cd backend npm run start -
Start the frontend development server:
cd frontend npm start
Create a .env file in the root of the backend directory and add the following variables:
MONGODB_URL=<your_mongodb_connection_string>
CLOUD_NAME=<your_cloudinary_cloud_name>
API_KEY=<your_cloudinary_api_key>
API_SECRET=<your_cloudinary_api_secret>
RAZORPAY_KEY=<your_razorpay_key>
RAZORPAY_SECRET=<your_razorpay_secret>Also, create a .env file in the frontend directory:
REACT_APP_BASE_URL=http://localhost:4000/api/v1POST /auth/sendotp- Send OTP for authentication.POST /auth/signup- User signup.POST /auth/login- User login.POST /auth/reset-password-token- Generate reset password token.POST /auth/reset-password- Reset user password.
GET /profile/getUserDetails- Get user profile details.GET /profile/getEnrolledCourses- Get enrolled courses for the user.GET /profile/userProfile- Get instructor profile.GET /profile/allUserData- Get all users' data (Admin).DELETE /profile/deleteAccountByAdmin- Delete a user account by admin.GET /profile/instructorDashboard- Get instructor dashboard data.
POST /payment/capturePayment- Capture payment for a course.POST /payment/verifyPayment- Verify course payment.POST /payment/sendPaymentSuccessEmail- Send payment success email.
GET /course/getAllCourses- Get all courses.GET /course/getCourseDetails- Get specific course details.PATCH /course/editCourse- Edit course information.GET /course/showAllCategories- Show all course categories.POST /course/createCourse- Create a new course.POST /course/addSection- Add a section to the course.POST /course/addSubSection- Add a subsection to a section.PATCH /course/updateSection- Update section details.PATCH /course/updateSubSection- Update subsection details.GET /course/getInstructorCourses- Get all courses by the instructor.DELETE /course/deleteSection- Delete a section from the course.DELETE /course/deleteSubSection- Delete a subsection from the course.DELETE /course/deleteCourse- Delete a course.GET /course/getFullCourseDetails- Get full details of a course (authenticated).POST /course/updateCourseProgress- Update course progress (mark lecture completion).POST /course/createRating- Create a rating for a course.
GET /course/getReviews- Get reviews for a course.
GET /course/showAllCategories- Get all course categories.POST /course/createCategory- Create a new course category.DELETE /course/deleteCategory- Delete a course category.PATCH /course/updateCategory- Update course category details.
GET /course/getCategoryPageDetails- Get catalog page data for specific categories.
POST /auth/contact-us- Send a message through the contact us form.
PATCH /profile/updateDisplayPicture- Update the user's display picture.PATCH /profile/updateProfile- Update profile details.POST /auth/changepassword- Change the user's password.DELETE /profile/deleteProfile- Delete the user's profile.POST /profile/createSocial- Add social media links to the profile.PATCH /profile/updateSocial- Update social media links.DELETE /profile/deleteSocial- Delete social media links.
GET /search/getAllCourses- Get predefined search results for courses.GET /search/dropdown- Get search suggestions based on a query.GET /search- Perform a full search for courses.
- id: Unique identifier for the user.
- firstName: First name of the user.
- lastName: Last name of the user.
- email: User email (used for login).
- password: Hashed password.
- accountType: Role of the user (Admin, Student, Instructor).
- active: Boolean indicating if the user is active.
- approved: Boolean indicating if the user is approved.
- additionalDetails: ID linking to the user's profile.
- courses: List of course IDs the user is enrolled in.
- image: Profile picture URL.
- token: Token for session management.
- resetPasswordExpires: Date indicating when the reset token expires.
- courseProgress: List of course progress IDs.
- id: Unique identifier for the course.
- courseName: Title of the course.
- courseDescription: Brief description of the course content.
- instructor: ID of the instructor who created the course.
- whatYouWillLearn: Information on what students will learn.
- courseContent: List of section IDs.
- ratingAndReviews: List of rating and review IDs.
- price: Cost of the course.
- thumbnail: URL of the course thumbnail.
- category: ID of the category the course belongs to.
- tag: List of tags associated with the course.
- studentsEnrolled: List of enrolled student IDs.
- instructions: Additional instructions for the course.
- status: Status of the course (Draft, Published).
- createdAt: Date the course was created.
- language: Language of the course.
- level: Difficulty level of the course.
- id: Unique identifier for the category.
- name: Name of the category.
- description: Description of the category.
- courses: List of course IDs in this category.
- id: Unique identifier for the profile.
- gender: Gender of the user.
- dateOfBirth: Date of birth of the user.
- about: Short bio or description of the user.
- contactNumber: Contact number of the user.
- id: Unique identifier for the contact message.
- firstName: First name of the person contacting.
- lastName: Last name of the person contacting.
- email: Email of the person contacting.
- phoneNumber: Phone number of the person contacting.
- message: Message content from the contact form.
- id: Unique identifier for the rating and review.
- user: ID of the user who submitted the rating/review.
- rating: Numeric rating for the course.
- review: Text review of the course.
- course: ID of the course the review is associated with.
- id: Unique identifier for the OTP.
- email: Email address the OTP is associated with.
- otp: One-time password (OTP).
- createdAt: Date the OTP was created.
- expiresIn: Time until the OTP expires (5 minutes).
- id: Unique identifier for the course progress.
- courseID: ID of the course being tracked.
- userId: ID of the user making progress.
- completedVideos: List of completed subsection IDs.
- id: Unique identifier for the section.
- sectionName: Title of the section.
- subsection: List of subsection IDs.
- id: Unique identifier for the subsection.
- title: Title of the subsection.
- timeDuration: Duration of the video or content.
- description: Description of the subsection content.
- videoUrl: URL of the video for the subsection.
- createdAt: Date the subsection was created.
The frontend of StudyNotion is built with React and Tailwind CSS, offering a seamless user experience. Key features include:
- Signup: Users can create accounts using their email and an OTP verification process.
- Login: Secure login using email and password with a token-based authentication system.
- Forgot Password: Users can initiate a password reset process via email.
- Email Verification: New users receive a verification email containing an OTP for account activation.
- Course Highlights: Displays featured and popular courses with thumbnails and descriptions.
- Category Section: Showcases various categories of courses, allowing users to filter courses by interests.
- Search Bar: A search feature to quickly find courses by title or keyword.
- Course Cards: Each course is presented as a card with essential details like title, instructor, rating, and price.
- Filters: Users can filter courses based on categories, ratings, price ranges, and course levels.
- Sorting: Options to sort courses by newest, most popular, or highest-rated.
- Course Overview: Detailed information about the course, including descriptions, syllabus, prerequisites, and instructor information.
- Enroll Button: Students can enroll in the course directly from this page.
- Rating and Review Section: Users can read reviews and submit their own ratings and feedback for the course.
- Profile Management: Users can update personal information, change passwords, and manage profile pictures.
- Enrolled Courses: A list of courses the user is currently enrolled in, with progress tracking and quick access to course materials.
- Settings: Users can adjust their account settings, including email preferences and notification settings.
- Course Management: Instructors can create, edit, or delete their courses and manage course content.
- Analytics: View performance metrics, including student enrollments, course ratings, and earnings from courses.
- Student Interaction: Communicate with enrolled students via announcements or messages.
- User Management: Admins can view, edit, or delete user accounts and manage user roles (Admin, Student, Instructor).
- Course Oversight: Admins can review, approve, or reject new courses created by instructors.
- Reporting Tools: Access to various reports on user activity, course performance, and system usage.
- Mobile-Friendly: The frontend is optimized for both desktop and mobile devices, ensuring a great user experience across different screen sizes.
- Interactive Elements: Smooth transitions and animations using GSAP and Tailwind CSS for a modern look and feel.
The backend of StudyNotion is built with Node.js and Express.js, providing a robust API for managing users, courses, and other functionalities. Key features include:
- User Registration: Handles user signup, including email validation and OTP generation.
- User Login: Implements secure authentication with JWT for session management.
- Profile Management: APIs to retrieve, update, and delete user profiles, including personal information and course history.
- Role-Based Access Control: Distinguishes between Admin, Instructor, and Student roles, allowing different levels of access and functionality.
- Course Creation: Instructors can create new courses with details, including title, description, syllabus, and multimedia content.
- CRUD Operations: APIs for creating, reading, updating, and deleting courses and their associated sections and subsections.
- Enrollment Tracking: Keeps track of enrolled students and their progress through the course material.
- Rating System: Allows users to submit ratings and reviews for courses, contributing to overall course feedback.
- Review Moderation: Admins can manage and moderate reviews to ensure quality and relevance.
- Category Creation: Admins can create and manage categories for organizing courses.
- Course Categorization: Each course can be associated with one or more categories for better discoverability.
- Contact Form Handling: Receives user inquiries and feedback, storing them for admin review.
- Payment Processing: Integrates with Razorpay for handling course purchases, including secure payment processing and transaction management.
- Nodemailer Integration: Sends email notifications for various actions, including account verification, password resets, and course enrollment confirmations.
- JWT Authentication: Uses JSON Web Tokens for secure API access and session management.
- Password Hashing: Employs bcrypt for securely hashing user passwords before storing them in the database.
- Rate Limiting: Implements rate limiting to prevent abuse of the API endpoints.
- MongoDB Integration: Uses MongoDB for flexible and scalable data storage, with Mongoose for schema management.
- Data Validation: Ensures data integrity through schema validation in Mongoose.
- Activity Logging: Logs significant actions for auditing and debugging purposes.
- Error Handling: Centralized error handling to manage API errors gracefully and provide meaningful feedback to users.
StudyNotion is deployed with the following configurations:
- Frontend: Hosted on Vercel.
- Backend: Hosted on Render or Railway.
- Media Storage: Managed with Cloudinary.
- Database: Hosted on MongoDB Atlas.
Contributions are welcome! Please follow these steps:
- Fork the repository.
- Create a new branch (
git checkout -b feature/YourFeature). - Commit your changes (
git commit -m 'Add some feature'). - Push to the branch (
git push origin feature/YourFeature). - Open a Pull Request.