Project Specification

Comments

Setup your environment variables

The API uses a .env it expects the following, below an example:

POSTGRES_HOST=127.0.0.1
POSTGRES_DB=shopping
POSTGRES_DB_TEST=shopping_test
POSTGRES_USER=shopping_user
POSTGRES_PASSWORD=password123
ENV=dev
BCRYPT_PASSWORD=this-is-not-a-test
SALT_ROUNDS=10
TOKEN_SECRET=iesu-serviam2021

Ports

Postgres runs in port 5432 however you can specify one.

The API server runs in port 3000.

Install all packages needed

In your terminal run:

npm i

Build a Storefront Backend

README & Requirements Documentation

  • Create a README.md file containing project setup instructions.
    • A reviewer must be able to follow the steps listed in the README.md to start the project. It should contain the following:
      • how to setup and connect to the database
      • what ports the backend and database are running on
      • package installation instructions
  • Update the REQUIREMENTS.md with API route information
    • The REQUIREMENTS.md must show the following:
      • correct RESTful routes for the required endpoints.
      • each RESTful route should be associated with the correct HTTP verb.
  • Update the REQUIREMENTS.md with a database schema.
    • The REQUIREMENTS.md must include a database schema that has tables and columns that address the API endpoints and data shapes given in the REQUIREMENTS.md including column types.

Database

  • Create a database and connect to it.
  • Design a basic relational database through tables, columns, and simple relationships between tables.
  • Write well formed and correct SQL queries to select, update, delete, and where information.
  • Update a database to demonstrate usage/application of migrations.
  • Secure important information by adding salt to user passwords.

Node/Express

  • Create CRUD endpoints for models in the application.
  • Crafting model files that aptly translate their database tables into useful entities in the Node application.
  • Evaluate and apply the best JavaScript and TypeScript code to achieve the desired functionality of their application.
  • Secure database access info with environment variables.

Authentication & Testing

  • Write a test suite for the endpoints in the API.
  • Set up JWT tokens in your API using modern authentication methods.
  • Write unit tests for the database actions in the application