DevCamper API

backend API for DevCampers application to manage bootcamps,courses,reviews,users and authentication

authentication 8

implement authorization and authentication for routes

Headers
KeyValueDescription
Content-Typeapplication/json

jSON Type

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

get current logged in user via it’s generated token

Headers
KeyValueDescription
Content-Typeapplication/json

jSON Type

Body
{ "email":"jon@gmail.com", "password": "john@000" }
Headers
KeyValueDescription
Content-Typeapplication/json

jSON Type

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

Add user to database with encrypted password

Headers
KeyValueDescription
Content-Typeapplication/json

jSON Type

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

reset user password via token

Headers
KeyValueDescription
Content-Typeapplication/json

jSON Type

Body
{ "password": "kevin@1123" }
Description

update logged in user details

Headers
KeyValueDescription
Content-Typeapplication/json

jSON Type

Body
{ "name": "kevinup", "email": "kevinup@gmail.com" }
Description

update user password via token

Headers
KeyValueDescription
Content-Typeapplication/json

jSON Type

Body
{ "currentPassword": "kevin@1123", "newPassword": "kevin@1234" }
Description

logout the current user & clear cookie token

bootcamps 7

bootcamps CRUD functionality

Description

add new bootcamp to database, you must be authenticated and need to be a publisher or admin

Headers
KeyValueDescription
Content-Typeapplication/json

jSON Type

Body
{ "name": "TESTING <script> alert('hello')</script> ", "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": "enroll@devcentral.com", "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

fetch all bootcamps from database,includes pagination,filtering and much more

Headers
KeyValueDescription
Content-Typeapplication/json

jSON Type

Description

Update a single Bootcamp to database by ID

Headers
KeyValueDescription
Content-Typeapplication/json

jSON Type

Body
{ "housing": true }
Description

route to upload bootcamp photo

Headers
KeyValueDescription
Content-Typeapplication/json

jSON Type

Body
KeyValueDescription
file

courses 6

Create, Read, Update and delete courses

Description

Create a course for specific Bootcamp

Headers
KeyValueDescription
Content-Typeapplication/json

jSON Type

Body
{ "title": "Front End Web Development THIRD VERSION", "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, "bootcamp": "5d713995b721c3bb38c1f5d0", "user": "5d7a514b5d2c12c7449be045" }
Description

get all the courses from the database

Description

Update course to database

Headers
KeyValueDescription
Content-Typeapplication/json

jSON Type

Body
{ "title": "Front End Web Development Third Version", "weeks": "12" }

reviews 7

manage course reviews

Description

insert a reviews for a specific bootcamp

Headers
KeyValueDescription
Content-Typeapplication/json

jSON Type

Body
{ "title": "amazing Bootcamp!", "text": "thank you for this amazing experience,great stuff", "rating": 10 }
Description

retrieve all reviews from datbase

Headers
KeyValueDescription
Content-Typeapplication/json

jSON Type

Description

get single review by id

Headers
KeyValueDescription
Content-Typeapplication/json

jSON Type

Description

update review to databae

Headers
KeyValueDescription
Content-Typeapplication/json

jSON Type

Body
{ "title": "outstanding Bootcamp!", "rating": 9 }

users 5

CRUD functionality for users only availabe to admins

Description

Create a new user (admin only)

Headers
KeyValueDescription
Content-Typeapplication/json

jSON Type

Body
{ "name": "mike smith", "email":"mike@gmail.com", "password":"123456" }
Description

delete user from database (admin only)

Headers
KeyValueDescription
Content-Typeapplication/json

jSON Type

Body
{ "name": "mike brown" }
Description

Get all users (admin)

Headers
KeyValueDescription
Content-Typeapplication/json

jSON Type

Description

Get a single user by id (admin)

Headers
KeyValueDescription
Content-Typeapplication/json

jSON Type

Description

Update user to database (admin only)

Headers
KeyValueDescription
Content-Typeapplication/json

jSON Type

Body
{ "name": "mike brown" }