DevCamper API

Backend API for the DevCamper application to manage bootcamps, courses, reviews, users and authentications.

Authentication 8

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

Description

Generate password token and send email

Headers
KeyValueDescription
Content-Typeapplication/json

JSON Type

Body
{ "email": "john@gmail.com" }
Description

Get Current User info

Headers
KeyValueDescription
Content-Typeapplication/json

JSON Type

Description

Login user

Headers
KeyValueDescription
Content-Typeapplication/json

JSON Type

Body
{ "email": "william@gmail.com", "password": "123456" }
Description

Logout user and clear cookie

Headers
KeyValueDescription
Content-Typeapplication/json

JSON Type

Description

Add user to database with encrypted password

Headers
KeyValueDescription
Content-Typeapplication/json

JSON Type

Body
{ "name": "william", "email": "william@gmail.com", "password": "123456", "role": "user"}
Description

Reset user password using token

Headers
KeyValueDescription
Content-Typeapplication/json

JSON Type

Body
{ "password": "new_password" }
Description

Update logged in user name and email

Headers
KeyValueDescription
Content-Typeapplication/json

JSON Type

Body
{ "name": "John Doe", "email": "john@gmail.com" }
Description

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

Headers
KeyValueDescription
Content-Typeapplication/json

JSON Type

Body
{ "currentPassword": "new_password", "newPassword": "123456" }

Bootcamps 7

Bootcamps CRUD functionality

Description

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

Headers
KeyValueDescription
Content-Typeapplication/json

JSON Type

Body
{ "name": "Modern Tech Bootcamp", "description": "Modern Tech Bootcamp", "website": "https://devworks.com", "phone": "(111) 111-1111", "email": "enroll@devworks.com", "address": "233 Bay State Rd Boston MA 02215", "careers": ["Web Development", "UI/UX", "Business"], "housing": true, "jobAssistance": true, "jobGuarantee": false, "acceptGi": true }
Description

Delete bootcamp from database by ID

Headers
KeyValueDescription
Content-Typeapplication/json

JSON Type

Description

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

Headers
KeyValueDescription
Content-Typeapplication/json

JSON Type

Query
KeyValueDescription
housingtrue
location.stateMA
Description

Get bootcamps within a radius of a specific zipcode

Headers
KeyValueDescription
Content-Typeapplication/json

JSON Type

Description

Get single bootcamp by ID

Headers
KeyValueDescription
Content-Typeapplication/json

JSON Type

Description

Update single bootcamp in database by ID

Headers
KeyValueDescription
Content-Typeapplication/json

JSON Type

Body
{ "housing": false }
Description

Route to upload a photo for the bootcamp

Headers
KeyValueDescription
Content-Typeapplication/json

JSON Type

Body
KeyValueDescription
file

Courses 6

Create, read, update and delete courses

Description

Create a course for bootcamp by bootcampId

Headers
KeyValueDescription
Content-Typeapplication/json

JSON Type

Body
{ "title": "UI/UX", "description": "In this course you will learn to create beautiful interfaces. It is a mix of design and development to create modern user experiences on both web and mobile", "weeks": 12, "tuition": 10000, "minimumSkill": "intermediate", "scholarhipsAvailable": true }
Headers
KeyValueDescription
Content-Typeapplication/json

JSON Type

Description

Get all courses in database

Headers
KeyValueDescription
Content-Typeapplication/json

JSON Type

Query
KeyValueDescription
page2
limit2
Description

Get the specific courses for a bootcamp

Headers
KeyValueDescription
Content-Typeapplication/json

JSON Type

Description

Get a single course by its ID

Headers
KeyValueDescription
Content-Typeapplication/json

JSON Type

Headers
KeyValueDescription
Content-Typeapplication/json

JSON Type

Body
{ "title": "UI/UX - UPDATED test" }

Reviews 6

Manage course reviews

Description

Add a review for a bootcamp

Headers
KeyValueDescription
Content-Typeapplication/json

JSON Type

Body
{ "title": "Great Learning experience!", "text": "I learned a lot!", "rating": 8 }
Description

Delete review for a bootcamp in database

Headers
KeyValueDescription
Content-Typeapplication/json

JSON Type

Description

Get all reviews from database

Description

Get all reviews for bootcamp by bootcamp ID

Headers
KeyValueDescription
Content-Typeapplication/json

JSON Type

Description

Fetch a review from database by id and populate bootcamp name and description

Headers
KeyValueDescription
Content-Typeapplication/json

JSON Type

Description

Update review for bootcamp in database

Headers
KeyValueDescription
Content-Typeapplication/json

JSON Type

Body
{ "text": "I learned a lot! Highly recommended!!" }

Users 5

CRUD functionality for users only available to admins

Description

Create a user (admin)

Headers
KeyValueDescription
Content-Typeapplication/json

JSON Type

Body
{ "role": "publisher", "name": "William Wang", "email": "william@gmail.com", "password": "123456" }
Description

Delete a user by ID (admin)

Headers
KeyValueDescription
Content-Typeapplication/json

JSON Type

Description

Get all users (admin)

Headers
KeyValueDescription
Content-Typeapplication/json

JSON Type

Description

Get single user by ID (admin)

Headers
KeyValueDescription
Content-Typeapplication/json

JSON Type

Description

Update user by ID (admin)

Headers
KeyValueDescription
Content-Typeapplication/json

JSON Type

Body
{ "role": "publisher" }