Muskansahuincredible / StudyNotion-An-Online-Education-Platform

MIT License
92 stars 144 forks source link

StudyNotion

Online Education Platform for You

Check out at https://studynotion-frontend.vercel.app/


s1

🌟 Stars 🍴 Forks 🐛 Issues 🔔 Open PRs 🔕 Close PRs
Stars Forks Issues Open Pull Requests Close Pull Requests

Featured In

Open Source Programs

Event Logo Event Name Event Description
GSSoC 24 GirlScript Summer of Code 2024 GirlScript Summer of Code is a three-month-long Open Source Program conducted every summer by GirlScript Foundation. It is an initiative to bring more beginners to Open-Source Software Development.

Table of Contents

Project Description

StudyNotion is a fully functional ed-tech platform that enables users to create, consume, and rate educational content. The platform is built using the MERN stack, which includes ReactJS, NodeJS, MongoDB, and ExpressJS. StudyNotion aims to provide:

In summary, StudyNotion is a versatile and intuitive ed-tech platform that is designed to provide an immersive learning experience to students and a platform for instructors to showcase their expertise. In the following sections, we will delve into the technical details of the platform, which will provide a comprehensive understanding of the platform's features and functionalities.

s2


(back to top)

📌 Technology Used

Frontend

HTML CSS JS React.js

Backend

Node.js expressjs MongoDB

(back to top)

System Architecture

The StudyNotion ed-tech platform consists of three main components: the front end, the back end, and the database. The platform follows a client-server architecture, with the front end serving as the client and the back end and database serving as the server.

Front-end

The front end of the platform is built using ReactJS, ReactJS allows for the creation of dynamic and responsive user interfaces, which are critical for providing an engaging learning experience to the students. The front end communicates with the back end using RESTful API calls

Back-end

The back end of the platform is built using NodeJS and ExpressJS,. The back end provides APIs for the front end to consume, which include functionalities such as user authentication, course creation, and course consumption. The back end also handles the logic for processing and storing the course content and user data.

Database

The database for the platform is built using MongoDB, which is a NoSQL database that provides a flexible and scalable data storage solution. MongoDB allows for the storage of unstructured and semi-structured data. The database stores the course content, user data, and other relevant information related to the platform.

Architecture Diagram

Here is a high-level diagram that illustrates the architecture of the StudyNotion ed-tech platform:

Architecture


(back to top)

Front End Technology

The front end of StudyNotion has all the necessary pages that an ed-tech platform should have. Some of these pages are:

For Students:

For Instructors:

To build the front end, we use frameworks and libraries such as ReactJS, We also use CSS and Tailwind, which are styling frameworks that help make the user interface look good and responsive. To manage the state of the application, we use Redux, which is a popular state management library for React.


(back to top)

Back End Technology

Description of the Back-end Architecture: StudyNotion uses a monolithic architecture, with the backend built using Node.js and Express.js, and MongoDB as the primary database.

Features and Functionalities of the Back-end: The back end of StudyNotion provides a range of features and functionalities, including:

  1. User authentication and authorization: Students and instructors can sign up and log in to the platform using their email addresses and password. The platform also supports OTP (One-Time Password) verification and forgot password functionality for added security.
  2. Course management: Instructors can create, read, update, and delete courses, as well as manage course content and media. Students can view and rate courses.
  3. Payment Integration: Students will purchase and enrol on courses by completing the checkout flow that is followed by Razorpay integration for payment handling.
  4. Cloud-based media management: StudyNotion uses Cloudinary, a cloud-based media management service, to store and manage all media content, including images, videos, and documents.
  5. Markdown formatting: Course content in document format is stored in Markdown format, which allows for easier display and rendering on the front end.

Frameworks, Libraries, and Tools used: The back end of StudyNotion uses a range of frameworks, libraries, and tools to ensure its functionality and performance, including:

  1. Node.js: Node.js is used as the primary framework for the back end.
  2. MongoDB: MongoDB is used as the primary database, providing a flexible and scalable data storage solution.
  3. Express.js: Express.js is used as a web application framework, providing a range of features and tools for building web applications.
  4. JWT: JWT (JSON Web Tokens) are used for authentication and authorization, providing a secure and reliable way to manage user credentials.
  5. Bcrypt: Bcrypt is used for password hashing, adding an extra layer of security to user data.
  6. Mongoose: Mongoose is used as an Object Data Modeling (ODM) library, providing a way to interact with MongoDB using JavaScript

Data Models and Database Schema:

The back end of StudyNotion uses a range of data models and database schemas to manage data, including:

  1. Student schema: Includes fields such as name, email, password, and course details for each student.
  2. Instructor schema: Includes fields such as name, email, password, and course details for each instructor.
  3. Course schema: Includes fields such as course name, description, instructor details, and media content.

Overall, the back-end of StudyNotion is designed to provide a robust and scalable solution for an ed-tech platform, with a focus on security, reliability, and ease of use. By using the right frameworks, libraries, and tools, we can ensure that the platform functions smoothly and provides an optimal user experience for all its users.

Database Schema


(back to top)

API Design

The StudyNotion platform's API is designed following the REST architectural style. The API is implemented using Node.js and Express.js. It uses JSON for data exchange and follows standard HTTP request methods such as GET, POST, PUT, and DELETE. Sample list of API endpoints and their functionalities:

  1. /api/auth/signup (POST) - Create a new user (student or instructor) account.
  2. /api/auth/login (POST) – Log in using existing credentials and generate a JWT token.
  3. /api/auth/verify-otp (POST) - Verify the OTP sent to the user's registered email.
  4. /api/auth/forgot-password (POST) - Send an email with a password reset link to the registered email.
  5. /api/courses (GET) - Get a list of all available courses.
  6. /api/courses/:id (GET) - Get details of a specific course by ID.
  7. /api/courses (POST) - Create a new course.
  8. /api/courses/:id (PUT) - Update an existing course by ID.
  9. /api/courses/:id (DELETE) - Delete a course by ID.
  10. /api/courses/:id/rate (POST) - Add a rating (out of 5) to a course. Sample API requests and responses:
  11. GET /api/courses: Get all courses
    • Response: A list of all courses in the database
  12. GET /api/courses/:id: Get a single course by ID
    • Response: The course with the specified ID
  13. POST /api/courses: Create a new course
    • Request: The course details in the request body
    • Response: The newly created course
  14. PUT /api/courses/:id: Update an existing course by ID
    • Request: The updated course details in the request body
    • Response: The updated course
  15. DELETE /api/courses/:id: Delete a course by ID
    • Response: A success message indicating that the course has been deleted.

In conclusion, the REST API design for the StudyNotion ed-tech platform is a crucial part of the project. The API endpoints and their functionalities are designed to ensure seamless communication between the front-end and back-end of the application. By following RESTful principles, the API will be scalable, maintainable, and reliable. The sample API requests and responses provided above illustrate how each endpoint will function and what kind of data it will accept or return. With this API design, StudyNotion will be able to provide a smooth user experience while ensuring security and stability.


(back to top)

How to Contribute?

Installation and Setup Guide

To get started with StudyNotion on your local machine, follow these steps: #### Prerequisites Before you begin, ensure you have the following prerequisites installed: - Node.js (version X.X.X) ⚙️ - MongoDB (version X.X.X) 📦 - Git 📂

(back to top)

#### Installation Steps 1. **Clone the Repository:** ```bash git clone https://github.com/yourusername/StudyNotion-An-Online-Education-Platform.git ``` 2. **Navigate to the Project Directory:** ```bash cd StudyNotion-An-Online-Education-Platform ``` 3. **Install Dependencies:** ```bash npm install ``` 4. **Set Environment Variables:** ```bash cd server ``` Create a `.env` file or rename it to `.env` if exists already in server for the following environment variables: ```bash PORT = 4000 MONGODB_URL = # Nodemailer MAIL_HOST = smtp.gmail.com MAIL_USER = MAIL_PASS = #*Controllers #login JWT_SECRET = #cloudinary CLOUD_NAME = API_KEY = API_SECRET = FOLDER_NAME = "StudyNotion" #*Config #Razorpay RAZORPAY_KEY = RAZORPAY_SECRET = ``` 1] ***Keep the port number as it is.*** 2] ***For MONGODB_URL follow below steps –*** - If you want to connect db locally replace MONGO_URI with `mongodb://localhost:27017/db_name `, Where db_name is the database name, you can give yours. - If you want to connect using MONGO_ATLAS, then do the following steps - Signup or login for Mongo DB atlas via https://account.mongodb.com/account/register?_ga=2.174802465.288724901.1646250007-570639881.1643975138 - Once you login, click on create button ![Picture1](https://github.com/PratikMane0112/StudyNotion-An-Online-Education-Platform/assets/153143167/5f532e9f-7fae-4457-b154-086e301c635f) - Again, click on Create Cluster Button ![Picture2](https://github.com/PratikMane0112/StudyNotion-An-Online-Education-Platform/assets/153143167/9666ff59-cbd3-4767-a39a-3b5ef302c6dc) - Wait for few minutes, and then following dashboard will appear ![Picture3](https://github.com/PratikMane0112/StudyNotion-An-Online-Education-Platform/assets/153143167/e801e934-005f-4595-ac1f-2fb9930e6ff1) - Click on connect and choose your application. ![Picture4](https://github.com/PratikMane0112/StudyNotion-An-Online-Education-Platform/assets/153143167/0c60ab29-4497-4422-af84-45bacfa016a3) - Copy the URL and add your name and password in url, which you have set when creating cluster, and put it .env file. ![Picture5](https://github.com/PratikMane0112/StudyNotion-An-Online-Education-Platform/assets/153143167/8566c9f2-4d07-44e7-91fb-d3608a6cd0b0) 3] ***For NodeMailer follow below steps –*** - By default, Gmail prevents bots from accessing emails hosted on Google servers. Gmail runs several checks to ensure that every email account is accessed by a recognized user at a recognized location. - Google requires your account to have two-factor authentication (2FA) enabled to connect it to Nodemailer. - We’ll also need to set up an app password. To do so, follow these steps: - Make sure you’re logged in to your Gmail account - Under How you sign in to Google, select 2-Step Verification - You’ll be prompted to sign in to your email again - Scroll down to App passwords and click the arrow, > - In the Select app dropdown, select your app or enter a custom name, then do the same for the Select device dropdown - Click Generate, and a modal will pop up with your 16-digit app password.Copy it to somewhere secure Now, Finally put your email in MAIL_USER & app password in MAIL_PASS in .env file. It is necessary, unless you will not receive OTP on your mail. 4] ***For JWT_SECRET follow the below steps –*** - This is typically a secret key used for JWT (JSON Web Token) authentication in your application. - You can generate a random string using a tool like crypto in Node.js. For example: ```bash const crypto = require('crypto'); const jwtSecret = crypto.randomBytes(32).toString('hex'); console.log(jwtSecret); ``` - Copy the generated string and paste it as the value for JWT_SECRET in your .env file. 5] ***For Cloudinary follow the below steps –*** - Sign Up for Cloudinary: Go to the Cloudinary website (https://cloudinary.com) and sign up for an account. You can choose the free plan to get started. - Access Dashboard: After signing up and logging in, you'll be redirected to your Cloudinary dashboard. - Find Your Cloud Name: Your Cloudinary cloud name is displayed on the dashboard. It's usually in the format [your_cloud_name]. Copy this value. - Generate API Key and API Secret: In the Cloudinary dashboard, navigate to the "Account Details" or "Dashboard" section. Here, you'll find your API key and API secret. If you don't see them, you may need to generate them. Look for an option like "API Credentials" or "API Key & Secret". - If you need to generate API key and secret, click on the appropriate button/link and Cloudinary will provide you with the key and secret. - If they are already provided, simply copy them. - Now that you have your Cloudinary “CLOUD_NAME”, “API_KEY”, and “API_SECRET”, you can set them up in your .env file as described earlier. CLOUD_NAME=your_cloud_name API_KEY=your_api_key API_SECRET=your_api_secret 6] ***For Razorpay follow the below steps-*** - Log in to your Dashboard with appropriate credentials. - Select the mode (Test or Live) for which you want to generate the API key. - Select the `test mode` for project. - Test Mode: The test mode is a simulation mode that you can use to test your integration flow. Your customers will not be able to make payments in this mode. - Navigate to Account & Settings → API Keys (under Website and app settings) → Generate Key to generate key for the selected mode. - The “Key Id” and “Key Secret” appear on a pop-up page. you can set them up in your .env file as described earlier. RAZORPAY_KEY = “your_razorpay_key” RAZORPAY_SECRET = “your_razorpay_secret”

(back to top)

Code of Conduct

Please note that this project is released with a [Contributor Code of Conduct](./CODE_OF_CONDUCT.md). By participating in this project you agree to abide by its terms.

This project is part of GirlScript Summer of Code. We enthusiastically invite contributions from the community to help elevate StudyNotion to new heights.

Contributors

Thank you for your invaluable contributions to our project! Your support is immensely appreciated in enhancing StudyNotion. 😊

(back to top)