A production-style URL shortener and analytics platform inspired by Bitly, built with performance, scalability, and real-time analytics in mind.
Production-style analytics dashboard with real-time metrics, click tracking, geographic insights, browser analytics, and performance monitoring.
Shows total clicks, unique visitors, redirect performance, click analytics, and geographic analytics.
Shows traffic sources, browser analytics, OS analytics, and top-performing links.
Shows real-time click activity with browser, device, region, and traffic source tracking.
Comprehensive link management with search, filtering, sorting, editing, QR generation, and link actions.
Shows searchable link management with filtering and analytics access.
Horizontal scrollable table for managing large link datasets.
Detailed analytics for a specific shortened URL including click trends, geographic insights, and traffic breakdowns.
Shows click statistics, visitors, redirect performance, and top region for a specific link.
Shows click analytics graph and geographic analytics for an individual link.
Shows browser analytics, OS analytics, and traffic source insights.
Shows recent click feed for a specific shortened URL.
User settings for account management, authentication, preferences, exports, and privacy.
Manage profile details and password updates.
Configure link preferences, notifications, auto refresh, and exports.
Secure account deletion and irreversible actions.
- Custom short aliases
- URL expiration support
- Active/inactive link management
- QR code generation and download
- Total clicks and unique visitors
- Browser, OS, and device analytics
- Region-based analytics
- Traffic source tracking
- Real-time click updates using WebSockets
- Redis caching for low-latency redirects
- Asynchronous analytics processing
- Optimized PostgreSQL queries
- Rate limiting to prevent abuse
- JWT cookie-based authentication
- Password hashing with bcrypt
- Protected routes and middleware
- Node.js
- Express.js
- PostgreSQL (Neon)
- Redis (Upstash)
- WebSockets
- HTML
- CSS
- JavaScript
- Chart.js
- jsVectorMap
- JWT
- bcrypt
- cookie-parser
- CORS
URLify follows a scalable backend architecture optimized for fast redirects, caching, and asynchronous analytics processing.
User Request
↓
Rate Limiter
↓
URL Redirect API
↓
Redis Cache Check
↙ ↘
Cache Hit Cache Miss
↓ ↓
Immediate Redirect PostgreSQL Lookup
↓ ↓
Async Analytics Logging
↓
302 Redirect
- Incoming requests pass through rate limiting to prevent abuse.
- Redis cache is checked for fast URL retrieval.
- Cache hits redirect immediately with minimal latency.
- Cache misses fetch data from PostgreSQL and refresh cache.
- Click analytics are logged asynchronously to avoid blocking redirects.
- Users are redirected using HTTP
302responses.
- Redis cache-aside pattern for fast redirects
- PostgreSQL as source of truth
- Async analytics logging to keep redirect path non-blocking
- Rate limiting on public redirect routes
- WebSocket-based live click notifications
Redis caching reduces redirect latency by avoiding repeated database lookups for frequently accessed links.
Analytics logging runs asynchronously so redirects remain fast and user experience is not blocked.
PostgreSQL was chosen for reliable relational storage and analytics querying.
JWT cookie authentication provides secure session handling and protected route access.
URLify uses PostgreSQL to manage users, shortened URLs, analytics, and user preferences.
Stores user authentication and profile details.
| Field | Type | Description |
|---|---|---|
| id | SERIAL | Primary key |
| username | VARCHAR(100) | Unique username |
| fullname | VARCHAR(150) | Full name |
| password | TEXT | Hashed password |
| created_at | TIMESTAMP | Account creation time |
Stores shortened URLs and metadata.
| Field | Type | Description |
|---|---|---|
| id | SERIAL | Primary key |
| user_id | INT | Linked user |
| original_url | TEXT | Original destination URL |
| short_code | VARCHAR(50) | Unique shortened code |
| total_clicks | INT | Number of redirects |
| is_active | BOOLEAN | Active/inactive status |
| expires_at | TIMESTAMPTZ | Link expiration |
| created_at | TIMESTAMPTZ | Creation timestamp |
| updated_at | TIMESTAMPTZ | Last updated |
Tracks redirect analytics and visitor behavior.
| Field | Type | Description |
|---|---|---|
| id | SERIAL | Primary key |
| url_id | INT | Linked URL |
| clicked_at | TIMESTAMP | Click timestamp |
| ip_address | TEXT | Visitor IP |
| user_agent | TEXT | Raw user agent |
| device_type | VARCHAR(50) | Device type |
| browser | VARCHAR(50) | Browser name |
| operating_system | VARCHAR(50) | Operating system |
| country | VARCHAR(100) | Visitor region |
| referer | TEXT | Traffic referer |
| traffic_source | VARCHAR(50) | Traffic category |
| redirect_time_ms | NUMERIC(10,2) | Redirect latency |
Stores user preferences and analytics settings.
| Field | Type | Description |
|---|---|---|
| user_id | INT | Linked user |
| default_expiry | VARCHAR(30) | Default link expiry |
| live_notifications | BOOLEAN | Live click notifications |
| analytics_auto_refresh | BOOLEAN | Dashboard auto refresh |
| created_at | TIMESTAMPTZ | Created time |
| updated_at | TIMESTAMPTZ | Updated time |
- Reduced average redirect latency from ~300ms to ~70ms using Redis caching
- Measured server-side lifecycle timings (
redisMs,dbMs,redirectTimeMs) - Implemented asynchronous analytics logging to keep redirects non-blocking
- Cache-first redirect architecture for frequently accessed links
- Redis cache layer reduces database load for frequently accessed URLs
- PostgreSQL indexing for faster URL and analytics lookups
- Asynchronous analytics logging prevents redirect bottlenecks
- Rate limiting protects public redirect APIs from abuse
- Modular API structure for future microservice migration
- Reduced redirect latency by separating analytics logging from the redirect path
- Implemented Redis cache fallback for database misses
- Prevented authentication redirect loops using protected route middleware
- Managed real-time dashboard updates with WebSockets
- Designed analytics queries for browser, OS, device, region, and traffic source breakdowns
- Designing low-latency backend APIs
- Using Redis caching with PostgreSQL
- Building async analytics pipelines
- Handling authentication securely with JWT cookies
- Structuring analytics dashboards from raw event data
POST /api/auth/signup
POST /api/auth/login
POST /api/auth/logoutGET /api/links
POST /api/links
PATCH /api/links/:id
DELETE /api/links/:id
GET /:shortCodeGET /api/analytics
GET /api/analytics/link/:linkIdGET /api/qrGET /api/settings
PATCH /api/settings/account
PATCH /api/settings/password
PATCH /api/settings/preferences
DELETE /api/settings/account
GET /api/settings/export/links
GET /api/settings/export/analyticsCreate a .env file:
DATABASE_URL=
JWT_SECRET=
REDIS_URL=git clone <repo-url>
cd urlify
npm install
npm start- Team workspaces
- Advanced analytics filters
- Geo heatmaps
- Developer API Section
MIT











