Skip to content

soham-shee/URL-Link-Shortener

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

URL Link Shortener

This is a URL Shortener, which leverages the use of fastapi for backend, mongodb for db, and redis for caching.

Features

  • MongoDB as DB
  • Redis for caching
  • Rate Limiting using IP Address

Run Locally

Clone the project

  git clone https://github.com/soham-shee/URL-Link-Shortener.git

Go to the project directory

  cd URL-Link-Shortener

Install dependencies

  source venv/bin/activate
  pip install -r requirements.txt

Start the server

  uvicorn app.main:app --reload

Environment Variables

To run this project, you will need to add the following environment variables to your .env file

MONGO_URL

REDIS_URL

BASE_URL

RATE_LIMIT

API Reference

Generates the short link of URL

  POST /shorten
Parameter Type Description
url json/string Any URL

Redirects to original URL

  GET /{short_id}
Parameter Type Description
short_id string short_id of the URL

Shows the info of URL and it's short_id

  GET /info/{short_id}
Parameter Type Description
short_id string short_id of the URL

Documentation

From localhost (using Swagger) - Documentation

About

URL Link Shortener - FastAPI, MongoDB, Redis

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages