Answering all of life's toughest questions
Why not. I streamed most of the creation of this project if you're curious. Regardless of how you feel about the idea, I think the technical details of this implementation are worth learning from.
Prerequisite:
- MySQL local database (or Planetscale connection using PScale CLI)
- npm
Setup
- Clone repo
npm install
- Create
.env
file if one does not already exist - Add connection URLs for both database and shadow db to .env (example .env file here)
- Initialize database -
npx prisma migrate dev
- Initialize base data set -
npm run ts-node ./scripts/fill-db.ts
- Run dev server
npm run dev
- Use next/image to handle image caching and better rendering
- Persist data fetched from PokemonAPI
- Create the results page with counting/sorting
- Better loading state between votes