Bootcamps API

Backend API for DevCamper application to manage bootcamps, reviews, users and authentication.

Bootcamps 7

Bootcamps CRUD functionality.

Description

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

Headers
KeyValueDescription
Content-Typeapplication/json

JSON Type

Description

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

Description

Update single bootcamp in the database.

Description

Delete a single bootcamp in the database.

Description

Create a course for a specific bootcamp

Headers
KeyValueDescription
Content-Typeapplication/json

JSON Type

Body
{ "title": "Dev Ops", "description": "XXX", "weeks": "8", "tuition": 8000, "minimumSkill": "beginner", "scholarshipAvailable": false }
Description

Route to upload a bootcamp photo in the database

Headers
KeyValueDescription
Content-Typeapplication/json

JSON Type

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

Courses 5

Create, Read, Update and Delete courses.

Description

Get all courses from the database

Description

Update a course in the database

Headers
KeyValueDescription
Content-Typeapplication/json

JSON Type

Body
{ "weeks": "12", "tuition": 89000 }

Authentication 8

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

Description

Add user to the database with encrypted password

Headers
KeyValueDescription
Content-Typeapplication/json

JSON Type

Body
{ "name": "John", "email": "olvisdev@gmail.com", "password": "1234567", "role": "publisher" }
Description

User authorization, by checking correct credential in the database

Headers
KeyValueDescription
Content-Typeapplication/json

JSON Type

Body
{ "email": "olvisdev@gmail.com", "password": "1234567" }
Description

Get current logged in user

Headers
KeyValueDescription
Content-Typeapplication/json

JSON Type

AuthorizationBearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjY5NTlhNGQ3NmVhNWU2NDMyYTNlMjM1NCIsImlhdCI6MTc2NzU2NDA3MywiZXhwIjoxNzcwMTU2MDczfQ.EJ09hblWtClOuA7_rN8EK4_Kr-drHTd41rtMa61Bxns
Body
{ "name": "John", "email": "olvisdev@gmail.com", "password": "1234567", "role": "publisher" }
Description

Generate password token and send email

Headers
KeyValueDescription
Content-Typeapplication/json

JSON Type

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

Reset User’s password using a token

Body
{ "password": "678990" }
Description

Update logged in user email and name

Headers
KeyValueDescription
Content-Typeapplication/json

JSON Type

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

Update User’s password

Body
{ "currentPassword": "678990", "newPassword": "1234567" }

Users 5

CRUD functionality for users only available to admins

Description

Get all users(Admin)

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

Get single user by id(Admin)

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

Add user to database(Admin)

Headers
KeyValueDescription
Content-Typeapplication/json

JSON Type

Body
{ "name": "Mucyo Frank", "email": "frankm@gmail.com", "password": "1234567" }
Description

Update user in the database(Admin)

Body
{ "name": "Bill Rwigamba", "email": "bill@gmail.com" }
Description

Remove/Delete user from the database

Reviews 6

Manage course reviews

Body
{ "name": "Bill Rwigamba", "email": "bill@gmail.com" }
Description

Get all reviews from the database and populate with bootcamp name and description

Body
{ "name": "Bill Rwigamba", "email": "bill@gmail.com" }
Description

Fetch the reviews for specific bootcamp

Body
{ "name": "Bill Rwigamba", "email": "bill@gmail.com" }
Description

Fetch single review and populate bootcamp with name and description

Body
{ "name": "Bill Rwigamba", "email": "bill@gmail.com" }
Description

Insert review for a specific bootcamp

Headers
KeyValueDescription
Content-Typeapplication/json

JSON Type

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

Update review for the bootcamp in the database

Headers
KeyValueDescription
Content-Typeapplication/json

JSON Type

Body
{ "title": "Had fun" }