Minimalist Self-Hosted URL Shortener
This tool is a privacy-focused, self-hosted URL shortener powered by Cloudflare Workers and KV storage. It features real-time analytics, per-user data isolation, and flexible link expiry.
Authentication
- Users must log in with username and password.
- Authentication tokens are stored persistently in localStorage, keeping sessions active until manual logout.
- Login validation is done directly via fetch requests to Cloudflare Workers backend.
- Detailed error messages guide users on login failures.
- No password reset or recovery functionality exists.
- There is no automatic logout or session expiration.
Shortlink Creation
Form Fields
| Field | Required | Description |
|---|---|---|
| Slug | Yes | Custom slug or auto-generated unique string |
| Target URL | Yes | Must be a valid HTTP or HTTPS URL |
| Description | No | Optional comment, max 160 characters |
| Expiration Date | No | Optional; if set, link expires at exact timestamp |
| Expert Mode | No | Enables OpenGraph metadata input (Preview title, image URL) |
Validation and Behavior
- Slug uniqueness is enforced globally; duplicates trigger immediate warnings.
- Users can generate slugs automatically with a dedicated button.
- The form “Create” button activates only when required fields (Slug and Target URL) are valid and filled.
- Target URL is validated for proper URL format.
- Optional fields can be left empty.
- After successful creation:
- The form resets to blank.
- The new shortlink and corresponding QR code are displayed prominently.
- The shortlink also appears instantly in the “My Links” list without page reload.
- A success notification confirms the operation.
My Links Management
- Displays a paginated list of user-created shortlinks, sorted by newest first.
- Includes filters to search by slug or description.
- Shows creation date and expiry status (with “Never” for non-expiring links).
- Editing existing shortlinks is not supported yet.
- Deletion feature is planned but currently not implemented in UI.
- Links marked as expired remain visible; accessing expired links shows an explicit “Link Expired” message.
- Users can delete shortlinks permanently (via API or planned UI).
- Account deletion is supported, which wipes all user data and associated shortlinks irreversibly.
Analytics and Tracking
Click Data Captured in Real-Time
- Timestamp with timezone
- Visitor country/region (geo-IP based)
- Device type (desktop/mobile)
- Referrer URL
- Browser and OS user-agent data
Analytics Display
- Geographic map highlighting click locations.
- Daily click count charts.
- Device type breakdown charts.
- Detailed event logs shown in tables.
Analytics update instantly with zero delay, enabling timely insights.
Public Access and API
- Created shortlinks are publicly accessible without authentication.
- API endpoints for management and creation require Bearer token authentication.
- API tokens are issued on login and stored securely on client side.
- API documentation is not publicly available but can be provided upon request.
- API allows programmatic shortlink creation and deletion (if permitted).
Data Isolation & Privacy
- All user data and shortlinks are strictly isolated per account.
- Users cannot access or view other users’ shortlinks or analytics even if slugs are known.
- No third-party tracking or analytics; all data stays within Cloudflare KV and Workers.
- Data storage is limited by Cloudflare KV quotas; hence permanent deletion and account wipes are essential to avoid storage overflow.
Limitations and Future Directions
- No edit feature yet for existing shortlinks.
- UI deletion and bulk management tools for expired links are planned.
- Session timeout or password recovery features are not currently implemented.
- OpenGraph metadata editing is available only in Expert Mode.
- Improvements planned for clearer expired link labeling and better UX around date display.
Note (Developer note)
Shortlink slug generation balances uniqueness and user customization, with robust validation to avoid conflicts and keep links reliable.
Definition
Stare at this big monkey if you feel no interest in reading this post or feel no enlightenment after reading this post, because you are just like this monkey in not understanding this useless post.
View ProjectSummary
This shortlink tool delivers a privacy-first, easy-to-use solution for managing URLs with detailed, real-time analytics and secure user isolation. It empowers users to create custom or autogenerated shortlinks with optional expiry and metadata, track usage comprehensively, and manage links and accounts securely.
Got something in mind?
✳︎ ask me anything ✳︎