A URL shortener written in Go, Truso LibSQL db and HTMX. As this project is deployed on Railway, the initial request can take upto 3-4 seconds, have patience :)
The hash value generated for shortened URLs are calculated as:
Base62_Encoding(number of nanoseconds elapsed since Jan 1, 1970 UTC % a predefined SALT value)
Install Dependencies
go install github.com/a-h/templ/cmd/templ@latest
go install github.com/cosmtrek/air@latest
Build Templates
templ generate
Build Application
go build -o main cmd/api/main.go
Hot Reload
air
.env
PORT=42069
APP_ENV=local
SALT=
DB_URL=libsql://dbname-username.turso.io?authToken=
For Turso auth token and CLI, visit Turso Docs.