Skip to content

Vishnu3377/tinylink

Repository files navigation

TinyLink — TakeHome Assignment

Candidate ID: Naukri1125

This app implements a URL shortener matching the TinyLink spec.

Live demo

(put your Vercel/Render URL here)

Endpoints

  • GET / -> Dashboard (UI)
  • GET /code/:code -> Stats page
  • GET /:code -> Redirect (302) or 404
  • GET /healthz -> { ok: true, version: "1.0" }

API:

  • POST /api/links -> Create link (409 if code exists)
  • GET /api/links -> List all links
  • GET /api/links/:code -> Stats for one code
  • DELETE /api/links/:code -> Delete

DB

Run migration:

npm run migrate

Requires DATABASE_URL env var.

Run locally

  1. cp .env.example .env and set DATABASE_URL and NEXT_PUBLIC_BASE_URL.
  2. npm install
  3. npm run migrate
  4. npm run dev

About

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors