Reqq .cc — Next 15 + Supabase link‑shortener
✨ About
Reqq .cc is a privacy‑minded, open‑source URL shortener built with the latest bleeding‑edge Next JS 15 Server Actions, Edge Middleware, and Supabase Postgres.
I rebuilt the original Prisma + PlanetScale version from scratch to learn the new App Router paradigm (React 19 & useActionState) and to dog‑food Supabase’s all‑in‑one stack in production.
Why another refactor?
| v1 (2023) | v2 / current (2025) |
|---|
| Next 13 Pages Router | Next 15 App Router + React 19 |
| Prisma ORM + PlanetScale (MySQL) | Supabase Postgres + RLS |
| API routes | Server Actions + Edge Middleware |
| Tailwind v3 | Tailwind v4 (CSS‑at‑config) |
| No auth | Supabase Auth |
🚀 Features
- 🔗 Anonymous or authenticated short‑links – logged‑in users own their links; anonymous links still work.
- 📈 Atomic click counter via Postgres
increment_click function (no race conditions).
- 🌍 Ultra‑low latency redirects – Edge middleware resolves slugs in ~20–40 ms.
- 🛂 Row‑level security – every request goes through Supabase RLS policies; the client only gets its own data.
- ⚡ Live revalidate – new links appear instantly without client‑side cache busting.
- 🧩 Composable architecture – backend actions live in
src/lib/actions/**, UI components in src/components/**.
🏗️ Tech stack
| Layer | Library / service |
|---|
| Front‑end | React 19, Next JS 15, TypeScript |
| Styling | Tailwind CSS v4 |
| Components | Radix UI primitives |
| Data | Supabase Postgres (links table) |
| Auth | Supabase Auth (JWT) |
| Validation | Zod schemas |
| State mgmt | useActionState (no client stores) |
🛠️ Local development
# 1. clone & install
pnpm install
# 2. copy env example and fill in your Supabase creds
cp .env.example .env.local
# 3. run dev server
pnpm dev
Environment variables
| Variable | Example | Description |
|---|
NEXT_PUBLIC_SUPABASE_URL | https://xyz.supabase.co | Your Supabase URL |
NEXT_PUBLIC_SUPABASE_ANON_KEY | eyJhbGciOi... | Public anon key |
SUPABASE_SECRET_KEY | (server only) | Secret key; the server inserts links |
GOOGLE_SAFE_BROWSING_API_KEY | (server only) | Safe Browsing check on new links |
UPSTASH_REDIS_REST_URL | https://xyz.upstash.io | Upstash Redis for rate limiting |
UPSTASH_REDIS_REST_TOKEN | (server only) | Upstash Redis token |
NEXT_PUBLIC_SITE_URL | https://reqq.cc | Fallback origin for password-reset links |
📂 Project structure (abridged)
src/
app/
(routes & server actions)
lib/
actions/ # server‑action files (createLink.ts, deleteLink.ts …)
supabase/ # tiny wrappers for client / server helpers
components/ # Radix‑based UI
styles/
globals.css
middleware.ts # Edge runtime slug resolver
🤝 Contributing
- Fork the repo
- Create your feature branch:
git checkout -b feat/amazing-thing
- Commit your changes:
git commit -m "feat: amazing thing"
- Push to the branch:
git push origin feat/amazing-thing
- Open a pull request 🚀
📧 Contact
Umut Toker – [email protected] – LinkedIn
Back to top