docs
Getting Started
Build and run the URL Shortener in minutes.
Prerequisites
| Tool | Minimum Version |
|---|---|
| Java JDK | 26+ |
| Maven | 3.9.9+ |
| Git | any recent version |
1. Clone the Repository
git clone https://github.com/svenruppert/url-shortener.git
cd url-shortener
2. Build All Modules
mvn clean package -DskipTests
This builds four modules in order:
urlshortener-core— domain model & utilitiesurlshortener-server— REST API + redirect serverurlshortener-client— Java client SDKurlshortener-ui— Vaadin Flow WAR
3. Start the Server
cd urlshortener-server
java -jar target/urlshortener-server-*.jar
The server starts two listeners:
| Endpoint | Port | Purpose |
|---|---|---|
| Admin API | 9090 |
Create, manage, export links |
| Redirect | 8081 |
Public short-link resolution |
4. Create Your First 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"
}
5. Use the Short Link
curl -L http://localhost:8081/oss-project
# → 302 redirect to https://github.com/svenruppert/url-shortener
6. Launch the Vaadin UI (optional)
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.jar
Open 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
Next Steps
- Architecture Overview — understand the 4-module design
- API Reference — full endpoint documentation
- Configuration — ports, storage, and tuning