View on GitHub

Course

Open Source course materials from HackerBay University

Task 6 - Relationships

Objectives

App we’re building.

We’re building a website monitoring software. Please read this document for details

Learning Resources

Topic Resource
PostgreSQL Link to this resource
Learning Sequelize Lionk to this resource
Using relationships with ORM Link to this resource
Many to Many Relationships Link to this resource

Database Design

Users

Column Name Type Description
ID - Auto Generated ID
Email Text Email of User
Password Text Password of the User

Websites

Column Name Type Description
ID - Auto Generated ID
Name Text Name of the website you want to monitor
URL Text URL of the website
Status Text Status of the Website - if its Online or Offline
UserID Foreign Key FK to the User Table.

Important

Please use the same Git Repo for all the tasks.

Tasks

Step 1: Adding a website to the database

Request Type: POST
Route: /website/add
Request Body: `{name: <name>, url: <URL>}`
Response Code: 200 
Response Body: `{id: <id>, name: <name>, url: <URL>, userId: <userId>}`

Step 2: List Websites

Request Type: GET
Route: /website/list
Response Code: 200 
Response Body: `[{id: <id>, name: <name>, url: <URL>, userId: <userId>}, {... ..}]`

Deliverable

Push all your changes to your GitHub Repo. Please submit your GitHub Repo to your mentor as soon as you’re done, so he or she can review.