Tiny URL shortener with click-tracking
  • Go 56.4%
  • CSS 23.4%
  • HTML 16.6%
  • JavaScript 2.7%
  • Dockerfile 0.9%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Kamil Marut 31b3f581db
All checks were successful
Build / Quality (push) Successful in 1m17s
Build / Tests (push) Successful in 1m0s
Build / Docker (push) Successful in 2m6s
web: Fix functional defects in the frontend and add copy button
2026-07-20 19:02:57 +02:00
.forgejo/workflows docker: Fix Docker network build error 2026-07-20 11:57:50 +02:00
cmd/turls cmd: Common entrypoint to allow for user creation in Dockerfile 2026-07-20 17:48:43 +02:00
internal web: Fix functional defects in the frontend and add copy button 2026-07-20 19:02:57 +02:00
.gitignore Create first version 2026-07-19 15:54:42 +02:00
CLAUDE.md web: Fix functional defects in the frontend and add copy button 2026-07-20 19:02:57 +02:00
DESIGN.md web: Fix functional defects in the frontend and add copy button 2026-07-20 19:02:57 +02:00
docker-compose.yml docker: Add docker-compose.yml 2026-07-20 17:42:22 +02:00
Dockerfile cmd: Common entrypoint to allow for user creation in Dockerfile 2026-07-20 17:48:43 +02:00
go.mod dashboard: Improve link deletion layout 2026-07-19 17:29:59 +02:00
go.sum dashboard: Improve link deletion layout 2026-07-19 17:29:59 +02:00
LICENSE Initial commit 2026-07-19 12:38:13 +02:00
PRODUCT.md web: Fix functional defects in the frontend and add copy button 2026-07-20 19:02:57 +02:00
README.md cmd: Common entrypoint to allow for user creation in Dockerfile 2026-07-20 17:48:43 +02:00
sqlc.yaml project: Code cleanup 2026-07-19 20:00:03 +02:00

turls

A tiny URL shortener built in Go with the standard library net/http and html/template, SQLite storage via sqlc + modernc.org/sqlite (pure Go, no cgo), and bcrypt password hashing.

Anyone can shorten a link (1h/6h/12h/24h, or forever if signed in). Signed-in users get a dashboard listing their own links with click counts and delete.

Run

go run ./cmd/turls runserver

Serves on http://localhost:8080. Data lives in url_shortener.db (SQLite, created automatically).

Create a user

There is no registration and accounts are created with a local script that prompts for user credentials.

go run ./cmd/turls createuser

Test

go test ./...

Regenerate sqlc code

After editing internal/db/schema.sql or internal/db/query.sql:

sqlc generate