| Framework | Next.js 16 (App Router) |
| Language | TypeScript |
| UI | React 19, Tailwind CSS, shadcn/ui, lucide-react, Geist |
| State | Zustand (localStorage) |
| Database | MongoDB + Mongoose |
| IDs | nanoid (5–8 chars) |
| Captcha | Cloudflare Turnstile |
| Testing | Vitest + Testing Library |
pnpm devOpen http://localhost:3000.
MONGODB_URL=mongodb://localhost/nextmongo
NEXT_PUBLIC_TURNSTILE_SITE_KEY=your_turnstile_site_keyOptional: RATE_LIMIT_MAX (default 10, daily URL creations per IP), RATE_LIMIT_BYPASS_IPS.
| Command | Action |
|---|---|
pnpm dev |
Dev server |
pnpm build |
Production build |
pnpm start |
Start production server |
pnpm lint |
ESLint |
pnpm test |
Vitest |
- Paste a long URL and complete the Turnstile captcha.
- Server generates a short code, stores the mapping in MongoDB.
- Visiting
/{code}permanently redirects to the original URL. - Your created links are saved to localStorage and displayed in a table.
Rate limiting is enforced per IP (daily cap).