Welcome to the backend of the Course Selling Platform!
This repository powers the REST APIs for both the User and Admin sides of the platform.
If you have doubts about anything like JWT or anything ping me anytime !
- JWT tokens are issued on both user and admin login.
- Use
Authorization: Bearer <token>header to access protected routes. - Made a middleware in middlewares/middleware.js, named VerifyToken__ which verifies token according to the user.
POST /user/signupβ Register a new user.Go to user.js in the routes folder.POST /user/loginβ Login user and receive JWTPOST /user/course/purchaseβ Purchase a course. Sending the course info via req.body.GET /user/purchasesβ View all purchased courses
POST /admin/signupβ Register a new adminPOST /admin/loginβ Login admin and receive JWTPOST /admin/create-courseβ Create a coursePUT /admin/update-courseβ Edit a courseGET /admin/created-coursesβ View all courses created by this adminDELETE /admin/delete-course- To delete a course.
GET /coursesβ View all courses on the platform.
| Page Name | Description |
|---|---|
π User Signup |
Has four fields email, password, name, age |
π User Login |
Has two fields email,password |
π Courses |
Display all available courses (GET /courses) |
π My Courses |
Show purchased courses (GET /user/purchases) |
| Page Name | Description |
|---|---|
π Admin Signup |
Has four fields email, password, name, age |
π Admin Login |
Has two fields email,password |
β Create Course |
Form to create course (POST /admin/create-course) |
βοΈ Edit Course |
Form to edit course (PUT /admin/update-course) |
π My Created Courses |
Display list of courses created by admin (GET /admin/created-courses) |
π All these pages must send the
Authorizationheader with the JWT token after login.