Tether is a production-ready short URL service built on the Helix framework, demonstrating clean architecture and industry best practices.
- 🔗 Short URL Generation: Create short URLs with custom codes or auto-generated ones
- ⏰ TTL Support: Set expiration times with default 1-month TTL (720 hours)
- 📊 Comprehensive Analytics: Device, browser, geolocation, and referrer tracking
- 🔒 Security: CORS, rate limiting, domain blocking, input validation
- ⚡ Performance: Redis caching, MongoDB TTL indexes, optimized queries
- 🧹 Auto Cleanup: Background cleanup of expired links with configurable retention
- 🐳 Production Ready: Docker setup, health checks, graceful shutdown
Ensure you have the following installed:
- Go: v1.25 or later
- Docker & Docker Compose: For database services
- Make: For development commands
-
Clone and setup:
git clone https://github.com/Kosha-Nirman/tether.git cd tether cp .env.example .env -
Start all services:
docker-compose up -d
-
Run Tether:
make dev # Development with hot reload # or make run # Production build
-
Verify installation:
curl http://localhost:5000/health
-
Access API Documentation:
# Swagger UI open http://localhost:5000/docs/index.html # JSON API spec curl http://localhost:5000/docs/swagger.json
Create a short link:
curl -X POST http://localhost:5000/api/links \
-H "Content-Type: application/json" \
-d '{
"original_url": "https://example.com",
"custom_code": "my-link",
"ttl_hours": 720
}'Access short link:
curl -L http://localhost:5000/abc123View analytics:
curl http://localhost:5000/api/links/abc123/statsTether includes comprehensive Swagger/OpenAPI documentation:
- Interactive UI: Visit
http://localhost:5000/docs/for the Swagger UI - JSON Spec: Available at
http://localhost:5000/docs/swagger.json - YAML Spec: Available at
http://localhost:5000/docs/swagger.yaml
Generate updated docs:
make swagger # Regenerate Swagger docs from code annotationsThis project is licensed under the MIT License. See the LICENSE file for details.
- Inspired by Go best practices and clean architecture principles
- Built for developers who value maintainable and scalable code
- Named Tether for its spiral structure that represents growth and evolution
- Made with ❤️ to accelerate Go development and reduce boilerplate