A minimal, high-performance, self-hosted URL shortener built with Go. It features a modern brutalist web interface and a simple RESTful API.
- Lightning Fast: Built with Go and Gin for high performance.
- Brutalist UI: Simple, clean, and functional web interface.
- REST API: Easy to integrate with other tools and services.
- SQLite Backend: Lightweight data persistence with WAL mode enabled.
- Analytics: Basic click tracking for your shortened URLs.
- Self-Hosted: Designed to be easily deployed on your own infrastructure.
- Backend: Go (Gin Gonic)
- Database: SQLite
- Frontend: HTML, CSS, JavaScript (Vanilla)
- Task Runner: Just
- Live Reload: Air
-
Clone the repository:
git clone https://github.com/ppablomunoz/GoShort.git cd GoShort -
Install dependencies:
go mod tidy
-
Run the application:
just run # or go run cmd/main.go
You can also run the application using Docker Compose:
docker-compose up -dThe server will start at http://localhost:8000.
Since the application uses SQLite, creating a backup is as simple as copying the database file.
Backup from container to host:
docker cp goshort-app:/root/db/GoShort.db ./backup.dbNote: If you are using the default docker-compose.yml, your database is already persisted in the ./db folder on your host machine.
| Method | Endpoint | Description |
|---|---|---|
POST |
/api/url |
Create a new short URL |
GET |
/api/url |
List all shortened URLs |
PUT |
/api/url/:code |
Update a short URL |
DELETE |
/api/url/:code |
Delete a short URL |
GET |
/:code |
Redirect to original URL |
For development with live reloading:
just airMIT License. See LICENSE for more information.
