Link Cutter is a lightweight, extensible URL shortener with basic analytics.
Built with FastAPI; links are stored in PostgreSQL. Intended as an MVP or a foundation for further development (custom domains, paid plans, webhooks, QR codes).
- Create short links (auto Base62 codes and custom codes)
- Redirect with 301
- Collect basic analytics: clicks, device/platform/browser (User-Agent parsing), referrer, geo (by IP)
- User and API key support
- Security: target URL validation (blocks local/dangerous addresses)
- Python 3.12
- FastAPI (ASGI)
- PostgreSQL (SQLAlchemy / Alembic)
- Pydantic
- Uvicorn (ASGI server)
- Loguru (logging)
- Docker / docker-compose
- Copy
example.env→.envand fill secrets. - Generate JWT keys (once):
mkdir -p certs
openssl genrsa -out certs/jwt-private.pem 2048
openssl rsa -in certs/jwt-private.pem -pubout -out certs/jwt-public.pem- Build and run:
docker compose up --build -dAPI: http://localhost:${API_PORT} (default 9000), health: /health.