All projects
backendBeginner

URL Shortener with Analytics

A production-ready URL shortener with click tracking, custom slugs, and rate limiting.

Node.jsExpressMongoDBRedisZod

Key features

  • Custom slugs and auto-generated IDs
  • Per-link click analytics
  • Rate limiting per IP
  • Expiration dates
  • API & web UI

Build steps

  1. 1

    Design the data model in MongoDB

  2. 2

    Implement POST /shorten and GET /:slug routes

  3. 3

    Add Redis-based rate limiting

  4. 4

    Track clicks asynchronously

  5. 5

    Build a small dashboard