DEVCAMP MASTERY - backendAPI

This contains full documentation of routes about the backend server API for the DEVCAMP MASTERY website.

Admin Panel 4

Routes for admins to manage user accounts.

Only for user with role admin and must be logged in(apply to all routes from Admin Panel collection.

Description

Get a list with all users from database.

Description

Create a new user.

Headers
Key Value Description
Content-Type application/json
Body
{ "name": "user", "password": "123456", "email": "user@gmail.com", "role": "user" }
Description

Update details for a specific user using his ID.

Headers
Key Value Description
Content-Type application/json
Body
{ "name": "Different user name" }

Authentication 8

Routes that includes all functionality for a user to interact with the website (login, logout, reset password etc)

Description

Add a new user to database with a encrypted password.

Headers
Key Value Description
Content-Type application/json
Body
{ "name": "Manole<h1><br>'Alert</script>", "email": "asd@gmail.com", "role": "publisher", "password": "12345678" }
Description

Log in a user, also create a JWT token for persisting logged session.

Headers
Key Value Description
Content-Type application/json
Body
{ "email": , "password": "123456" }
Description

Generate a reset password token and send it via email in order to reset a forgotten password.

Headers
Key Value Description
Content-Type application/json
Body
{ "email": "publisher@gmail.com" }
Description

Get all data about the current logged in user.

Description

Log out a user deleting token cookie.

Description

Reset user password using the token from email, sent via ‘reset forgot password’ route.

Headers
Key Value Description
Content-Type application/json
Body
{ "newPassword": "altaparola" }
Description

Update email or username for logged in user.

Headers
Key Value Description
Content-Type application/json
Body
{ "newName": "User Account" }
Description

Update password for logged in user.

Headers
Key Value Description
Content-Type application/json
Body
{ "currentPassword": "altaparola", "newPassword": "123456" }

Bootcamps 7

Manage Bootcamps (CRUD functionality)

Description

Fetch all the bootcamps available from the database

Description

Get bootcamps within a radius of a specific zipcode (distance in km)

Description

Create a new bootcamp and add it to the database.

  • must be logged in
  • only for users with the role publisher
  • limit of one bootcamp per user


Headers
Key Value Description
Content-Type application/json
Body
{ "name": "ModernTech Bootcamp", "description": "Is coding your passion? Codemasters will give you the skills and the tools to become the best developer possible. We specialize in full stack web development and data science", "website": "https://codemasters.com", "phone": "(333) 333-3333", "email": "enroll@codemasters.com", "address": "85 South Prospect Street Burlington VT 05405", "careers": ["Web Development", "Data Science", "Business"], "housing": false, "jobAssistance": false, "jobGuarantee": false, "acceptGi": false, "slug": "alt value" }
Description

Update a specific bootcamp in the database.

  • must be logged in
  • only for user with the role publisher
  • must own the specified Bootcamp


Headers
Key Value Description
Content-Type application/json
Body
{ "averageCost": 5000, "averageRating": 4 }
Description

Upload photo profile for a specific bootcamp.

  • must be logged in
  • only for users with the role publisher
  • must own the specified Bootcamp
  • only image/photo file are accepted and less than 1MB


Body
Key Value Description
photo
Description

Delete a specific bootcamp from database.

  • must be logged in
  • only for users with the role publisher
  • must own the specified Bootcamp


Courses 5

Manage Courses (CRUD functionality)

Description

Get all courses from the database.

Description

Create a new course for a specific Bootcamp and add it to the database.

  • bootcamp will be passed in body by “bootcamp” field
  • must be logged in
  • only for user with the role publisher
  • must own the specified Bootcamp


Headers
Key Value Description
Content-Type application/json
Body
{ "title": "Bootcamp Crypto 22", "description": "Get started building mobile applications for IOS using Swift and other tools", "weeks": 8, "tuition": 9800, "minimumSkill": "intermediate", "scholarhips": false, "bootcamp": "5d713a66ec8f2b88b8f830b8" }
Description

Update a specific course in the database.

  • must be logged in
  • only for users with the role publisher
  • must own the specified Bootcamp


Headers
Key Value Description
Content-Type application/json
Body
{ "title":"Programare web la alt nivel" }
Description

Delete a course from the database.

  • must be logged in
  • only for users with the role publisher
  • must own the specified Bootcamp


Headers
Key Value Description
Content-Type application/json

Reviews 5

Manage Reviews (CRUD functionality)

Description

Get all reviews from the database.

Description

Write a new reviews for a specific Bootcamp and add it to the database.

  • must be logged in
  • only for users with the role user
  • limit of one review per Bootcamp


Headers
Key Value Description
Content-Type application/json
Body
{ "title": "Best instructors", "text": "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec viverra feugiat mauris id viverra. Duis luctus ex sed facilisis ultrices. Curabitur scelerisque bibendum ligula, quis condimentum libero fermentum in. Aenean erat erat, aliquam in purus a, rhoncus hendrerit tellus. Donec accumsan justo in felis consequat sollicitudin. Fusce luctus mattis nunc vitae maximus. Curabitur semper felis eu magna laoreet scelerisque", "rating": "asd", "bootcamp": "5d725a037b292f5f8ceff787" }
Description

Update a specific review in database.

  • must be logged in
  • only for users with the role user
  • must own the specified Review


Headers
Key Value Description
Content-Type application/json
Body
{ "title": "awesome test", "text": "adasdasdasdasda", "rating": 8, "bootcamp": "621d1cb60cd64c59557e0275" }
Description

Delete a review from the database.

  • must be logged in
  • only for users with the role user
  • must own the specified Review