Skip to content

n2o/url-shortener

Repository files navigation

Shorty — The URL Shortener

GitHub Container Registry

A simple URL shortener written in Java. Create shortened links, store them in Redis, and redirect visitors to the original URLs.

Shorty

Only authenticated admins can create or delete short links.

Installation

Note

You need JDK 25+ and Gradle 8.14+ to build this project.

A running Redis instance is required. Start one with:

docker run -p 6379:6379 redis:alpine

Then start the application:

./gradlew bootRun

Usage

Open http://localhost:8080 and log in as an admin. The default credentials are defined in application.properties.

In the admin menu you can add new short links. Redirect to the original URL by visiting:

http://localhost:8080/<your-short-link>

Docker

We automatically build a Docker image for Shorty.

docker pull ghcr.io/n2o/url-shortener:latest

Browse available versions on the GitHub Container Registry.

Deployment

Tip

Copy skeleton.env to production.env and adjust the values before starting.

Use Docker Compose for a production setup:

docker compose up

This starts a Redis server with persistent storage and exposes the application on port 8080.

Contributing

About

Shorty: The URL Shortener

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors