Rafif Muchsin

Link Shortener

Error

Something went wrong

Documentation

This is a completely serverless link shortener that uses GitHub as a decentralized database. It offers 100% data ownership with zero database hosting costs. Anyone can use this tool by only providing a Target URL, User, Repo, and Github Token.

It's also possible to use it by cloning the repository.

1. How to Use It

  • Create a Database: Make a new, empty public GitHub repository (e.g., my-links).
  • Get a Token: Go to your GitHub Developer Settings and generate a Personal Access Token (classic) with the repo scope.
  • Generate: Select "Custom", input your Target URL, User, Repo, and Token. Click Generate!

2. Autofill & Presets (domains.json)

The "Preset" dropdown reads from a file called domains.json located in the project's root. The Default (Root) option is auto-filled to save you time if you have a primary repository you use constantly.

Why add a new option? If you want to categorize your links (e.g., one repo for /blog/ and another for /dl/ by modifying its "prefix"), you can clone this project and edit domains.json to add custom prefixes. This automatically locks the User/Repo fields to prevent typos.

Please note that "default": true value below can be changed to false if you don't want this option to be selected by default.

[
  {
    "prefix": "",
    "name": "Default",
    "user": "rafifmsn",
    "repo": "rmsn-link-base",
    "default": true
  },
  {
    "prefix": "tr",
    "name": "Default",
    "user": "rafifmsn",
    "repo": "trash-bin",
    "default": false
  }
]

3. Link Formats (Clean vs. Portable)

The system uses a Smart Match routing logic. The generated link adapts based on whether your repository is registered in domains.json or not:

  • Registered Repo (Clean URL):
    If your User/Repo matches a preset, you get a clean URL.
    s.domain.com/01JG... (or /prefix/01JG...)
  • Unregistered Repo (Portable Hash):
    If you use the "Custom" option for a repo not in your config, the resolver uses URL hashes to locate it. This allows the system to remain stateless.
    s.domain.com/01JG...#u=user&r=repo
Your GitHub Token is stored locally in your browser and is never sent to an external server other than GitHub's official API.