Development2024
URL Shortener
Link shortening API with redirects and click analytics
Role
Fullstack developer
Year
2024
Stack
NestJSTypeScriptPostgreSQLPrismaDockerREST API
The task
Design a small but real backend service: generate collision-free short codes, redirect with minimal latency, count clicks accurately under concurrent load, and stay easy to deploy anywhere.
Stages
01
API design
REST endpoints with DTO validation, OpenAPI docs out of the box, and predictable error semantics.
02
Data layer
PostgreSQL with Prisma; atomic increment for click counting so concurrent redirects never lose a click.
03
Shipping
Docker Compose for one-command local start, environment-driven config, ready for any container host.
The results
<10ms
redirect latency
100%
typed request/response contracts
1 cmd
to run the whole stack locally