Monolithic project that works as a URL shortener, developed with Java and Spring Boot.
Allows shortening long URLs with automatic expiration and redirection to the original URL.
The application is built on the Spring Boot ecosystem, using JPA for persistence, validation, and a REST architecture to expose services.
PostgreSQL is used as the database to store URLs and manage their expiration, with migrations handled by Flyway.
Docker images are built using Google JIB, removing the need for a Dockerfile.
A scheduled job runs daily at 12 PM to check and clean expired URLs automatically.
| Category | Technology |
|---|---|
| Language | Java 21 |
| Frameworks | Spring (JPA, Validation, Web, DevTools) |
| Database | PostgreSQL |
| Migrations | Flyway |
| Containerization | Docker, Google JIB |
POST /shortenReceives a JSON body with the field "url" and returns the shortened link.
GET /{code} Redirects to the original URL associated with the short code.
URL shortening with automatic expiration (default set in months).
Scheduled daily job to check and remove expired URLs.
-
Clone the repository:
git clone https://github.com/syxbruno/url-shortener.git cd authentication-project -
Build the Docker image of the API:
mvn compile jib:dockerBuild
-
Start the containers:
docker-compose up