Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

linked

A fast link shortener built with Go, Echo, SQLite, and Alpine.js.

Screenshots

Shot_2026-01-12_10 16 09@2x Shot_2026-01-12_10 17 19@2x

Quick Start

Prerequisites

  • Go 1.25.4+
  • (Optional) Docker & Docker Compose

Run Locally

go mod download
go run main.go

Access dashboard at http://localhost:8080/dashboard (default: admin:admin)

Run with Docker

docker-compose up

API

Create a link:

curl --user admin:admin -X POST http://localhost:8080/api/links \
  -H "Content-Type: application/json" \
  -d '{"url": "https://example.com/long/url", "slug": "my-link"}'

List links:

curl --user admin:admin http://localhost:8080/api/links

Redirect:

curl -L http://localhost:8080/my-link

Health check:

curl http://localhost:8080/health

Configuration

Environment variables:

  • PORT - Server port (default: 8080)
  • DB_PATH - SQLite database path (default: linked.db)
  • ADMIN_CREDENTIALS - Admin credentials username:password (default: admin:admin)
  • LOG_LEVEL - debug, info, warn, error (default: info)

Generate Secure Credentials

Generate a secure random password:

python -c "import secrets; print(f'admin:{secrets.token_hex(16)}')"

Use with curl:

curl --user admin:your_secure_password http://localhost:8080/api/links

Or set as environment variable:

export ADMIN_CREDENTIALS=$(python -c "import secrets; print(f'admin:{secrets.token_hex(16)}')")

License

MIT

About

A minimal link shortener

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages