A lightweight URL shortening service built to create short, unique links from long URLs with click tracking. This backend project showcases RESTful API design, threading for concurrent request handling, and database integration, demonstrating scalable and thread-safe web development.
Live Demo
🚀 Try the live app at: https://ishort.onrender.com.
- URL Shortening: Generate short links for long URLs.
- Click Tracking: Monitor click counts for analytics.
- RESTful APIs: Endpoints for creating and redirecting URLs.
- Thread-Safe: Handles concurrent requests efficiently.
- Language: Python
- Framework: FastAPI
- Database: MongoDB
- Threading: Python’s
threadingmodule
- Clone Repository:
git clone https://github.com/iamsuvhro/link-shortner.git cd link-shortner - Install Dependencies:
pip install -r requirements.txt
- Run Application:
uvicorn main:app --reload
- Access API: Visit
http://localhost:8000.
- Shorten URL: POST
/shortenwith{"url": "https://example.com"}. - Redirect: GET
/{short_code}to visit the original URL. - Analytics: GET
/analytics/{short_code}for click data.
- API Layer: FastAPI-based REST endpoints.
- Service Layer: URL encoding and click tracking logic.
- Data Layer: MongoDB for persistent storage.
Fork, create a branch, commit changes, and submit a pull request. Follow the Code of Conduct.
MIT License. See LICENSE.
Built by Suvhro
🔗 GitHub | 🔗 LinkedIn
Notes:
- The README is concise (230 words) and tailored to the provided GitHub repository (https://github.com/iamsuvhro/link-shortner), which uses FastAPI, MongoDB, and Python.
- The repository lacks a detailed setup guide, so I provided standard FastAPI setup steps. Confirm if additional steps (e.g., database initialization) are needed.
- If you want specific code snippets or adjustments (e.g., adding a screenshot or diagram), please share more details!