Overview
A URL shortener that lets users create memorable aliases (for example,
yt for YouTube) and redirect instantly with low latency.
Technical Challenges
Fast Redirect Path
Redirect requests should return as quickly as possible. The redirect handler resolves the short code and responds immediately, while non-critical work is deferred.
Asynchronous Persistence
Click tracking and metadata updates are executed asynchronously after the redirect response is sent. This reduces perceived latency while still keeping analytics and usage data in sync in MongoDB.
Authentication and Ownership
next-auth is used to authenticate users and scope short links to owners, ensuring users can manage only their own aliases.
Stack and Routing
Built with Next.js for both UI and API routes, with MongoDB as the persistence layer for short code mappings and redirect statistics.
System architecture
A low-latency URL shortener architecture where redirect resolution returns immediately while analytics and usage counters are persisted asynchronously. NextAuth scopes link management by user identity, and MongoDB stores both shortcode mappings and click metadata.


