DevCamper API

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

Authentication 8

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

Description

this is going to generate password token and send email

Headers
KeyValueDescription
Content-Typeapplication/json

JSON Type

Body
{ "email":"john@gmail.com" }
Headers
KeyValueDescription
Content-Typeapplication/json
Description

Add user to database with encrypted password.

Headers
KeyValueDescription
Content-Typeapplication/json

JSON Type

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

reset use password using token

Headers
KeyValueDescription
Content-Typeapplication/json

JSON Type

Body
{ "password":"1234567" }
Description

update logged in user’s name and email

Headers
KeyValueDescription
Content-Typeapplication/json

JSON Type

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

update logged in user’s password ,send in the body current Password and newPassword

Headers
KeyValueDescription
Content-Typeapplication/json

JSON Type

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

login user and return token(it has user id and some other details ex: expired at)

Headers
KeyValueDescription
Content-Typeapplication/json

JSON Type

Body
{ "email":{"$gt":""}, "password":"123456" }

Bootcamps 8

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

AuthorizationBearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjVmNzFiMzQxNmJiYjRiMWU5Y2MyZjdhZiIsImlhdCI6MTYwMTMxNjI1MSwiZXhwIjoxNjAzOTA4MjUxfQ.QRscrPPD7EF-whIjXB76-4wB79Fw4NSt1hCQ5l2T19A
Body
{ "name": "test bootcamp 1 " , "address":"south civil lines devere colony chhindwara madhya pradesh india", "description":"learning bacayushkhand api" }
Description

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

Description

get only name id and description and are sorted in descending oreder as -name is written

Query
KeyValueDescription
selectname,description
sort-name
Description

Get bootcamps within a radius of a specific zipcode

Description

Update single bootcamp in database by ID

Headers
KeyValueDescription
Content-Typeapplication/json

JSON Type

Body
{ "housing":false }
Description

route to upload photo of a bootcamp

Headers
KeyValueDescription
Content-Typeapplication/json

JSON Type

Body
{ "housing":false }

Courses 5

create read update and delete courses CRUD

Description

Create a course for a specific bootcamp

Headers
KeyValueDescription
Content-Typeapplication/json

JSON Type

Body
{ "title": "Front End Web Development 1", "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

GET all courses in database

Description

Update course in database

Headers
KeyValueDescription
Content-Typeapplication/json

JSON Type

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

Reviews 6

Manage course reviews

Description

Insert review for a specific bootcamp

Headers
KeyValueDescription
Content-Typeapplication/json

JSON Type

Body
{ "title":"nice bootcamp", "text":"it was a great learning", "rating":"8" }
Description

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

Description

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

Description

update review in the database

Headers
KeyValueDescription
Content-Typeapplication/json

JSON Type

Body
{ "title":"Not a nice bootcamp", "text":"it was not a great learning", "rating":"1" }

Users 5

All CRUD functionality for an admin

Description

Create user to database (admin)

Headers
KeyValueDescription
Content-Typeapplication/json

JSON Type

Body
{ "name":"jane doe", "email":"jane@gmail.com", "password":"123456" }
Description

get all users after logged in as an admin

Description

update user in database (admin)

Headers
KeyValueDescription
Content-Typeapplication/json

JSON Type

Body
{ "name":"jane smith" }