A modern URL shortening service built with FastAPI and SQLAlchemy.
- Shorten long URLs to easy-to-share links
- Create custom short codes
- Set expiration times for links
- One-time use links that self-delete after access
- QR code generation for shortened URLs
- Admin dashboard to track link usage
-
Clone the repository:
git clone https://github.com/yourusername/url-shortener.git cd url-shortener -
Create a virtual environment and activate it:
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
-
Install dependencies:
pip install -r requirements.txt
-
Configure your database in
config.ini -
Run the application:
uvicorn app.main:app --reload
-
Visit http://localhost:8000 in your browser
- Enter a URL in the input field and click "Shorten"
- Optionally set a custom code, expiration time, or one-time use flag
- The shortened URL will be displayed along with a QR code
- Visit the admin dashboard at http://localhost:8000/admin to see statistics
- FastAPI
- SQLAlchemy
- SQL Server
- Jinja2 Templates
- QR Code Generation
MIT