URL Shortener
2026-09
Tech Stack
For the frontend, I used simple HTML, CSS, and JavaScript, served directly by Go’s http.FileServer.
The backend is built with Go’s net/http package, with go-sqlite3 for the database. Everything runs inside a simple Docker container.

Database
The data is stored in a SQLite database. Each link contains the target URL, its short code, the number of visits, and the creation date:
| id | target_url | url | visits | created_at |
|---|---|---|---|---|
| 1 | https://example.com | a2iD | 0 | 2026-09-18T08:30:42.872838+02:00 |
| 2 | https://imbouttu.buzz | nS32 | 1 | 2026-09-18T10:30:14.225158+02:00 |
API
The API provides routes for fetching link statistics and all stored links.
For example:
http.HandleFunc("GET /link/stats/{url}", api.Stats)
http.HandleFunc("GET /links/all/", api.All) These endpoints return the requested data as JSON. For example:
{
"Id": 1,
"Target_url": "https://example.com",
"Url": "a2iD",
"Visits": 0,
"Created_at": "2026-09-18T08:30:42.872838+02:00"
}