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.