LinkLite is a URL shortener built with FastAPI, PostgreSQL, Redis, React, and Docker.
The project explores caching, asynchronous analytics processing, and performance optimization in a read-heavy system. It implements a cache-aside architecture with Redis, asynchronous click tracking using FastAPI BackgroundTasks, rate limiting, and URL expiration policies.
- URL Shortening – Generate short, shareable URLs instantly.
- Custom Short Codes – Create your own aliases or use auto-generated codes.
- Analytics Dashboard – Track clicks and visualize usage trends over time.
- Redis Cache Layer – Cache-aside architecture for low-latency redirects.
- Asynchronous Click Tracking – Analytics logging moved off the request critical path using FastAPI
BackgroundTasks. - Rate Limiting – Prevent API abuse by limiting request frequencies based on IP.
- URL Expiration – Configure custom expiration dates and times for shortened links.
- User Authentication & Ownership – Secure user signup, login, and private dashboard to manage links.
- URL Safety Verification – Built-in verification scanner checking URLs against suspicious keywords and blocked domains to prevent malicious links.
- Responsive React UI – Mobile-friendly dashboard built with React, Vite, and Tailwind CSS.
- Dockerized Development Environment – One-command local setup.
LinkLite follows a cache-aside architecture optimized for read-heavy redirect workloads.
- Incoming request checks Redis for the short code.
- Cache hits return immediately.
- Cache misses fall back to PostgreSQL.
- Results are stored in Redis for future requests.
- Click analytics are recorded asynchronously after the response is sent.
Redirect endpoints are highly read-intensive. A cache layer reduces database load and improves latency, while asynchronous analytics prevent click tracking from blocking redirects.
cd backend
python -m venv env
source env/Scripts/activate
pip install -r requirements.txt
uvicorn app.main:app --reloadBackend runs on:
http://localhost:8000
cd frontend
npm install
npm run devFrontend runs on:
http://localhost:3000
Run the full stack:
docker compose up --buildRedirect workloads repeatedly access the same URLs. Redis reduces database load and provides faster lookups for frequently accessed links.
Analytics writes do not need to block redirects.
Using BackgroundTasks keeps the architecture simple while removing analytics latency from the request path without introducing Kafka, RabbitMQ, or Celery.
URL mappings require durable storage, indexing, and transactional consistency. PostgreSQL provides all three with minimal operational complexity.
- Concurrent load testing
- p95 and p99 latency measurements
- Redis failure recovery strategies
- Distributed analytics pipeline
If you have suggestions, feedback, or would like to discuss system design and backend engineering:
- LinkedIn: https://www.linkedin.com/in/anshmnsoni
- GitHub: https://github.com/AnshMNSoni
- Reddit: https://www.reddit.com/user/AnshMNSoni
