A high-performance URL shortening service built using Java, Spring Boot, and MySQL.
Spring-Shortener is a scalable RESTful URL shortening service that converts long URLs into compact short links using custom Base62 encoding.
The application follows a clean layered architecture and is optimized for fast URL redirection performance.
- 🔗 URL shortening service
- ⚡ Fast URL redirection
- 🧠 Custom Base62 short-code generation
- 🗂 Indexed database lookups
- 🏗 Layered architecture
- 🌐 RESTful APIs
- 📦 MySQL persistence
- Java
- Spring Boot
- MySQL
- Maven
- Postman
The project follows a clean layered architecture:
Controller → Service → Repository → Database
- Handles HTTP requests and responses
- Contains business logic and URL processing
- Manages database interaction using JPA
- Stores URL mappings and metadata
- Indexed database lookups for faster URL redirection
- Custom Base62 encoding for compact unique IDs
- Efficient request handling with Spring Boot
git clone https://github.com/Prasadzoman/url-shortener-java.git
cd url-shortener-javaUpdate application.properties
spring.datasource.url=jdbc:mysql://localhost:3306/url_shortener
spring.datasource.username=root
spring.datasource.password=your_password
spring.jpa.hibernate.ddl-auto=update
spring.jpa.show-sql=truemvn clean installmvn spring-boot:runor
./mvnw spring-boot:runPOST /api/url/shorten{
"url": "https://example.com"
}{
"shortUrl": "http://localhost:8080/abc123"
}GET /{shortCode}src
┣ 📂 controller
┣ 📂 service
┣ 📂 repository
┣ 📂 model
┣ 📂 dto
┗ 📂 config
- 📊 Analytics dashboard
- ⚡ Redis caching
- ⏳ Expiration-based links
- 🔒 Rate limiting
- 📱 QR code generation
- 👤 User authentication
⭐ If you found this project useful, consider giving it a star!