DevCamper API

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

Bootcamps 7

Bootcamps CRUD functionality

Description

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

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<script>alert</script> 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

Get bootcamps within a radius of a specific zipcode

Courses 6

Routes for courses that are being served in the diferent bootcamps

Description

Get all available courses for all bootcamps

Description

Create a course for a specific bootcamp

Headers
KeyValueDescription
Content-Typeapplication/json

JSON Type

Body
{ "title": "Joppi Dopp Web Development", "description": "In this course you will learn full stack web development, first learning all about the frontend with HTML/CSS/JS/Vue and then the backend with Node.js/Express/MongoDB", "weeks": 12, "tuition": 10000, "minimumSkill": "intermediate", "scholarhipsAvailable": true }
Description

Update single course

Headers
KeyValueDescription
Content-Typeapplication/json

JSON Type

Body
{ "tuition": 18000 }

Authentication 8

Routes for user authentication including register, login, reset password and more.

Description

Add user

Headers
KeyValueDescription
Content-Typeapplication/json

JSON Type

Body
{ "name": "Magnus", "email": "mag@testing.com", "password": "123456", "role": "publisher" }
Description

Login User

Headers
KeyValueDescription
Content-Typeapplication/json

JSON Type

Body
{ "email": "mag@testing.com", "password": "123456" }
Description

Get information on the logged in User

Headers
KeyValueDescription
Content-Typeapplication/json

JSON Type

AuthorizationBearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjY5MDQ1NTEwYTBmZWM0NDI5M2NiYjU5MiIsImlhdCI6MTc2MTg5ODI4MywiZXhwIjoxNzY0NDkwMjgzfQ.sVH1g99ihQnizqdDwoS0OcsLI8trkSH1DSLQn0El0kY
Body
{ "email": "mag@testing.com", "password": "123456" }
Description

Reset Password User 10 min token returned. Mail send out from mailtrap.io

Headers
KeyValueDescription
Content-Typeapplication/json

JSON Type

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

Reset Password using token

Headers
KeyValueDescription
Content-Typeapplication/json

JSON Type

Body
{ "password": "1234567" }
Description

Update Name and Email for User

Headers
KeyValueDescription
Content-Typeapplication/json

JSON Type

Body
{ "email": "barcelonaguiden@gmail.com", "name" : "Magnus Haffran" }
Description

Update logged in user password, send in the body currentPassword and newPassword.

Headers
KeyValueDescription
Content-Typeapplication/json

JSON Type

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

Clear token cookie

Headers
KeyValueDescription
Content-Typeapplication/json

JSON Type

Body
{ "email": "mag@testing.com", "password": "123456" }

Users 5

CRUD functionality for users only available for admins

Description

Get all users (only admin can access)

Description

Add user to database (admin only)

Headers
KeyValueDescription
Content-Typeapplication/json

JSON Type

Body
{ "name": "Maggie Johnson 2", "email": "maggie2@gmail.com", "password": "123456" }
Description

Update user in database (admin only)

Headers
KeyValueDescription
Content-Typeapplication/json

JSON Type

Body
{ "name": "Maggie Johnson 3", "email": "maggie2@gmail.com", "password": "123456" }
Description

Delte Single User from Database (admin only)

Headers
KeyValueDescription
Content-Typeapplication/json

JSON Type

Body
{ "name": "Maggie Johnson 3", "email": "maggie2@gmail.com", "password": "123456" }

Reviews 6

Reviews

Description

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

Description

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

Description

Add review to Database (only user and admin)

Headers
KeyValueDescription
Content-Typeapplication/json

JSON Type

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

Update Single Review. Only for the user that own the review or admin.

Headers
KeyValueDescription
Content-Typeapplication/json

JSON Type

Body
{ "rating": 10 }
Description

Remove review from database (only user that owns the review and admin)

Headers
KeyValueDescription
Content-Typeapplication/json

JSON Type