Week 7, Assessment #8 - Build a Minimal API Project

Languages

Frameworks

Libraries/Tools

Primary Goals

This assessment will check for proficiency in: NodeJS, ExpressJS, data modeling, .env secrets, SQL, relational databases, and CRUD.

(We will cover Database Migrations, API testing, and REST in future assessments.)

Overview

In this project, you will build a minimal Express API to demonstrate your understanding of backend technologies.

Context

Basic Requirements

What is this project checking for?

  1. Understanding of CRUD
  2. Create a new table (using a database migration)
  3. Connect a db to your project using .env variables
  4. Create a get route to fetch all your table data
  5. Create a get route to fetch part of your data
  6. Create put, post, and delete routes
  7. Draw 2 data models and include them in the project README.md
  8. Build functionality that makes use of a relational database
  9. Experience changing database technologies with the help of an ORM

Project Instructions

Part 0 - Starter Code

nvm install 8.13.0
which node
node -v

Part 1 - Swap out the database for Postgres

We won’t be modifying app code (for the most part) in this section.

Data Models

articles

column name data type
id INTEGER
title STRING

…and so on.

SQL

Use the psql command-line program to:

Sequelize

.env

Postman

Use Postman to hit each of your API’s endpoints that perform CRUD operations.

Use Postman to get all articles.

PAUSE: Take a lunch break, and then move onto part 2.

Part 2 - Relational Database & more CRUD Operations

In this stage, we will augment our project by adding comments. Don’t worry about users yet! Let’s say that articles and comments have a one-to-many relationship.

The comment should store some text.

Data Models/Relational Databases

Sequelize

SQL, with JOIN queries this time

Using the psql command-line program, use SQL to:

NodeJS & ExpressJS

You do not need to make HTML or PUG templates for any of these new actions. Just use Postman to test them.

Postman

Use Postman to manually test your API.

Part 3 - Turn in your project

Extensions

If you’ve met all the criteria, here are some ways you can continue!