A modern, full-stack URL shortener service with a responsive web interface and robust API. Built with FastAPI backend and Next.js frontend, featuring QR code generation, click tracking, and expiration management.
- URL Shortening: Create short, memorable links from long URLs
- Flexible Expiration: Set custom expiration times (1h, 6h, 24h, 7d, 30d, 365d, or indefinite)
- Smart Redirects: Automatic redirection to original URLs with click tracking
- QR Code Generation: Generate QR codes for easy mobile sharing
- Analytics: Track click counts, creation times, and expiration status
- Responsive Frontend: Modern web interface built with Next.js and shadcn/ui
Request body:
{
"original_url": "https://example.com",
"expires_in": "1h" // Options: 1h, 6h, 24h, 7d, 30d, 365d, never
}- FastAPI - Modern, fast web framework for building APIs
- SQLAlchemy (async) - Powerful SQL toolkit and ORM
- PostgreSQL - Robust relational database
- Pydantic - Data validation using Python type annotations
- Alembic - Database migration tool
- Uvicorn - Lightning-fast ASGI server
- Next.js - React framework for production-grade applications
- shadcn/ui - Modern, accessible component library
- TypeScript - Type-safe JavaScript development
- Tailwind CSS - Utility-first CSS framework
- Docker - Containerized development and deployment
- Railway - Cloud deployment platform
- uv - Fast Python package manager
- GitHub Actions - Continuous integration and deployment
- Ruff - Fast Python linter and formatter
- mypy - Static type checker for Python
- pytest - Testing framework with coverage reporting
- pre-commit - Git hooks for code quality enforcement
The application is deployed on Railway with automatic deployments from the main branch. The CI/CD pipeline includes:
- Continuous Integration: Automated testing, linting, and type checking on every PR
- Continuous Deployment: Automatic deployment to production on merge to main
- Database Migrations: Automatic migration execution during deployment
- Create responsive frontend
- Add pagination
- Use environment variables
- Add tests
- Use ruff and mypy
- CI/CD setup
- Deploy the app
- Add error handling improvements
- Implement rate limiting
- Add admin key, admin dashboard
- Add bulk shortening
- Add country/ip tracking