A simple and experimental URL shortening service written in Go
Shorter is a lightweight web service that allows you to shorten long URLs using a minimal web interface.
The project was created as an experimental implementation of a URL shortener with support for multiple databases and Redis caching.
- ✅ Shorten URLs via a web interface
- ✅ Cache popular links using Redis
- ✅ Support for two databases: PostgreSQL or MySQL (selected via build tags)
- ✅ Authentication using JWT
- Go (Golang) — primary programming language
- Redis — caching of URLs
- PostgreSQL / MySQL — data storage (chosen at build time)
- JWT — API protection
- HTML/JS — minimal frontend UI
-
Clone the repository:
git clone https://github.com/tamper000/shorter.git cd shorter -
Install dependencies:
go get ./...
-
Create a config file:
cp config.example.yaml config.yaml
-
Open
config.yamland adjust settings to match your environment:- Database settings (MySQL or PostgreSQL)
- Redis configuration
- Server and JWT settings
-
Run the app:
go run cmd/main.go
-
Open in browser:
http://localhost:8080
To run tests:
go test ./...Example config: config.example.yaml.
The project uses a YAML-based configuration file where you can set:
- MySQL or PostgreSQL settings
- Redis parameters
- JWT configuration
- Server port
This project is licensed under the MIT License.