A full-stack URL shortening service built with Java Spring Boot. This project demonstrates backend development skills including REST API design, database management, and cloud deployment.
API Base URL: https://shortlink-nmca.onrender.com
- βοΈ Shorten long URLs to 6-character codes
- π Automatic redirect from short links to original URLs
- π Click tracking and analytics
- β URL validation
- ποΈ PostgreSQL database for persistent storage
Backend:
- Java 21
- Spring Boot 3.4.x
- Spring Data JPA
- PostgreSQL
- Maven
- Lombok
Deployment:
- Docker
- Render (PostgreSQL + Web Service)
POST /api/shorten
Content-Type: application/json
{
"url": "https://example.com"
}
Response:
{
"id": 1,
"originalUrl": "https://example.com",
"shortCode": "aB3xY9",
"shortUrl": "https://your-app.onrender.com/aB3xY9",
"createdAt": "2025-11-27T10:30:00",
"clickCount": 0
}
Redirect to Original URL
GET /{shortCode}
Redirects to the original URL and increments click count.
Get URL Statistics
GET /api/stats/{shortCode}
Returns analytics including click count and creation date.
π Running Locally
Prerequisites
- Java 21
- Maven
π License
MIT License - feel free to use this project for learning!