- This is a URL Shortener system similar to Bitly. It allows users to generate short URLs from long ones and track analytics such as click counts and access details.
- 👨💻 Author: Hop Do Quang (GitHub | Website)
- Status:
updating
- Backend: Java Spring Boot
- Database: MySQL
- Cache: Redis (for quick lookups)
- Authentication: JWT (for user authentication)
- Message Queue: Kafka (for handling analytics and logging)
- Deployment:
- Container: Docker
- CI/CD: GitHub Actions
- Cloud Server: Deployed on a Cloud Server
- ✅ Generate short URLs from long URLs
- ✅ Redirect short URLs to the original long URLs
- ✅ Track analytics (click count, location, user agent, etc.)
- ✅ User authentication (register, login, manage links)
- ✅ Custom short links (user-defined slugs)
- ✅ Expiry for short links
All contributions are welcome! Please feel free to fork the repository and submit pull requests. Thank you so much! 🫶
POST /api/shortener/create
Request Body:
{
"originalUrl": "https://example.com/some-long-url"
}
Response:
{
"shortUrl": "http://localhost:8080/abc123"
}
GET /{shortUrl}
Example:
GET http://localhost:8080/abc123
Redirects to https://example.com/some-long-url
GET /api/analytics/{shortUrl}
Response:
{
"clicks": 120,
"created_at": "2025-02-07",
"last_accessed": "2025-02-07T12:45:00Z"
}
To deploy using Docker:
docker build -t url-shortener .
docker run -p 8080:8080 url-shortener