Mirror of github.com/ewanc26/atproto-shortlink
  • TypeScript 51.9%
  • Svelte 30.3%
  • JavaScript 10.3%
  • CSS 5.5%
  • Nix 1.5%
  • Other 0.5%
Find a file
2026-07-16 18:22:45 +01:00
.vscode feat(encoding): Enhance shortcode generation with domain-awareness 2025-11-24 13:46:36 +00:00
scripts docs: add comments to source files 2026-06-29 21:59:28 +01:00
src docs: add comments to source files 2026-06-29 21:59:28 +01:00
static Initial commit: add files 2025-11-24 09:20:00 +00:00
.env.example Initial commit: add files 2025-11-24 09:20:00 +00:00
.gitignore Initial commit: add files 2025-11-24 09:20:00 +00:00
.npmrc Initial commit: add files 2025-11-24 09:20:00 +00:00
.pre-commit-config.yaml chore: fix pre-commit to use local prettier 2026-04-14 23:21:15 +01:00
.prettierignore Initial commit: add files 2025-11-24 09:20:00 +00:00
.prettierrc Initial commit: add files 2025-11-24 09:20:00 +00:00
AGENTS.md docs: correct agent guidance after source audit 2026-07-16 18:22:45 +01:00
ARCHITECTURE.md Initial commit: add files 2025-11-24 09:20:00 +00:00
flake.nix docs: add comments to source files 2026-06-29 21:59:28 +01:00
LICENCE Initial commit: add files 2025-11-24 09:20:00 +00:00
package-lock.json feat(identity): add handle resolution and update identity resolver 2025-12-07 11:36:14 +00:00
package.json refactor(QR, iconography): add @lucide/svelte and qrcode for various fixes/improvements 2025-11-27 18:17:33 +00:00
README.md docs: clarify AT Protocol trademark use 2026-07-16 14:13:41 +01:00
svelte.config.js Initial commit: add files 2025-11-24 09:20:00 +00:00
TRADEMARKS.md docs: clarify AT Protocol trademark use 2026-07-16 14:13:41 +01:00
TROUBLESHOOTING.md Initial commit: add files 2025-11-24 09:20:00 +00:00
tsconfig.json Initial commit: add files 2025-11-24 09:20:00 +00:00
vite.config.ts refactor(css): convert to TailwindCSS 4 2025-11-24 23:45:22 +00:00

Link Shortener for AT Protocol

Server-side link shortener powered by your Linkat board. No database — links are fetched from AT Protocol.

Independent project; see the trademark notice.

Also available on Tangled

How it works

  1. You maintain links in Linkat (stored in blue.linkat.board collection)
  2. Service fetches them on-demand from your PDS via Slingshot
  3. URLs get a deterministic 6-char base62 hash (e.g., /a3k9zx)
  4. Visiting that short link returns a 301 redirect

Quick start

git clone git@github.com:ewanc26/atproto-shortlink
cd atproto-shortlink
npm install

Copy .env.example to .env and add your AT Protocol DID:

ATPROTO_DID=did:plc:your-did-here

Find your DID at pdsls.dev.

If you don't have a Linkat board yet, create one at linkat.blue.

Test config

npm run test:config

Checks that .env exists, DID is valid, PDS is reachable, and your Linkat board is accessible.

Run

npm run dev

Endpoints

Endpoint Method What it does
/ GET Service info and link listing
/:shortcode GET 301 redirect to full URL
/api/links GET All short links as JSON

Deploy

npm run build
npm run preview

Uses @sveltejs/adapter-auto — works with Vercel, Netlify, Cloudflare Pages, or Node.

Set ATPROTO_DID in your deployment platform's env vars.

Config ref

Variable Required What it is
ATPROTO_DID Yes Your AT Protocol DID

Development

npm run dev     # dev server
npm run check   # type check
npm run format  # format
npm run lint    # lint

Licence

AGPLv3 — see LICENCE