Quick Start

ShortDesk is a free, open-source URL shortener. No account required.

1

Go to the homepage

Visit / or open Platform in the navigation bar.

2

Paste your URL

Enter any valid URL in the input field.

3

Click Shorten

You will get a short URL, a copy button, and a QR code instantly.

Custom Alias

You can optionally provide a custom alias instead of the auto-generated code. Aliases must be 3-30 characters, using letters, numbers, hyphens, and underscores.

Example
Custom alias: my-portfolio
Result:      https://your-domain.com/my-portfolio
Note: If the alias is already taken, you will be asked to choose a different one.

Password Protection

You can protect any link with a password. When someone visits a protected link, they must enter the correct password before being redirected.

  • Passwords are hashed with bcrypt before storage
  • A session cookie is set on successful entry (expires in 24 hours)
  • The original URL is never exposed until authentication succeeds

Link Expiry

Set an expiration time for any link. Available options:

Option Duration
neverLink never expires (default)
1h1 hour from creation
1d1 day from creation
7d7 days from creation
30d30 days from creation

Expired links show a friendly expiration page instead of redirecting.

Click Limit Expiration

In addition to time-based expiration, you can set a maxClicks limit. Once the link reaches this threshold (e.g. 100 clicks), it immediately deactivates and returns a 410 Gone status. If configured, a max_clicks_reached webhook event is fired.

Webhooks

Get notified when your link hits a click threshold or expires. ShortDesk sends a POST request to your webhook URL with this payload:

JSON Payload
{
  "event": "threshold_reached",
  "shortId": "Ab3xK9",
  "shortUrl": "https://your-domain.com/Ab3xK9",
  "originalUrl": "https://example.com/long-path",
  "totalClicks": 100,
  "threshold": 100,
  "timestamp": "2025-07-27T12:00:00.000Z"
}

For expiry events, "event" will be "link_expired".

Analytics

Every short link has a dedicated analytics page showing:

  • Total clicks
  • Clicks over time (bar chart, last 14 days)
  • Country breakdown
  • Device, browser, and OS breakdowns
  • Referrer sources
  • Date-range filtering for click history

Access analytics from the Dashboard by clicking Analytics next to any link, or visit /analytics/{shortId} directly.

API Reference

ShortDesk exposes a REST API for programmatic access.

POST /shorten

Shorten a URL via the API.

curl
curl -X POST https://your-domain.com/shorten \
  -H "Content-Type: application/json" \
  -d '{
    "originalUrl": "https://example.com/long-path",
    "customAlias": "my-link",
    "password": "optional-password",
    "expiry": "7d",
    "maxClicks": 100,
    "webhookUrl": "https://your-webhook.com/notify",
    "clickThreshold": 100
  }'

GET /api/qr/{shortId}

Get a QR code image for any short link.

Example
GET /api/qr/Ab3xK9?size=200
Returns: PNG image (200x200)

GET /{shortId}

Redirects to the original URL. If the link is password-protected, shows the password entry page.

Self-Hosting

ShortDesk can be deployed on your own infrastructure.

Prerequisites

  • Node.js 18+
  • MongoDB 6+ (or MongoDB Atlas)
  • Redis (optional, for caching redirects)

Installation

Terminal
# Clone the repository
git clone https://github.com/AmiNilay/shortdesk-offical.git
cd shortdesk-offical

# Install dependencies
npm install

# Create environment file
cp .env.example .env
# Edit .env with your MongoDB URI and session secret

# Start the server
npm start

Environment Variables

Variable Required Description
MONGO_URIYesMongoDB connection string
SESSION_SECRETYesSecret for session cookies
PORTNoServer port (default: 3000)
NODE_ENVNoproduction or development
GOOGLE_SAFE_BROWSING_KEYNoGoogle Safe Browsing API key

Deploy to Vercel

Terminal
# Install Vercel CLI
npm i -g vercel

# Deploy
vercel

# Set environment variables in Vercel dashboard
# Settings → Environment Variables

Tech Stack

Layer Technology
RuntimeNode.js
FrameworkExpress.js
DatabaseMongoDB + Mongoose
CacheRedis (optional)
Template EngineEJS
QR Codesqrcode library
Password Hashingbcrypt
URL SafetyGoogle Safe Browsing API
DeploymentVercel

Frequently Asked Questions

Is ShortDesk really free?

Yes. It is 100% free, open-source software released under the MIT License. No hidden fees, no premium tiers.

Do I need an account?

No. ShortDesk does not require user accounts. Just paste a URL and shorten it.

Can I use my own domain?

Yes, if you self-host. Deploy ShortDesk on your server and configure your domain to point to it.

How long are links stored?

Indefinitely, unless you set an expiry date. Self-hosted instances can configure their own retention policies.

Is there an API?

Yes. See the API Reference section above for endpoint details and examples.

How do I report a bug?

Open an issue on GitHub.