Why have long URLs when you can have short ones? We snort 'em down to size! Because nobody has time for 47-character URLs when 8 will do.
| Feature | Description |
|---|---|
| β‘ Snort Speed | Faster than a pig finding truffles. URL snorting in milliseconds! |
| π― Custom Snorts | Name your links whatever you want. Go wild! Be creative! Snort responsibly. |
| π Snort Analytics | See how many times your link got snorted. Yes, we count every single snort. |
| π± QR Snorts | Auto-magical QR codes! Point, scan, snort. It's that easy. |
| π Secure Snorting | Your URLs are safe with us. We take our snorting very seriously. |
| π¨ Pretty Snorts | Because if you're gonna snort URLs, they better look fabulous doing it. |
- JDK 21 - Because we're fancy like that
- PostgreSQL - For storing all your glorious snorts (or use Docker Compose)
- Maven - The wrapper is included, you're welcome
Start the application with live reload (snort reloading?):
./mvnw quarkus:devBoom! π₯ Your snortener is now running at:
- π Homepage: http://localhost:8080 - The fabulous landing page
- π Admin Panel: http://localhost:8080/admin - Where the magic happens (default:
admin/admin) - π οΈ Dev UI: http://localhost:8080/q/dev/ - For the curious minds
- π API Docs: http://localhost:8080/swagger-ui - Because documentation matters
Pro tip: Don't use the default admin/admin credentials in production. That's just asking for trouble. π
Set your admin credentials via environment variables:
export ADMIN_USERNAME=your-username
export ADMIN_PASSWORD=super-secret-passwordOr configure in application.properties:
sn0rt.admin.username=your-username
sn0rt.admin.password=super-secret-password
sn0rt.base-url=https://your-domain.com./mvnw package
docker build -f src/main/docker/Dockerfile.jvm -t sn0rt:latest .docker run -p 8080:8080 \
-e ADMIN_USERNAME=admin \
-e ADMIN_PASSWORD=secure-password \
-e QUARKUS_DATASOURCE_JDBC_URL=jdbc:postgresql://host.docker.internal:5432/sn0rt \
-e QUARKUS_DATASOURCE_USERNAME=postgres \
-e QUARKUS_DATASOURCE_PASSWORD=postgres \
sn0rt:latestWe've got CI/CD! Every push to main automatically builds and publishes a fresh Docker image:
docker pull ghcr.io/d135-1r43/sn0rt:latest./mvnw testAll tests follow the Given-When-Then pattern. We're civilized here. π©
./mvnw package./mvnw package -Dquarkus.package.jar.type=uber-jar
java -jar target/*-runner.jarWant blazing-fast startup and tiny memory footprint? Go native!
./mvnw package -DnativeNo GraalVM? No problem! Build in a container:
./mvnw package -Dnative -Dquarkus.native.container-build=trueRun your lightning-fast native snortener:
./target/sn0rt-1.0.0-SNAPSHOT-runnerNote: Native builds can take a while. Perfect time for a coffee break β
Option 1: The Clicky Way π±οΈ Just go to http://localhost:8080/admin and use the fancy web form.
Option 2: The Cool Way π
# Let us pick a random code for you
curl -X POST http://localhost:8080/shorten \
-H "Content-Type: application/json" \
-d '{"url": "https://example.com/very/long/url"}'
# Be fancy with a custom code
curl -X POST http://localhost:8080/shorten \
-H "Content-Type: application/json" \
-d '{"url": "https://example.com/very/long/url", "customCode": "my-awesome-link"}'curl -L http://localhost:8080/{shortCode}It redirects! Like magic! β¨
curl http://localhost:8080/stats/{shortCode}curl -u admin:admin http://localhost:8080/admin/qr/{shortCode}/pdf -o qr-code.pdfPerfect for printing and sticking on everything! π
Built with love and these awesome technologies:
| Technology | What It Does |
|---|---|
| Quarkus 3.28.4 | The supersonic, subatomic Java framework |
| Java 21 | Because we like our Java fresh and modern |
| PostgreSQL | Where all the snorts are stored |
| Hibernate ORM Panache | Makes database stuff not painful |
| Qute | Templating that doesn't make you cry |
| Quarkus QR Code | For those fancy scannable squares |
| Quarkus PDFBox | PDF generation without the headache |
| Quarkus Security JPA | Keeps the bad guys out with BCrypt |
| GitHub Actions | Automatic builds because manual is for chumps |
Found a bug? Want to add a feature? Have a hilarious idea for the copy?
Contributions are welcome! Please feel free to submit a Pull Request. Just remember:
- Keep it snorty π·
- Follow the Given-When-Then test pattern
- Make it fabulous β¨
This project uses the Quarkus framework under the Apache License 2.0.
Made with π and π· snorts
β Star us on GitHub β’ π Report Bug β’ β¨ Request Feature