Get ZipURL up and running in minutes.
ZipURL uses Nix for reproducible development environments. You'll need:
Add to ~/.config/nix/nix.conf or /etc/nix/nix.conf:
experimental-features = nix-command flakes
git clone https://github.com/nullisLabs/zipurl.git
cd zipurl# Option A: Using direnv (recommended)
direnv allow
# Option B: Manual
nix developThe first time you run this, Nix will download and build all dependencies. This may take several minutes.
cargo install cargo-leptosThis is required for building the full-stack Leptos application.
cp config.toml.example config.tomlEdit config.toml with your settings:
host = "0.0.0.0"
port = 1337
base_url = "http://localhost:1337"
database_path = "zipurl.db"just dev
# or
cargo leptos watchThe application will be available at http://localhost:1337
Hot reload is enabled - any code changes will automatically rebuild and refresh.
- Open http://localhost:1337 in your browser
- The database will be created automatically on first run
ZipURL supports multiple auth modes:
Edit config.toml:
[auth]
mode = "mock"- Start Keycloak for testing:
just keycloak-up- Configure in
config.toml:
[auth]
mode = "keycloak"
issuer_url = "http://localhost:8080/realms/master"
client_id = "zipurl"
client_secret = "your-client-secret"
redirect_uri = "http://localhost:1337/auth/callback"- Access Keycloak admin console:
- URL: http://localhost:8080
- Username:
admin - Password:
admin
- Log in (if auth is enabled)
- Navigate to Dashboard
- Click "Create Short URL"
- Enter target URL and optional custom code
- Add UTM parameters or metadata if needed
- Click "Create"
Generate an API key first:
# Generate a random key
just gen-api-key
# Hash it for storage (you'll need to add to database manually)
just hash-api-key YOUR_KEY_HEREThen create a URL:
curl -X POST http://localhost:1337/api/urls \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"domain": "localhost",
"target_url": "https://example.com",
"code": "example"
}'Access your short URL at: http://localhost:1337/example
# Development
just dev # Start dev server
just dev-server # Backend only (no SSR)
# Testing
just test # Run all tests
just test-one <name> # Run specific test
# Code Quality
just fmt # Format code
just lint # Run linter
just check-all # Check frontend & backend
# Database
just db-backup # Backup database
just db-reset # Reset database (WARNING: deletes data)
# Building
just build # Development build
just build-release # Production build
# Help
just --list # Show all commands
just help # Show helpzipurl/
├── crates/
│ ├── zipurl-core/ # Shared models and types
│ ├── zipurl-server/ # Backend API and database
│ ├── zipurl-client/ # Browser-side utilities
│ └── zipurl-app/ # Leptos UI application
├── assets/ # Static assets
├── config.toml.example # Configuration template
├── Justfile # Task runner commands
├── Leptos.toml # Leptos build config
└── flake.nix # Nix development environment
Problem: WASM compilation fails
# Check frontend compilation
just check-frontend
# Ensure wasm32 target is installed
rustup target add wasm32-unknown-unknownProblem: Missing cargo-leptos
cargo install cargo-leptosProblem: Port 1337 already in use
Edit config.toml or Leptos.toml to change the port.
Problem: Database locked or corrupted
just db-reset # WARNING: This deletes all dataProblem: Keycloak connection fails
# Check Keycloak is running
just keycloak-logs
# Restart Keycloak
just keycloak-resetProblem: OIDC redirect loop
Verify redirect_uri in config.toml matches your Keycloak client configuration.
The dev server watches for changes in:
- Rust files (
.rs) - Tailwind CSS (
style/tailwind.css) - Static assets
Changes trigger automatic rebuild and browser refresh.
Enable Rust backtraces:
RUST_BACKTRACE=1 just devEnable debug logging:
RUST_LOG=debug just dev# Test specific crate
cargo test -p zipurl-server
cargo test -p zipurl-core
# Test with output
cargo test -- --nocapturejust check-frontend-quick # Fast compilation check
just build-frontend # Build WASM only- Read CLAUDE.md for detailed architecture documentation
- Check Justfile for all available commands
- Explore the API endpoints in
crates/zipurl-server/src/api/ - Customize the UI in
crates/zipurl-app/src/
For production deployment:
- Build release version:
just build-release- Binary location:
target/release/zipurl-app - Static assets:
target/site/ - Set environment variables for sensitive config
- Use reverse proxy (nginx/caddy) with HTTPS
- Configure OIDC for production auth
- Set up regular database backups
See README.md for more deployment options.
- Check existing issues on GitHub
- Review CLAUDE.md for development guidance
- Run
just helpfor command reference