Build a URL-shortener service: create short codes for long URLs, redirect visitors, count clicks, and protect the management endpoints with an API key — with a test suite.
Project idea · ungraded
URL Shortener API
You will use
Milestones
Build the smallest working version first. Ticks are saved in this browser only.
Stretch goals
- Store links in SQLite instead of a dict.
- Allow custom codes and expiry dates.
- Rate-limit link creation per API key.
Data
None needed. For persistence, follow FastAPI's SQL databases tutorial.
Run it yourself
pip install fastapi uvicorn httpx
uvicorn shortener:app --reload