Jun 23, 2025 · experiment
Shorty
A full-stack URL shortener built with Clean Architecture on both backend and frontend, with robust auth, rate limiting, analytics-ready URL workflows, and QR generation.
- FastAPI
- Python
- SQLAlchemy
- Redis
- React
- Vite
- TypeScript
- Zod
- Pytest
- Vitest
> details
I designed and implemented this as an end-to-end solo project, focusing on architecture quality, API ergonomics, and practical production concerns like request tracing, rate limiting, and compatibility-safe API versioning.
Highlights
- Implemented Clean Architecture boundaries across backend (
domain,application,infrastructure,presentation) and frontend (domain,application,infrastructure,presentation) to keep business logic isolated from frameworks. - Shipped a complete authentication lifecycle with register, login, refresh, logout, email confirmation, resend confirmation, forgot password, and reset password flows.
- Added token refresh via secure HTTP-only cookies and endpoint-level rate limiting for sensitive auth and reset operations.
- Built URL management workflows for create, list, redirect, and delete, including ownership and expiration checks.
- Exposed compatibility-safe route prefixes (
/api/v1and legacy/v1) to support smooth frontend integration during migration/refactor phases. - Added Redis-backed global rate limiting and request ID middleware for better abuse protection and traceability.
- Implemented QR code generation endpoints for shortened and custom URLs with PNG/SVG/JPEG output, configurable size/error correction, and cache-aware response headers.
- Added broad integration journey coverage (auth, URL shortening, password reset, QR flows) and frontend contract validation tests to reduce backend/frontend drift.
Overview
Shorty is a full-stack URL shortener where the main focus was not just shortening links, but shipping a codebase that stays maintainable under growth.
I built both backend and frontend around Clean Architecture so core business rules remain portable and testable while framework details stay at the boundaries.
Architecture Direction
On the backend, the app is split into domain, application, infrastructure, and presentation layers. On the frontend, I mirrored the same architectural idea so UI concerns do not leak into business workflows.
This made it easier to evolve auth, URL rules, and API contracts without large rewrite pressure.
URL And Auth Capabilities
The product includes:
- End-to-end auth (register/login/refresh/logout)
- Email confirmation and resend paths
- Forgot/reset password lifecycle
- URL creation, listing, deletion, and slug redirect handling
For compatibility and migration safety, API routes are exposed under both /api/v1 and /v1.
Reliability And API Quality
I added Redis-backed rate limiting for high-risk routes and request ID middleware to improve debugging and observability. Error handling is normalized through presentation-layer exception mapping so API responses stay predictable.
QR Code Surface
I implemented QR endpoints that can generate codes for either shortened links or custom URLs with format and sizing controls. This turns the short-link feature into a more practical sharing tool instead of a plain redirect utility.
Testing Strategy
The codebase includes integration journeys and contract-focused validations to keep backend and frontend assumptions aligned, especially around auth and URL response shapes.
Why This Project Matters
Shorty represents how I approach product engineering in everyday systems: clear boundaries, practical reliability controls, and a stable API surface that can evolve without breaking clients.