devCamper API

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

Bootcamps 7

Bootcamps CRUD funtionality.

Description

Fetch all bootcamps from database. Includes pagination filtering etc.

Description

Get single bootcamp by ID

Headers
KeyValueDescription
Content-Typeapplication/json

JSON type

Description

Get bootcamps within the radius of a specific zipcode.

Headers
KeyValueDescription
Content-Typeapplication/json

JSON type

Description

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

Headers
KeyValueDescription
Content-Typeapplication/json

JSON type

Body
{ "name": "Codemasters", "description": "Devworks is a full stack JavaScript Bootcamp located in the heart of Boston that focuses on the technologies you need to get a high paying job as a web developer", "website": "https://devworks.com", "phone": "(111) 111-1111", "email": "enroll@devworks.com", "address": "233 Bay State Rd Boston MA 02215", "careers": [ "Web Development", "UI/UX", "Business" ], "photo": "no-photo.jpg", "housing": true, "jobAssistance": true, "jobGuarantee": false, "acceptGi": true, "createdAt": "2025-01-13T11:01:01.643Z", "__v": 0 }
Description

Update single bootcamp in database.

Courses 6

Creat, read, update and delete courses.

Description

Get all courses in database.

Description

Create a course for a specific bootcamp

Headers
KeyValueDescription
Content-Typeapplication/json

JSON type

Body
{ "title": "SR's Full Stack 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": 3000, "minimumSkill": "intermediate", "scholarshipAvailable": true }
Description

Update a course.

Headers
KeyValueDescription
Content-Typeapplication/json

JSON type

Body
{ "tuition": 1800, "minimumSkill": "advanced", "scholarshipAvailable": false }

Authentication 8

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

Description

Add user to database with encrypted password

Headers
KeyValueDescription
Content-Typeapplication/json

JSON type

Body
{ "name": "Shahin", "email": "tester@test.com", "password": "12345678", "role": "publisher" }
Description

Log into the database

Headers
KeyValueDescription
Content-Typeapplication/json

JSON type

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

JSON type

Description

Generate password token and send email.

Headers
KeyValueDescription
Content-Typeapplication/json

JSON type

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

Reset user password using token

Headers
KeyValueDescription
Content-Typeapplication/json

JSON type

Body
{ "password": "abcd1234567890" }
Description

Update logged in user, name and email.

Headers
KeyValueDescription
Content-Typeapplication/json

JSON type

Body
{ "email": "john@gmail.com", "name": "john Doe" }
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

Log the user out and clear token cookie.

Users 5

CRUD funtionality for users only available to admins.

Description

Get all users (admin)

Headers
KeyValueDescription
Content-Typeapplication/json

JSON type

Description

Get single user by ID (admin)

Headers
KeyValueDescription
Content-Typeapplication/json

JSON type

Description

Add user to database (admin)

Headers
KeyValueDescription
Content-Typeapplication/json

JSON type

Body
{ "name": "Wayne Rooney", "email": "rooney@gmail.com", "password": "123456" }
Description

Update user in database (admin)

Headers
KeyValueDescription
Content-Typeapplication/json

JSON type

Body
{ "name": "Wazza Rooney" }

Reviews 6

Manage course 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

Insert Review for a specific bootcamp.

Headers
KeyValueDescription
Content-Typeapplication/json

JSON type

Body
{ "title": "Nice bootcamp", "text": "I really enjoyed this course", "rating": 8 }
Description

Update review in database

Headers
KeyValueDescription
Content-Typeapplication/json

JSON type

Body
{ "title": "Had fun" }