mirror of
https://github.com/ewanc26/atproto-shortlink.git
synced 2026-07-21 15:33:14 +00:00
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%
| .vscode | ||
| scripts | ||
| src | ||
| static | ||
| .env.example | ||
| .gitignore | ||
| .npmrc | ||
| .pre-commit-config.yaml | ||
| .prettierignore | ||
| .prettierrc | ||
| AGENTS.md | ||
| ARCHITECTURE.md | ||
| flake.nix | ||
| LICENCE | ||
| package-lock.json | ||
| package.json | ||
| README.md | ||
| svelte.config.js | ||
| TRADEMARKS.md | ||
| TROUBLESHOOTING.md | ||
| tsconfig.json | ||
| vite.config.ts | ||
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
- You maintain links in Linkat (stored in
blue.linkat.boardcollection) - Service fetches them on-demand from your PDS via Slingshot
- URLs get a deterministic 6-char base62 hash (e.g.,
/a3k9zx) - 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