Skip to content

fac22/week2-MCD-eBargain

Repository files navigation

Week 02 - Database Project

eBargain

🧱 Features

  • Post products for the world to see and buy
  • Uses three SQL tables and refrences them when posting a product
  • Pre-registered users only
  • Different colours for different categorys

📝 User Stories

Core

  • As an opinionated person, I want to: post my thoughts so others can read them
  • As a bored person, I want to: read what other people have posted

Stretch

  • As a user, I want to: submit information to your site for anyone to see
  • As a user, I want to: come back to your site later and see what I posted is still there

Acceptance Criteria ✅

  • A form for users to submit data
  • A page showing all the data
  • Semantic form elements with correctly associated labels
  • A Postgres database hosted on Heroku
  • A schema describing your database in your README
  • Tests for server routes and database access
  • Not process user input as SQL commands
  • Hidden environment variables (i.e. not on GitHub)

Stretch criteria 🚂

  • A way to view filtered/sorted data, instead of just all of it
  • GitHub Actions CI setup to run your tests when you push

Database Schema

📚 What we learnt

  • How to create a database with PostgreSQL
  • How to automate database creation with shell scripts
  • How to use Promise.all() to collect multiple promises
  • How to store variables outside of a SQL statement
  • How to modularise functions for use in other files

🧪 Testing

  • Cypress test if items appear on page
  • Cypress test to add new items
  • Cypress reset state between each test

⏳ Future improvements

  • Modularise all code
  • Sign-up and Login
  • Buy button
  • Delete button
  • No time button
  • No user registration
  • CI Testing on GitHub

👀 Screenshots