Backend API for the DevCamper application to manage bootcamps, courses, reviews, users and authentication
Bootcamps CRUD Operations
Fetch all bootcamps from database. Inlcudes pagination, filtering, etc…
Key | Value | Description |
---|---|---|
page | 1 | page number |
limit | 2 | number of items per page |
Fetch single bootcamp by ID
Key | Value | Description |
---|---|---|
id | 5d725a1b7b292f5f8ceff788 |
Create new bootcamp to database. Must be authenticated and must be publisher or admin.
Update a bootcamp in database by ID. Must be authenticated and must be publisher or admin.
Key | Value | Description |
---|---|---|
id | 5d713a66ec8f2b88b8f830b8 | bootcamp id |
Upload a bootcamp photo in database by ID. Must be authenticated and must be publisher or admin.
Key | Value | Description |
---|---|---|
id | 5d725a1b7b292f5f8ceff788 | bootcamp id |
Key | Value | Description |
---|---|---|
photo |
Delete a bootcamp from database by ID. Must be authenticated and must be publisher or admin.
Key | Value | Description |
---|---|---|
id | 5d725a1b7b292f5f8ceff788 | bootcamp id |
StartFragment
This endpoint is used to retrieve bootcamps within a specified radius of a given location (zipcode) in a particular unit of measurement. It employs the Haversine formula to calculate the distance between the specified location and the bootcamps in the database, ensuring accurate results.
EndFragment
Key | Value | Description |
---|---|---|
zipcode | 02118 | The zipcode of the location from which to search for nearby bootcamps. |
distance | 100 | The distance in the specified unit (e.g., miles or kilometers) that defines the radius within which to search for bootcamps. |
unit | mi | The unit of measurement for the distance, either “mi” for miles or “km” for kilometers. |
Courses CRUD Operations
Fetch all courses from database. Inlcudes pagination, filtering, etc…
Key | Value | Description |
---|---|---|
page | 3 | page number |
limit | 3 | number of items per page |
Fetch single course by ID
Key | Value | Description |
---|---|---|
id | 5d725a4a7b292f5f8ceff789 |
fetch all courses of specific bootcamp by bootcampId
Key | Value | Description |
---|---|---|
select | title,bootcamp |
Key | Value | Description |
---|---|---|
bootcampId | 5d725a1b7b292f5f8ceff788 | bootcamp id |
Create new course to database. Must be authenticated and must be publisher or admin.
Update a course in database by ID. Must be authenticated and must be publisher or admin.
Key | Value | Description |
---|---|---|
id | 5d725cfec4ded7bcb480eaa5 | bootcamp id |
Delete a Course from database by ID. Must be authenticated and must be publisher or admin.
Key | Value | Description |
---|---|---|
id | 5d725cfec4ded7bcb480eaa5 | bootcamp id |
Create a course for a specific bootcamp
Key | Value | Description |
---|---|---|
bootcampId | 5d725a1b7b292f5f8ceff788 |
Endpoints for user authentication includes register, login, reset password, etc
Add user to database with encrypted password
Add user to database with encrypted password
StartFragment
GET logged in user data
EndFragmen
Generate password token and send email
reset user password via token
Key | Value | Description |
---|---|---|
resetToken | 0a06900986edaabc4d35fad269a3ec77b1f71729dd493634ba1d013d0ca55398 | reset password token |
Update logged in user name and email
Log user out by setting clear cookie
CRUD functionality for users only available to admin
Fetch all users from database. Inlcudes pagination, filtering, etc…, Must be authenticated and must be admin.
Key | Value | Description |
---|---|---|
page | 2 | page number |
limit | 5 | number of users per page |
Fetch single user by ID. Must be authenticated and must be admin.
Key | Value | Description |
---|---|---|
id | 5d7a514b5d2c12c7449be043 | user id |
Create new user in datebase. Must be authenticated and must be admin.
Update a user in database by ID. StartFragment
Must be authenticated and must be admin.
EndFragment
Key | Value | Description |
---|---|---|
id | 64c21325532bf51564b2ea0b | user id |
Delete a User from database by ID. Must be authenticated and must be admin.
EndFragment
Key | Value | Description |
---|---|---|
id | 64c21325532bf51564b2ea0b | user id |
Manage Course reviews
Insert review for a specific bootcamp.
Key | Value | Description |
---|---|---|
bootcampId | 5d725a037b292f5f8ceff787 |
update user Review. Must be Authenticated and only user can update his/her review.
Key | Value | Description |
---|---|---|
id | 5d7a514b5d2c12c7449be025 | review id |
Delete user Review. Must be Authenticated and only user can delete his/her review and also admin can do this action.
Key | Value | Description |
---|---|---|
id | 5d7a514b5d2c12c7449be025 | review id |
Get all reviews for a specific bootcamp by passing bootcamp id.
Key | Value | Description |
---|---|---|
page | 1 | |
limit | 3 |
Key | Value | Description |
---|---|---|
bootcampId | 5d713995b721c3bb38c1f5d0 | bootcamp id |
Get all reviews from database and populate with bootcamp name and description
Key | Value | Description |
---|---|---|
page | 1 | |
limit | 3 |