This repo is a practice project for making a URL shortener web app. Demo Video from Youtube
Three applications have to be run for this URL shortener web application to operate.
-
Dash app
This is the frontend of this web application, offering graphical user interface for users to generate shortened URLs. -
FastAPI endpoint
This is a RESTful API behind the scene that handles users requests to shorten a long URL or to visit the shortened URLs and be redirected to the corresponding long URLs. -
Redis cache
This is a RAM-based cache for storing recently accessed data. It runs within a Docker container using official Docker image redis/redis-stack.
This URL shortener is a REST API that serves two requests:
- URL shortening:
When users want to shorten a URL, they send an HTTP POST request to the API, whhich contains one parameter, the long URL to be shortened. The API then returns a shortened URL, which has a domain of the API server and a path that is a unique ID for the input URL.
For example: input_url = "https://google.com", output_url = "https://localhost/da1zH12R".
- Redirecting:
When anyone attempts to access any shortened URL with an HTTP GET request, the server changes the URL to the long URL stored in the server's database with 302 redirect status code.
- API Endpoints - FastAPI
- Cache - Redis
- Database - SQLite

