DevCamper API

Backend API for the DevCamper Application to manage bootcamps, courses, reviews, users and authentication

Bootcamps 8

Bootcamps CRUD functionality

Description

Fetch all bootcamps from database. Includes pagination, filtering, etc.

Query
KeyValueDescription
averageCost[lte]10000
housingtrue
selectname,description
Description

Add new bootcamp to database. Must be authenticated and must be a publisher or admin.

Headers
KeyValueDescription
Content-Typeapplication/json

JSON Type

Body
{ "name": "ModernTech Bootcamp", "description": "Is coding your passion? Codemasters will give you the skills and the tools to become the best developer possible. We specialize in front end and full stack web development", "website": "https://devcentral.com", "phone": "(444) 444-4444", "email": "[email protected]", "address": "45 Upper College Rd Kingston RI 02881", "careers": [ "Mobile Development", "Web Development", "Data Science", "Business" ], "housing": false, "jobAssistance": true, "jobGuarantee": true, "acceptGi": true }
Description

Update single bootcamp in database.

Headers
KeyValueDescription
Content-Typeapplication/json

JSON Type

Body
{ "housing": false }
Description

Add a user to the database.

Headers
KeyValueDescription
Content-Typeapplication/x-www-form-urlencoded
Body
KeyValueDescription
passwordpassword1
email[email protected]
nametest test
password2password1
Description

Get bootcamps within a radius of a specific zipcode.

Description

Add a photo to a single bootcamp.

Body
KeyValueDescription
file

Courses 6

Description

Get all courses from database.

Description

Create a course for a specific bootcamp.

Headers
KeyValueDescription
Content-Typeapplication/json

JSON Type

Query
KeyValueDescription
averageCost[lte]10000
Body
{ "title": "Full Stack Web Development1", "description": "In this course you will learn full stack web development, first learning all about the frontend with HTML/CSS/JS/Vue and then the backend with Node.js/Express/MongoDB", "weeks": 12, "tuition": 10000, "minimumSkill": "intermediate", "scholarhipsAvailable": true }
Description

Update course in database.

Headers
KeyValueDescription
Content-Typeapplication/json

JSON Type

Body
{ "tuition": 13000, "minimumSkill": "advanced" }

Auth 8

Routes for user authentication including register, login, reset password, etc.

Description

Add user to the database.

Headers
KeyValueDescription
Content-Typeapplication/json

JSON Type

Body
{ "name": "Jonh Doe", "email": "[email protected]", "password": "123456", "role": "publisher" }
Description

Login user.

Headers
KeyValueDescription
Content-Typeapplication/json

JSON Type

Body
{ "email": "jo[email protected]", "password": "123456" }
Description

Get the current logged in user from datbase.

Description

Generate password token and send email.

Headers
KeyValueDescription
Content-Typeapplication/json

JSON Type

Body
{ "email": "[email protected]" }
Description

Reset password using token.

Headers
KeyValueDescription
Content-Typeapplication/json

JSON Type

Body
{ "password": "1234567" }
Description

Update logged in user name & email.

Headers
KeyValueDescription
Content-Typeapplication/json

JSON Type

Body
{ "email": "[email protected]", "name": "John Doe" }
Description

Update logged in user password, send in body currentPassword and newPassword.

Headers
KeyValueDescription
Content-Typeapplication/json

JSON Type

Body
{ "currentPassword": "1234567", "newPassword": "123456" }
Description

Clear token cookie and logout user.

Users 5

CRUD functionality for admin users.

Description

Get all users (admin).

Description

Add user to database (admin).

Headers
KeyValueDescription
Content-Typeapplication/json

JSON Type

Body
{ "name": "Nate Smith", "email": "[email protected]", "password": "123456" }
Description

Update user in database (admin).

Headers
KeyValueDescription
Content-Typeapplication/json

JSON Type

Body
{ "name": "Nate Johnson" }
Description

Delete user in the database (admin).

Reviews 6

Manage course reviews.

Description

Get all reviews from database and populate with Bootcamp name and description.

Description

Fetch a review deom database by id and populate Bootcamp name and description.

Description

Insert review for a single bootcamp.

Headers
KeyValueDescription
Content-Typeapplication/json

JSON Type

Body
{ "title": "Nice Bootcamp", "text": "I learn a lot.", "rating": 8 }
Description

Update review in database.

Headers
KeyValueDescription
Content-Typeapplication/json

JSON Type

Body
{ "title": "Updated" }