Inspiration Modern apps live or die by their reliability under load. We wanted to build a production-grade URL shortener that doesn't just work — but works correctly at scale, with observability baked in from day one. The challenge of making a deceptively simple service production-ready inspired us to go deep on every layer.

What it does Squel is a high-performance URL shortener API built for production. It lets users create short links, track click events, and manage users — all through a clean REST API. It supports bulk CSV data loading, paginated list endpoints, structured JSON logging, Prometheus metrics, and a /health endpoint for uptime monitoring.

How we built it We built Squel on a Flask + PostgreSQL stack with SQLAlchemy ORM, containerized with Docker Compose. The app ships with structured JSON logging via python-json-logger, system metrics via psutil, and Prometheus instrumentation. Data seeding from CSV files happens automatically on startup so the service is immediately ready with real data.

Challenges we ran into The biggest challenge was the async-to-sync migration — the original template used FastAPI with asyncpg, but the evaluation environment required Flask with synchronous SQLAlchemy and psycopg2. Getting the response formats exactly right (the {"kind": "list", "sample": [...], "total_items": N} envelope) took several iterations. Managing seed data vs. test data collisions — where seeded users conflicted with evaluator-created test users — was a subtle but critical bug to track down.

Accomplishments that we're proud of Passing 24+ out of 29 evaluator tests in a live hackathon environment

Clean structured JSON logging with request IDs on every response

Fully working bulk CSV import with upsert semantics

A /metrics endpoint returning live CPU, memory, uptime, and request count

Docker Compose setup with Postgres, Redis, and the app all wired together

What we learned Production engineering is 10% writing code and 90% making it observable, resilient, and debuggable. We learned how critical it is to match exact API contracts — a wrong field name (loaded vs imported) or wrong status code (200 vs 201) can fail a test even when the logic is perfect. We also learned how seed data and test isolation interact in shared database environments.

What's next for Squel Complete the remaining evaluator tests (29/29 target)

Add Redis caching for hot short codes to reduce DB load

k6 load testing to validate p95 latency under 200 concurrent users

Grafana + Loki dashboard for the four golden signals (latency, traffic, errors, saturation)

Rate limiting per user to prevent abuse

Share this project:

Updates