This project is built using Node.js, Express.js, Mongoose, bcryptjs, and jsonwebtoken to create a comprehensive e-learning platform with multiple user roles and functionalities.
-
Authentication and Authorization:
- User authentication using bcryptjs for password hashing and jsonwebtoken for JWT-based authentication.
- Three user roles: Student, Instructor, and Admin.
- Only authenticated users (Student, Instructors and Admin) can access specific functionalities.
-
Student:
- View available courses.
- Enroll and unenroll in courses.
- Provide reviews and ratings for enrolled courses.
-
Instructor:
- Add new courses.
- Delete and update existing courses.
-
Admin:
- Manage users, instructors, and courses.
- Delete users, instructors, and courses.
-
Clone the repository:
git clone https://github.com/Jobayer98/e-learning.git cd e-learning
-
Install dependencies:
npm install
-
Set up environment variables:
- Create a .env file based on the provided .env.example file.
- Configure your MongoDB connection and JWT secret.
-
Start the server:
npm start
- /api/v1/courses: Show all course without authentication.
- /api/v1/auth: Authentication and user registration (/signup, /signin, /logout).
- /api/v1/my-learning: Student enrolled courses (Student only).
- /api/v1/my-courses: CRUD operations for courses (Instructor only).
- /api/v1/users: Manage users (Admin only).
- Node.js
- Express.js
- MongoDB with Mongoose
- bcryptjs for password hashing
- jsonwebtoken for JWT-based authentication
Here's a high-level overview of the project structure:
e-learning-platform/
├── controllers/ # Controller logic for different functionalities
├── models/ # Mongoose models for data storage
├── routes/ # Express routes and API endpoints
├── middleware/ # Middleware functions for authentication and authorization
├── utils/ # Utility functions
├── config/ # Configuration files and database
├── app.js # Main application setup
└── index.js # Entry point to start the server
If you encounter any issues or have questions, please feel free to open an issue in this repository. I'm here to help!
This project was created by Jobayer Rahman.
Connect with me on:
- GitHub: @Jobayer98
- LinkedIn: Jobayer Rahman