Getting started
From a fresh clone to your first redirect in a few minutes — build the modules, start the server, create a short link, then add the admin UI and durable storage when you need them.
Java JDK 26+
Maven 3.9.9+
Git
Admin API · :9090
Redirect · :8081
The path from clone to first redirect
The whole journey at a glance. Each step has its exact commands further down the page.
- Clone the repository Pull the source and enter the project directory.
- Build all modules Build the four Maven modules in one pass.
- Start the server Launch the server jar — the Admin API on 9090 and public redirects on 8081.
- Create your first short link POST a URL and a custom alias to the Admin API.
- Use the short link Follow the short code and get a 302 redirect to the original URL.
- Vaadin admin UI — optional Deploy the WAR to Jetty 12 for a browser-based administration surface.
- Persistence — optional Switch from in-memory to EclipseStore for durable, restart-surviving storage.
Prerequisites
| Tool | Minimum Version |
|---|---|
| Java JDK | 26+ |
| Maven | 3.9.9+ |
| Git | any recent version |
Build and run
Clone the repository, build the four Maven modules, and start the server.
Clone the repository
git clone https://github.com/svenruppert/url-shortener.git
cd url-shortenerBuild all modules
mvn clean package -DskipTestsThis builds four modules, in order:
urlshortener-core
Domain model & utilities.
urlshortener-server
REST API + redirect server.
urlshortener-client
Java client SDK.
urlshortener-ui
Vaadin WAR.
Start the server
cd urlshortener-server
java -jar target/urlshortener-server-*.jarThe server starts two listeners:
| Endpoint | Port | Purpose |
|---|---|---|
| Admin API | 9090 | Create, manage, export links |
| Redirect | 8081 | Public short-link resolution |
Create your first short link
Create a short link
curl -X POST http://localhost:9090/api/shorten \
-H "Content-Type: application/json" \
-d '{
"originalUrl": "https://github.com/svenruppert/url-shortener",
"alias": "oss-project"
}'Response:
{
"shortCode": "oss-project",
"originalUrl": "https://github.com/svenruppert/url-shortener",
"active": true,
"createdAt": "2025-01-01T12:00:00Z"
}Use the short link
curl -L http://localhost:8081/oss-project
# → 302 redirect to https://github.com/svenruppert/url-shortenerVaadin admin UI
Optional. The Admin API and redirect server already run from the previous steps — the Vaadin UI adds a browser-based administration surface on top.
Deploy the WAR to a Jetty 12 server:
cp urlshortener-ui/target/ROOT-*.war /path/to/jetty/webapps/ROOT.war
cd /path/to/jetty && java -jar start.jarOpen http://localhost:8080 in your browser.
Persistence
Optional. By default, all data is stored in-memory and lost on restart.
To enable persistent storage with EclipseStore, set the system property:
java -Dstorage.mode=eclipsestore \
-Dstorage.path=/var/urlshortener/data \
-jar target/urlshortener-server-*.jar