# Hacking guide ## Required tools - [templ](https://templ.guide/quick-start/installation) - [minify](https://github.com/tdewolff/minify) - [goat](https://github.com/bluesky-social/goat) ## Running shlf To authenticate, you will need OAUTH JWKs to be setup: ```bash 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: ```bash 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: ```bash docker run -d --name shlf-redis -p 6379:6379 redis:latest ``` To run: ```bash SHLF_DEV=true go run cmd/server/main.go ``` If you modified the views, you will need to regenerate them: ```bash go tool templ generate go tool templ fmt ./internal/views/ ``` If you modified the tailwind styles, you will need to regenerate the css: ```bash tailwindcss -i ./input.css -o ./static/files/style.css ``` If you modified the js files, you will need to regenerate the minified versions: ```bash minify static/*.js -o static/files/ ```