CatMash
What is this?
Have you ever wanted to rank 11,000 cat pictures by cuteness? Of course you have. That's what we're doing here.
This is an app bootstrapped according to the init.tips stack, also known as the T3-Stack. Other than answering one of life's biggest questions, the main point of building this was to create a small project using full-stack Next.JS with tRPC.
Installation
Install dependencies
yarn
Create a Postgres database. You can use a local database for dev. For deployment, the free tier of Amazon RDS should be able to run the site for free indefinitely as long as it doesn't miraculously become incredibly popular.
Register an API Key with TheCatApi.
Create a .env
file, based on .env-example
.
Create the database schema
yarn prisma migrate dev
Run the database population script. You might need to temporarily change the module
to common-js
in tsconfig.json
for the script to work.
yarn populatedb
Start the development server
yarn dev
Deployment
As this app is built in full-stack Next.JS, the easiest way to deploy it is on Vercel. Create an app on Vercel, point it at a repo, set environment variables, and you should be good to go. If you're using a different database than you did before, you will need to create the schema and populate the database again, see above.