Titly is a high-performance URL shortener built with Go, Redis, SQLite, and SvelteKit.
- Fast URL shortening and redirection
- Redis caching for low-latency lookups
- SQLite persistence
- Concurrent request handling using Go
- Returns an existing short URL when the same long URL is submitted
- Docker Compose setup for running the complete application
Titly consists of three main components:
- Client — SvelteKit frontend
- Server — Go REST API
- Redis — Cache for short URL mappings
The server checks Redis first when resolving a short URL. On a cache miss, it falls back to SQLite and caches the mapping in Redis for 24 hours.
- Backend: Go
- Frontend: SvelteKit
- Database: SQLite
- Cache: Redis
- Containerization: Docker & Docker Compose
The server exposes the following endpoints:
| Method | Endpoint | Description |
|---|---|---|
GET |
/ |
Returns a welcome message |
POST |
/create-short-url |
Creates or retrieves a short URL |
GET |
/:short-url |
Redirects to the original URL |
See the Server API Documentation for request and response details.
Start the complete application using Docker Compose:
docker compose up --buildThe services are available at:
- Client:
http://localhost:4173 - Server:
http://localhost:4000 - Redis:
localhost:6379
To stop the application:
docker compose downtitly/
├── client/ # SvelteKit frontend
├── server/ # Go backend and API
├── docker-compose.yml
└── README.md
This project is available under the repository's license.
