Working on 26 API endpoints along with a database that stores information about courses offered in various countries and regions. Basic API endpoints in this project include authentication (Registration and User login), Image upload, and query based endpoints. Other endpoints are different from the basic ones
Run this code locally on port 5000 to test the following api endpoints: http://localhost:5000
Authentication:
- Register a User (/api/v1/auth/register)
- Login a User (/api/v1/auth/login)
- Get Logged User using cookies and token (/api/v1/auth/me)
- Forgot Password (/api/v1/auth/forgotpassword) (Using node-mailer)
- Reset Password (/api/v1/auth/resetpassword/:id) (Reset password by user) (id = reset password token from the email)
- Update user details (/api/v1/auth/updatedetails) (Admin access)
- Update Password (/api/v1/auth/updatepassword)
- Logout User (/api/v1/auth/logout)
Bootcamps:
- Get all bootcamps (/api/v1/bootcamps) (Also includes queries, pagination, sorting and filtering)
- Get single bootcamp by ID (/api/v1/bootcamps/:id)
- Create a new bootcamp (/api/v1/bootcamps) (Only users with access to create a bootcamp will be able to access this route)
- Update Bootcamp (/api/v1/bootcamps/:id) (Update bootcamp by ID)
- Delete Bootcamp (/api/v1/bootcamps/:id) (Delete bootcamps by ID)
- Get Bootcamps by Distance (/api/v1/bootcamps/radius/:zipcode/:radius) (Filter bootcamps based on zipcode and radius) (Using GeoJSON points, mapquest)
- Upload photo for bootcamps (/api/v1/bootcamps/:id) (Upload photo to a particular bootcamp based on bootcamp ID)
Course:
- Get all courses (/api/v1/courses) (Also includes queries, pagination, sorting and filtering)
- Get courses for a particular bootcamp (/api/v1/bootcamps/:bootcampId)
- Get a single course based on ID (/api/v1/courses/:id)
- Create course (/api/v1/bootcamps/:id/courses) (Create courses under a bootcamp. Courses can only be created if a related bootcamp exists)
- Update course (/api/v1/course/:id) (Update courses by course ID. Route only available to the user who created the course. Role: Publisher)
- Delete course (/api/v1/course/:id) (Delete course by course ID. Route available to both admin and user with role: Publisher)
Admin Controls (Routes available for access only to the admin):
- Get all users (/api/v1/users)
- Get single user (/api/v1/users/:id) (Get users based on user id)
- Create User (/api/v1/users)
- Update User (/api/v1/users/:id)
- Delete User (/api/v1/users/:id) (Delete user by ID)