This is a URL Shortener, which leverages the use of fastapi for backend, mongodb for db, and redis for caching.
- MongoDB as DB
- Redis for caching
- Rate Limiting using IP Address
Clone the project
git clone https://github.com/soham-shee/URL-Link-Shortener.gitGo to the project directory
cd URL-Link-ShortenerInstall dependencies
source venv/bin/activate
pip install -r requirements.txtStart the server
uvicorn app.main:app --reloadTo run this project, you will need to add the following environment variables to your .env file
MONGO_URL
REDIS_URL
BASE_URL
RATE_LIMIT
POST /shorten
| Parameter | Type | Description |
|---|---|---|
url |
json/string |
Any URL |
GET /{short_id}
| Parameter | Type | Description |
|---|---|---|
short_id |
string |
short_id of the URL |
GET /info/{short_id}
| Parameter | Type | Description |
|---|---|---|
short_id |
string |
short_id of the URL |
From localhost (using Swagger) - Documentation