LinkSnip is a high-performance, compact URL shortener and real-time analytics dashboard built with Node.js, Express, SQLite, React, TanStack Query, and Zod.
- Instant URL Shortening: Create fast, reliable short links with custom or auto-generated slugs.
- Real-Time Click Analytics: Track total clicks, unique visitors, referrers, and conversion rates.
- Responsive Dashboard: Minimal UI overhead with a landing input card and metrics table.
- Link Management: Archive (soft-delete) and restore links seamlessly.
- Developer Ready: SQLite-backed with no external database setup needed.
- Backend: Node.js, Express, SQLite (
node:sqlite), Zod - Frontend: React 18, Vite, TanStack Query v5, Zod, Lucide Icons
- Testing: Node.js Test Runner (
node:test) - Frontend App:
http://localhost:5173 - Backend API:
http://localhost:3002
npm installStart both frontend and backend concurrently:
npm run dev
# Or with Makefile
make dev- Frontend:
http://localhost:5173 - Backend API:
http://localhost:3002
npm test
# Or with Makefile
make testPOST /links: Shorten a URL ({ originalUrl, customSlug? })GET /links?page=1&limit=10: List paginated active linksGET /links/stats: Global analytics overviewGET /links/:id: Get detailed link metricsDELETE /links/:id: Archive a linkPOST /links/:id/restore: Restore an archived linkGET /:code: Redirect shortcode to destination URL
Your engineering squad has received production incident reports regarding several critical regressions in LinkSnip:
- INC-01: Lifecycle Archive Failure
- Symptom: When an operator archives a link (
DELETE /links/:id), the database state remains active, allowing short code redirection to continue.
- Symptom: When an operator archives a link (
- INC-02: Slug Collision on Restore
- Symptom: Restoring an archived link does not verify if its slug was claimed by another active link in the interim, causing state collisions.
- INC-03: Telemetry Dashboard Desync
- Symptom: The
/links/statsendpoint and telemetry cards fail to return the active link count.
- Symptom: The
- INC-04: Pagination Bleed
- Symptom: Navigating pages in the active links directory counts archived records towards the total link count.
- INC-05: Missing QR Generator Implementation
- Symptom: QR code previews return empty strings on both the backend service and the client-side helper (
linkService.ts).
- Symptom: QR code previews return empty strings on both the backend service and the client-side helper (
- INC-06: Strict Target URL Protocol Enforcement
- Symptom: The service layer must strictly reject unsupported protocols (
javascript:,file:, etc.) and ensure only validhttp://andhttps://URLs are accepted.
- Symptom: The service layer must strictly reject unsupported protocols (
Judges evaluate your submission based on:
- Public & Hidden Test Suites: All public tests (
make test) and hidden judge checks (eval_hidden) must pass. - Surgical Precision: Minimal, focused diffs without unnecessary formatting rewrites or bloated AI boilerplate.
- Prompt Engineering Evidence: Documented prompt sequences in
NOTES.mddemonstrating structured reasoning. - Live Code Defense: Defending your diagnosis and solutions during judge Q&A.