Hackathon API

Backend API to manage hackathons, courses, reviews, users and authentication

Use https://api.demo.schauff.tech as the {{URL}} for all endpoints

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": "John Doe", "email": "john@gmail.com", "password": "123456", "role": "publisher" }
Headers
KeyValueDescription
Content-Typeapplication/json

JSON Type

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

JSON Type

AuthorizationBearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjVkN2E1MTRiNWQyYzEyYzc0NDliZTA0NSIsImlhdCI6MTU3MTA1NzkzMywiZXhwIjoxNTczNjQ5OTMzfQ.rTumDmWSKzoiGrarbCRqpVBVVfHo5su4TNagQM6c2Ts
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": "1234567" }
Description

Update logged in user name and email

Headers
KeyValueDescription
Content-Typeapplication/json

JSON Type

AuthorizationBearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjVkN2E1MTRiNWQyYzEyYzc0NDliZTA0NSIsImlhdCI6MTU3MTA1NzkzMywiZXhwIjoxNTczNjQ5OTMzfQ.rTumDmWSKzoiGrarbCRqpVBVVfHo5su4TNagQM6c2Ts
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

AuthorizationBearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjVkN2E1MTRiNWQyYzEyYzc0NDliZTA0NSIsImlhdCI6MTU3MTA1NzkzMywiZXhwIjoxNTczNjQ5OTMzfQ.rTumDmWSKzoiGrarbCRqpVBVVfHo5su4TNagQM6c2Ts
Body
{ "currentPassword": "1234567", "newPassword": "123456" }
Description

Clear token cookie

Headers
KeyValueDescription
AuthorizationBearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjVkN2E1MTRiNWQyYzEyYzc0NDliZTA0NSIsImlhdCI6MTU3MTA1NzkzMywiZXhwIjoxNTczNjQ5OTMzfQ.rTumDmWSKzoiGrarbCRqpVBVVfHo5su4TNagQM6c2Ts

Hackathons 7

Hackathons CRUD functionality

Description

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

Description

Add new hackathon to database. Must be authenticated and must be publisher or admin. Only 1 hackathon allowed per publisher

Headers
KeyValueDescription
Content-Typeapplication/json

JSON Type

AuthorizationBearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjVkN2E1MTRiNWQyYzEyYzc0NDliZTA0NSIsImlhdCI6MTU3MTA1NzkzMywiZXhwIjoxNTczNjQ5OTMzfQ.rTumDmWSKzoiGrarbCRqpVBVVfHo5su4TNagQM6c2Ts
Body
{ "name": "ModernTech Hackathon", "description": "ModernTech 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

Update single hackathon in database

Headers
KeyValueDescription
Content-Typeapplication/json

JSON Type

AuthorizationBearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjVkN2E1MTRiNWQyYzEyYzc0NDliZTA0NSIsImlhdCI6MTU3MTA1NzkzMywiZXhwIjoxNTczNjQ5OTMzfQ.rTumDmWSKzoiGrarbCRqpVBVVfHo5su4TNagQM6c2Ts
Body
{ "careers": ["Web Development", "UI/UX"] }
Description

Delete hackathon from database

Headers
KeyValueDescription
AuthorizationBearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjVkN2E1MTRiNWQyYzEyYzc0NDliZTA0NSIsImlhdCI6MTU3MTA1NzkzMywiZXhwIjoxNTczNjQ5OTMzfQ.rTumDmWSKzoiGrarbCRqpVBVVfHo5su4TNagQM6c2Ts
Description

Get hackathons within a radius of a specific zipcode

Description

Route to upload a hackathon photo

Headers
KeyValueDescription
AuthorizationBearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjVkN2E1MTRiNWQyYzEyYzc0NDliZTA0NSIsImlhdCI6MTU3MTA1NzkzMywiZXhwIjoxNTczNjQ5OTMzfQ.rTumDmWSKzoiGrarbCRqpVBVVfHo5su4TNagQM6c2Ts
Body
KeyValueDescription
file
Autho

Courses 6

Create, read, update and delete courses

Description

Get all courses in database

Description

Create a course for a specific hackathon

Headers
KeyValueDescription
Content-Typeapplication/json

JSON Type

AuthorizationBearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjVkN2E1MTRiNWQyYzEyYzc0NDliZTA0NSIsImlhdCI6MTU3MTA1NzkzMywiZXhwIjoxNTczNjQ5OTMzfQ.rTumDmWSKzoiGrarbCRqpVBVVfHo5su4TNagQM6c2Ts
Body
{ "title": "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": 10000, "minimumSkill": "intermediate", "scholarhipsAvailable": true }
Description

Update course in database

Headers
KeyValueDescription
Content-Typeapplication/json

JSON Type

AuthorizationBearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjVkN2E1MTRiNWQyYzEyYzc0NDliZTA0NSIsImlhdCI6MTU3MTA1NzkzMywiZXhwIjoxNTczNjQ5OTMzfQ.rTumDmWSKzoiGrarbCRqpVBVVfHo5su4TNagQM6c2Ts
Body
{ "tuition": 13000, "minimumSkill": "advanced" }
Description

Remove course from database

Headers
KeyValueDescription
AuthorizationBearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjVkN2E1MTRiNWQyYzEyYzc0NDliZTA0NSIsImlhdCI6MTU3MTA1NzkzMywiZXhwIjoxNTczNjQ5OTMzfQ.rTumDmWSKzoiGrarbCRqpVBVVfHo5su4TNagQM6c2Ts

Reviews 6

Manage course reviews

Description

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

Description

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

Description

Insert review for a specific hackathon

Headers
KeyValueDescription
Content-Typeapplication/json

JSON Type

AuthorizationBearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjVkN2E1MTRiNWQyYzEyYzc0NDliZTA0NSIsImlhdCI6MTU3MTA1NzkzMywiZXhwIjoxNTczNjQ5OTMzfQ.rTumDmWSKzoiGrarbCRqpVBVVfHo5su4TNagQM6c2Ts
Body
{ "title": "Nice Hackathon", "text": "I learned a lot", "rating": 8 }
Description

Update review in database

Headers
KeyValueDescription
Content-Typeapplication/json

JSON Type

AuthorizationBearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjVkN2E1MTRiNWQyYzEyYzc0NDliZTA0NSIsImlhdCI6MTU3MTA1NzkzMywiZXhwIjoxNTczNjQ5OTMzfQ.rTumDmWSKzoiGrarbCRqpVBVVfHo5su4TNagQM6c2Ts
Body
{ "title": "Had Fun" }
Description

Remove review from database

Headers
KeyValueDescription
AuthorizationBearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjVkN2E1MTRiNWQyYzEyYzc0NDliZTA0NSIsImlhdCI6MTU3MTA1NzkzMywiZXhwIjoxNTczNjQ5OTMzfQ.rTumDmWSKzoiGrarbCRqpVBVVfHo5su4TNagQM6c2Ts
Query
KeyValueDescription
Autho

Users 5

CRUD functionality for users only available to admin users

Description

Get all users (admin)

Headers
KeyValueDescription
AuthorizationBearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjVkN2E1MTRiNWQyYzEyYzc0NDliZTA0NSIsImlhdCI6MTU3MTA1NzkzMywiZXhwIjoxNTczNjQ5OTMzfQ.rTumDmWSKzoiGrarbCRqpVBVVfHo5su4TNagQM6c2Ts
Description

get single user by id (admin)

Headers
KeyValueDescription
AuthorizationBearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjVkN2E1MTRiNWQyYzEyYzc0NDliZTA0NSIsImlhdCI6MTU3MTA1NzkzMywiZXhwIjoxNTczNjQ5OTMzfQ.rTumDmWSKzoiGrarbCRqpVBVVfHo5su4TNagQM6c2Ts
Description

Add user to database (admin)

Headers
KeyValueDescription
Content-Typeapplication/json

JSON Type

AuthorizationBearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjVkN2E1MTRiNWQyYzEyYzc0NDliZTA0NSIsImlhdCI6MTU3MTA1NzkzMywiZXhwIjoxNTczNjQ5OTMzfQ.rTumDmWSKzoiGrarbCRqpVBVVfHo5su4TNagQM6c2Ts
Body
{ "name": "Nate Smith", "email": "nate@gmail.com", "password": "123456" }
Description

Update user in database (admin)

Headers
KeyValueDescription
Content-Typeapplication/json

JSON Type

AuthorizationBearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjVkN2E1MTRiNWQyYzEyYzc0NDliZTA0NSIsImlhdCI6MTU3MTA1NzkzMywiZXhwIjoxNTczNjQ5OTMzfQ.rTumDmWSKzoiGrarbCRqpVBVVfHo5su4TNagQM6c2Ts
Body
{ "name": "Nate Johnson" }
Description

Delete user from database (admin)

Headers
KeyValueDescription
AuthorizationBearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjVkN2E1MTRiNWQyYzEyYzc0NDliZTA0NSIsImlhdCI6MTU3MTA1NzkzMywiZXhwIjoxNTczNjQ5OTMzfQ.rTumDmWSKzoiGrarbCRqpVBVVfHo5su4TNagQM6c2Ts
Query
KeyValueDescription
Author