Practical introduction to relational databases

Initial setup / workshop goals

The repository you all have cloned already is a pseudo ecommerce store. It helps visualize some of the concepts about databases, so you'll not only learn how to do different things, but also how they're useful in a practical way.

Essentially it's an idea of a business to business ecommerce store:

  • there are products
  • addresses for shipping and billing that belong to the users
  • cart
  • orders (if there's time)
  • fake payments against orders (if there's time)

These will help us think about how they relate to each other, what data we should be storing about them, what data we need to store about them to enable relations, how to grab connected data out from the database in one go, what are the considerations when we have a TON of data, and most importantly, how to do it anyways.

Actual requirements

  • You should have a github account
  • You should have a supabase account - top right corner "Start your project", and log in with your Github
  • Within supabase, once you're in, create a new project. Name it anything you'd like, create a strong database password and save it in a password manager or somewhere you won't forget, and pick a region. It does not matter which region you choose for what we're going to be doing.
  • Make a note of your project anon/public key and your project url. We'll need both of these shortly.
  • Have nodejs and npm/yarn installed locally. This is needed to compile / generate / serve the scaffolding code. I'm on a mac, I use nvm (https://github.com/nvm-sh/nvm) to manage my node stuff. There are a bunch of different ways to install it, the canonical one is through their official site: https://nodejs.org/en/.
  • You should have a clone of this repository: https://github.com/javorszky/jamstack-workshop-db-2021
  • In the directory, rename the .env.example file, and replace the example values with the supabase project anon key and project url from step 4. If you need to find them again, it's in Settings (cog icon on the left edge of the site), and API menu item in the settings page.
  • Run npm install to pull all dependencies.