🔗 URL Shortener https://url-shortener-blush-six.vercel.app/
A fast and lightweight full-stack URL shortener built with FastAPI, SQLite, and React. It converts long URLs into unique 6-character short links and tracks redirect statistics in real time.
- ✂️ Shorten URLs — Generate unique, collision-resistant 6-character short codes.
- 🔀 Fast Redirects — Redirect users instantly using HTTP 307 responses.
- 📊 Click Analytics — Track the number of visits for every shortened URL.
- Python 3.12+
- FastAPI
- SQLAlchemy
- Pydantic v2
- React
- CSS3
- SQLite
- Docker
- Multi-stage Docker Build
Build the Docker image:
docker build -f server/Dockerfile -t url-shortener .Run the container:
docker run -d \
-p 8000:8000 \
-v $(pwd)/server/shortener.db:/app/server/shortener.db \
--name url-shortener-app \
url-shortenerStop the container:
docker stop url-shortener-appRemove the container:
docker rm url-shortener-appOnce the container is running:
| Service | URL |
|---|---|
| 🌐 Application | http://localhost:8000 |
| 📚 Swagger UI | http://localhost:8000/docs |
| 📄 ReDoc | http://localhost:8000/redoc |
Navigate to the backend:
cd serverCreate a virtual environment:
python -m venv .venvActivate it.
Linux / macOS
source .venv/bin/activateWindows (PowerShell)
.venv\Scripts\Activate.ps1Install dependencies:
pip install -r requirements.txtStart the development server:
python app/main.py- URL shortening endpoint
- Redirect endpoint
- Click analytics
- React dashboard
- Search and filter links
- Copy-to-clipboard button
This project is licensed under the MIT License.