DevCamper API

Backend API for the dev camper application to manage bootcamps, courses, reviews, users, and authentication.

Auth 8

Register, Login, Resetpassword, etc…

Description

This route will generate password token and send email

Headers
KeyValueDescription
Content-Typeapplication/json

JSON Content Type

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

Get the logged in user using the jwt token

Headers
KeyValueDescription
Content-Typeapplication/json
Description

This route will log the user into the application and return a JWT token

Headers
KeyValueDescription
Content-Typeapplication/json

JSON Content Type

Body
{ "email": "stephendklein08@gmail.com", "password": "Welcome123" }
Description

This route is to register a user

Headers
KeyValueDescription
Content-Typeapplication/json

JSON Content Type

Body
{ "name": "MountainMan", "email": "mountainMan@gmail.com", "password": "Welcome123", "role": "user" }
Description

This route lets users reset their password

Headers
KeyValueDescription
Content-Typeapplication/json

JSON Content Type

URL Variables
KeyValueDescription
id
Body
{ "password": "123456789" }
Description

Update the logged in user name and email

Headers
KeyValueDescription
Content-Typeapplication/json

JSON Content Type

Body
{ "name": "Stephen Klein", "email": "stephendklein08@gmail.com" }
Description

Updates the user password sent in the body currentPassword and newPassword

Headers
KeyValueDescription
Content-Typeapplication/json

JSON Content Type

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

Route to log the current user out

Bootcamps 7

Bootcamps CRUD functionality.

Description

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

Headers
KeyValueDescription
Content-Typeapplication/json

JSON Content Type

Body
{ "name": "Modern Tech Bootcamp 999", "description": "ModernTech has one goal, and that is to make you a rockstar developer and/or designer with a six figure salary. We teach both development and UI/UX", "website": "https://moderntech.com", "phone": "(222) 222-2222", "email": "enroll@moderntech.com", "address": "220 Pawtucket St, Lowell, MA 01854", "careers": ["Web Development", "UI/UX", "Mobile Development"], "housing": false, "jobAssistance": true, "jobGuarantee": false, "acceptGi": true }
Description

Delete bootcamp from database.

URL Variables
KeyValueDescription
id
Description

Fetch all bootcamps from database. Includes pagination filtering.

Query
KeyValueDescription
page2
limit2
Description

Get bootcamps within a radius of a specific zipcode

URL Variables
KeyValueDescription
zipcode
distance
Description

Get single bootcamp by id.

URL Variables
KeyValueDescription
id
Description

Update single bootcamp in database.

URL Variables
KeyValueDescription
id
Body
{ "housing": false }
Description

This route lets users upload a file for a bootcamp

URL Variables
KeyValueDescription
bootcampId

Courses 6

CRUD functionality for courses

Description

Creates a course using the bootcamp id creating a reference.

Headers
KeyValueDescription
Content-Typeapplication/json

JSON Content Type

URL Variables
KeyValueDescription
bootcampId
Body
{ "title": "The Goblin 1", "description": "You will learn to master HTML, CSS and front end JavaScript, along with tools like Git, VSCode and front end frameworks like Vue", "weeks": 22, "tuition": 8000, "minimumSkill": "beginner", "scholarhipsAvailable": false }
Description

This route deletes a single course

URL Variables
KeyValueDescription
id
Description

This request gets a single course with the associated bootcamp using the populate method.

URL Variables
KeyValueDescription
id
Description

GET all the courses from the backend

Description

GET the specific courses for a bootcamp

URL Variables
KeyValueDescription
bootcampId
Body
{ "title": "Front End Web Development", "description": "This course will provide you with all of the essentials to become a successful frontend web developer. You will learn to master HTML, CSS and front end JavaScript, along with tools like Git, VSCode and front end frameworks like Vue", "weeks": 8, "tuition": 8000, "minimumSkill": "beginner", "scholarhipsAvailable": true }
Description

Update a single course in the database

Headers
KeyValueDescription
Content-Typeapplication/json

JSON Content Type

URL Variables
KeyValueDescription
id
Body
{ "tuition": 66666, "minimumSkill": "advanced" }

Reviews 6

CRUD functionality to manage course reviews

Description

This route adds a review to an associated bootcamp (user, admin) only.

Headers
KeyValueDescription
Content-Typeapplication/json

JSON Content Type

URL Variables
KeyValueDescription
bootcampId
Body
{ "title": "Nice bootcamp", "text": "I learned a lot", "rating": 8 }
Description

Delete the review from the database

URL Variables
KeyValueDescription
id
Description

This route gets all the reviews

Description

Get all the reviews for a specific bootcamp

URL Variables
KeyValueDescription
bootcampId
Description

Fetch single review from db populating the review with bootcamp name and description

URL Variables
KeyValueDescription
id
Description

Update review in database

Headers
KeyValueDescription
Content-Typeapplication/json

JSON Content Type

URL Variables
KeyValueDescription
id
Body
{ "title": "Hello World" }

Users 5

CRUD functionality for users only availabe to admins

Description

Add user to db (admin)

Headers
KeyValueDescription
Content-Typeapplication/json

JSON Content Type

Body
{ "name": "Nate Smith", "email": "nate@gmail.com", "password": "Welcome123" }
Description

Delete the user from the db (admin)

Headers
KeyValueDescription
Content-Typeapplication/json

JSON Content Type

URL Variables
KeyValueDescription
id
Description

Thie route gets all the users (admin)

Description

Gets the single user by id (admin)

URL Variables
KeyValueDescription
id
Description

Updae the user in the DB (admin)

Headers
KeyValueDescription
Content-Typeapplication/json

JSON Content Type

URL Variables
KeyValueDescription
id
Body
{ "name": "Nate Johnson", "email": "nate@gmail.com", "password": "Welcome123" }