dev_api

Backend API for dev_api application to manage bootcamps, courses, reviews, users and authentication

Authentication 8

Routes for User Authentication including register, login, reset password, etc.

Description

Route to generate reset password token and mail it.

Headers
KeyValueDescription
Content-Typeapplication/json

JSON Type

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

Get current logged in user via token

Headers
KeyValueDescription
Content-Typeapplication/json

JSON Type

Description

Route to login a user

Headers
KeyValueDescription
Content-Typeapplication/json

JSON Type

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

Clear token cookie and logout.

Description

Add user to database with encrypted password

Headers
KeyValueDescription
Content-Typeapplication/json

JSON Type

Body
{ "name": "Cypher", "email": "cypher@gmail.com", "password": "123456", "role": "publisher" }
Description

Route to reset the password using the password reset token mailed to user’s email.

Headers
KeyValueDescription
Content-Typeapplication/json

JSON Type

Body
{ "password": "12345678" }
Description

Update logged in user name and email

Headers
KeyValueDescription
Content-Typeapplication/json

JSON Type

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

update the password of logged in user. Send in the body currentPassword and newPassword.

Headers
KeyValueDescription
Content-Typeapplication/json

JSON Type

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

Bootcamps 7

Bootcamps CRUD funtionality

Description

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

Headers
KeyValueDescription
Content-Typeapplication/json

JSON Type

Body
{ "name": "ModernTech Bootcamp", "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. Select by id

Description

Fetch all bootcamps from database. Includes pagination filtering, etc

Description

Get bootcamps within a radius of a specific zipcode.

Description

Update a bootcamp in database. Select by id

Headers
KeyValueDescription
Content-Typeapplication/json

JSON Type

Body
{ "careers": ["Web Development", "UI/UX"] }
Description

To upload/update a photo for the bootcamp using the id

Courses 6

Create, read, update and delete courses

Description

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

Headers
KeyValueDescription
Content-Typeapplication/json

JSON Type

Body
{ "title": "IOS Development", "description": "Get started building mobile applications for IOS using Swift and other tools", "weeks": 8, "tuition": 6000, "minimumSkill": "intermediate", "scholarhipsAvailable": false }
Description

delete course from database. Select by id

Description

Get all courses in database

Description

Update a course in database. Select by id

Headers
KeyValueDescription
Content-Typeapplication/json

JSON Type

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

Reviews 6

Manage course reviews.

Description

Insert review for a specific bootcamp. Only one review per user is allowed.

Headers
KeyValueDescription
Content-Typeapplication/json

JSON Type

Body
{ "title": "Nice bootcamp", "text": "I learned a lot... blah blah blah", "rating": 9 }
Description

Delete a review by id. Only the owner of the review and admin can delete.

Headers
KeyValueDescription
Content-Typeapplication/json

JSON Type

Description

Get all reviews from Database and populate with bootcamp name and description.

Description

Fetch a single review from bootcamp by id and populate it with bootcamp name and description.

Description

update a review by id. Only the owner of the review and admin can update.

Headers
KeyValueDescription
Content-Typeapplication/json

JSON Type

Body
{ "title":"Review 2" }

Users 5

CRUD funtionality for users only available to admin.

Description

Add a new user to database. You must be an admin.

Headers
KeyValueDescription
Content-Typeapplication/json

JSON Type

Body
{ "name": "Cypher", "email": "cypher@gmail.com", "password": "123456", "role": "publisher" }
Description

Delete a user by id. You must be an admin.

Description

Fetch all bootcamps from database. You must be an admin.

Description

Get single user by id. You must be an admin.

Description

Update a user by id. You must be an admin.

Headers
KeyValueDescription
Content-Typeapplication/json

JSON Type

Body
{ "name": "Cypher", "password": "123456" }