Shorten long URLs (random or custom aliases), copy them in one click, and see analytics for every link: clicks per day over the last 14 days, top referrers and device types.
- Frontend: Next.js 15 (App Router), React 19, TypeScript, Tailwind CSS 4
- Backend: Next.js Route Handlers — REST API plus a
/:coderedirect handler that records each click - Database: PostgreSQL (Neon) — falls back to in-process PGlite when
DATABASE_URLis not set
| Method | Route | Description |
|---|---|---|
| GET | /api/links |
List your links with click counts |
| POST | /api/links |
Create { url, code? } |
| GET | /api/links/:id |
Analytics: daily clicks, referrers, devices |
| DELETE | /api/links/:id |
Delete a link and its clicks |
| GET | /:code |
Redirect to the original URL (307) and log the click |
Only http/https URLs are accepted; aliases are 3–32 characters of letters, numbers, - or _.
npm install
npm run devSet DATABASE_URL to a Postgres connection string for persistent storage; tables are created automatically.