LinkForge is a full-stack URL shortening platform designed to deliver fast redirects and detailed click analytics without sacrificing performance.
Built using React, Node.js, PostgreSQL, Redis, and BullMQ, the application leverages caching and background job processing to efficiently manage redirect traffic and analytics collection.
Link shortening services must handle two important responsibilities:
- Redirect users as quickly as possible
- Record every click accurately for analytics
Performing analytics processing during the redirect request can introduce unnecessary latency. LinkForge avoids this by separating redirect execution from analytics tracking through a queue-driven architecture.
Redirects are served immediately while click events are processed asynchronously in the background.
- Generate shortened URLs from long links
- Create custom short aliases
- Store and manage URL mappings
- Prevent duplicate short codes
- Redis-powered cache layer
- Reduced database lookups
- Low-latency URL resolution
- Optimized redirect workflow
- Click tracking
- Device detection
- Browser identification
- Operating system analysis
- Geolocation tracking
- Unique visitor monitoring
- Interactive analytics visualizations
- Link performance monitoring
- Usage statistics and trends
- Real-time reporting interface
- Dockerized environment
- Queue-based processing with BullMQ
- PostgreSQL persistent storage
- Redis caching and messaging
- User requests a shortened URL.
- Backend checks Redis for cached URL data.
- Original destination URL is retrieved.
- Analytics event is added to a BullMQ queue.
- HTTP redirect response is returned immediately.
- Background worker processes analytics data.
- Click information is stored in PostgreSQL.
This design ensures analytics operations never block redirect requests.
- React
- Vite
- Tailwind CSS
- Axios
- React Router
- Recharts
- Node.js
- Express.js
- PostgreSQL
- Redis
- BullMQ
- ioredis
- Docker
- Docker Compose
linkforge/
│
├── backend/
│ ├── controllers/
│ ├── routes/
│ ├── middleware/
│ ├── services/
│ └── utils/
│
├── frontend/
│ ├── src/
│ ├── public/
│ └── components/
│
├── docker-compose.yml
├── README.md
└── .gitattributes
git clone https://github.com/yourusername/linkforge.git
cd linkforgedocker compose up -dcd backend
npm install
npm run devOpen a separate terminal window:
cd backend
node services/analyticsWorker.jsOpen another terminal:
cd frontend
npm install
npm run devOpen:
http://localhost:5173
Stores account information and authentication credentials.
Maintains mappings between shortened URLs and their original destinations.
Records visitor activity including:
- Visitor ID
- Device Type
- Browser Information
- Geographic Data
- Click Timestamp
Configured a centralized Redis connection strategy to ensure stable communication between BullMQ producers and workers.
Enhanced cached URL records to include both redirect information and associated database identifiers, ensuring analytics events remain correctly linked.
Implemented strict cache-control policies to prevent browsers from serving outdated analytics responses.
Separated analytics ingestion from redirect processing to keep request latency low under increasing traffic volumes.
- JWT Authentication
- QR Code Generation
- Link Expiration Support
- Team Workspaces
- Advanced Search
- Rate Limiting
- CI/CD Pipelines
- Kubernetes Deployment
- Redis Clustering
- Enhanced Analytics Reporting
- Full-Stack Development
- REST API Design
- Redis Caching
- Background Job Processing
- Event-Driven Architecture
- PostgreSQL Database Design
- Docker Containerization
- System Scalability
- Analytics Pipeline Development
- Distributed Systems Fundamentals
This project is licensed under the MIT License.
Feel free to fork, modify, and extend the project for learning or production use.