What it does
A full-featured URL shortening service with: Short URL creation and redirect tracking Full REST API for users, URLs, and events Automatic service recovery after crashes Handles 500+ concurrent users with 0% error rate Redis caching for fast redirects Load balanced across multiple app instances
How we built it
Flask + Peewee + PostgreSQL Gunicorn: production WSGI server replacing Flask's dev server (8 workers per container) Nginx: load balancer distributing traffic across 2 app containers Redis: caching layer so repeated redirects skip the database entirely Docker Compose: orchestrates all services with restart: always for auto-recovery pytest + GitHub Actions: 42 tests at 71% coverage, CI blocks bad deploys k6: load testing to measure and improve performance
Challenges we ran into
Database sequence conflicts: manually seeding 2000+ records with specific IDs broke PostgreSQL's auto-increment sequences, requiring manual sequence resets Redis cache invalidation: when a URL was deactivated, Redis still served the old cached redirect. Had to invalidate the cache on every status change Gunicorn vs Flask dev server: Flask's single-threaded dev server caused 30% errors at 200 concurrent users. Switching to Gunicorn with 8 workers brought errors to 0% at 500 users Docker networking: getting Nginx, two app containers, Redis, and PostgreSQL to communicate correctly took careful configuration
Accomplishments that we're proud of
0% error rate at 500 concurrent users 42 passing tests with CI that automatically blocks broken code from reaching main
Log in or sign up for Devpost to join the conversation.