Web app to rate pictures of fish.
create-sql.py
reads in folders of images to rate, and generatesINSERT
statements for the database to track their ratings. It also moves images into_site
and shards them based on file name.recreate-tables.sh
drops and recreates production databases, and runs theINSERT
statements generated in the previous step.deploy.sh
reads a Neocities API key from.api-key
and pushes the_site
folder to that Neocities site, and also deploys the Cloudflare Worker usingwrangler
. By default it will only upload files in the root of_site
, excluding the sharded images. Uncomment the appropriate line in the script to do a full push.
Generally you only need to update index.html
and index.js
(front end); or src/index.ts
(back end). When updating these files simply run deploy.sh
.
Edit these in src/index.ts
/api/all
- GET - returns all ratings/api/next
- GET - returns a random unrated image./api/rate/:basename
- POST - record a rating forbasename
image. Payload must includerater
(string) andrating
(0, 1) values.
Run download.sh
.