Discover books, shows, and movies at your level. Track your progress by filling your Shelf with what you find, and share with other language learners. *No dusting required. shlf.space
1# Hacking guide 2 3## Required tools 4- [templ](https://templ.guide/quick-start/installation) 5- [minify](https://github.com/tdewolff/minify) 6- [goat](https://github.com/bluesky-social/goat) 7 8## Running shelf 9 10To authenticate, you will need OAUTH JWKs to be setup: 11```bash 12export SHELF_OAUTH_CLIENT_KID="$(date +%s)" 13export SHELF_OAUTH_CLIENT_SECRET="$(goat key generate -t P-256 | grep -A1 "Secret Key" | tail -n1 | awk '{print $1}')" 14``` 15 16You will need to fetch a series of static assets shelf depends on: 17```bash 18mkdir -p ./static/files 19 20# HTMX 21curl -sLo ./static/files/htmx.min.js https://cdn.jsdelivr.net/npm/htmx.org@2.0.6/dist/htmx.min.js 22# Lucide (icons) 23curl -sLo ./static/files/lucide.min.js https://unpkg.com/lucide@0.525.0/dist/umd/lucide.min.js 24# AlpineJS 25curl -sLo ./static/files/alpinejs.min.js https://cdn.jsdelivr.net/npm/alpinejs@3.x.x/dist/cdn.min.js 26``` 27 28To run: 29```bash 30SHELF_DEV=true go run cmd/server/main.go 31``` 32 33If you modified the views, you will need to regenerate them: 34```bash 35go tool templ generate 36go tool templ fmt ./internal/views/ 37``` 38 39If you modified the tailwind styles, you will need to regenerate the css: 40```bash 41tailwindcss -i ./input.css -o ./static/files/style.css 42``` 43 44If you modified the js files, you will need to regenerate the minified versions: 45```bash 46minify static/*.js -o static/files/ 47``` 48