Skip to content
This repository has been archived by the owner on Dec 16, 2023. It is now read-only.

Make and measure your NHL playoff predictions.

License

Notifications You must be signed in to change notification settings

devkevbot/hockey-bracket-challenge

Repository files navigation

This project is now archived, thanks for playing!

A small project used to record my predictions for the 2023 NHL Playoffs.

image


User Guide

Making predictions

  1. Visit https://hockey-bracket-challenge.vercel.app/
  2. Click "Sign in" and sign in with your Discord account
  3. For each available series, select your prediction

Prediction outcomes

Your "score" is based on how correct you were; maximum points are earned for guessing both the correct series winner and the correct series length in games.

The breakdown is as follows:

  • Correct with bonus Both the series winner and series length is correct.
  • Correct Only the series winner is correct.
  • Incorrect The series winner is incorrect.

Developer Guide (so I don't forget in 6 months)

Deployment

  • This project is hosted on Vercel
  • Any changes to the master branch automatically trigger a deployment from Vercel

Local setup

  1. If cloning this as a fresh project, pull in the environment variables (requires Vercel link/authorization) to your local .env file
npm run env-pull

# Delete any VERCEL_* variables that get pulled in, they aren't needed and WILL break local dev
  1. Install the PlanetScale CLI

  2. Initialize the DB proxy to Prisma via PlanetScale

npm run db-proxy
  1. In a new terminal, seed the database
npm run db-seed
  1. Start the application
npm run dev
  1. Go to the localhost link that was output to the console

  2. (Optional) In a new terminal, view the database using Prisma studio

npm run db-studio

Making database schema changes

  1. Ensure the database proxy is running
npm run db-proxy
  1. Push local schema changes to the PlanetScale dev branch
npm run db-push
  1. Regenerate Prisma client types (must do after every schema change)
npm run db-generate
  1. Restart TypeScript server
  • Use your IDE or language server commands to do this. In VS Code, open a TypeScript or TSX file, then: CTRL+SHIFT+P > TypeScript: Restart TS Server
  1. Once confident, make a database deploy request using the command below, then merge dev into the PlanetScale main branch
npm run db-deploy-request