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
Hacking guide#
Required tools#
Running shlf#
To authenticate, you will need OAUTH JWKs to be setup:
export SHLF_OAUTH_CLIENT_KID="$(date +%s)"
export SHLF_OAUTH_CLIENT_SECRET="$(goat key generate -t P-256 | grep -A1 "Secret Key" | tail -n1 | awk '{print $1}')"
You will need to fetch a series of static assets shlf depends on:
mkdir -p ./static/files
# HTMX
curl -sLo ./static/files/htmx.min.js https://cdn.jsdelivr.net/npm/htmx.org@2.0.6/dist/htmx.min.js
# Lucide (icons)
curl -sLo ./static/files/lucide.min.js https://unpkg.com/lucide@0.525.0/dist/umd/lucide.min.js
# AlpineJS
curl -sLo ./static/files/alpinejs.min.js https://cdn.jsdelivr.net/npm/alpinejs@3.x.x/dist/cdn.min.js
You will need to start a redis instance - using docker can simplify this process greatly:
docker run -d --name shlf-redis -p 6379:6379 redis:latest
To run:
SHLF_DEV=true go run cmd/server/main.go
If you modified the views, you will need to regenerate them:
go tool templ generate
go tool templ fmt ./internal/views/
If you modified the tailwind styles, you will need to regenerate the css:
tailwindcss -i ./input.css -o ./static/files/style.css
If you modified the js files, you will need to regenerate the minified versions:
minify static/*.js -o static/files/