UrlShortener is a Spring Boot application that provides URL shortening and resolution services.
216
UrlShortener is a Spring Boot REST API application that provides URL shortening and resolution services. It accepts long URLs, generates unique short codes, and allows clients to retrieve original URLs from their corresponding short codes. The application uses MySQL for persistent storage and is containerized for deployment via Docker.
STACK
Language(s): Java 21
Framework / runtime: Spring Boot 4.1,
Spring Web MVC
Notable libraries: Spring Data JPA, MySQL Connector/J,
Lombok, Maven 3.9.6
CODE src/main/java/com/mcmanuel/UrlShortener/ controller/ REST endpoints for URL operations service/ Business logic for shortening and resolution entity/ JPA-mapped UrlEntity domain model exception/ Custom exception handling repository/ Spring Data JPA repository interface UrlShortenerApplication.java Spring Boot entry point
Dockerfile Multi-stage build: Maven compile → Alpine JRE runtime docker-compose.yaml MySQL 5.7 service with persistent volume pom.xml Maven build configuration (Java 21, Spring Boot 4.1)
HOW TO RUN IT
LOCAL DEVELOPMENT
docker-compose up -d
./mvnw clean package ./mvnw spring-boot:run
DOCKER DEVELOPMENT
docker build -t url-shortener:latest . docker push /url-shortener:latest
The application listens on port 8080. MySQL runs on port 3306 with credentials:
User: root Password: url Database: urlDb
Content type
Image
Digest
sha256:251934e38…
Size
115.7 MB
Last updated
about 1 month ago
docker pull mcmanuel295/url-shortener