Smol is a URL shortening service like tinyURL.
A URL Shortener Service is a tool designed to convert long URLs into shorter, more manageable links. These shortened links redirect users to the original web addresses.
A: Early 2024 my friends and I discovered a bug (feature?) in groupMe. If you make your name a link then content preview is activated whenever someone trys to "@" you.
There is a size limit for profile names however, so many of my friends and my favorite links would not work. To get around this limitation, I developed a tinyURL service to create a small enough URL such that it could be my profile name on GroupMe. The application is an API hosted on GCP cloud run built using FastAPI that sends a 302 redirect if the id of the url matches a record in a NoSQL database (Firestore).
-
URL Shortening: Convert a standard URL into a brief, unique link.
-
Redirection: Use the shortened link to redirect users to the intended original URL.
Example. The name in GroupMe is the URL to Rick Astley’s “Never Gonna Give You Up”. Trying to @ him results in the Youtube URL Content preview.
I wanted to make it so that whenever someone trys to @ me a gif hosted on giphy.com would show up. However the URL was too long for GroupMe to allow it.
Features:
- Python
- FastAPI - API Implementation
Backend:
- GCP Cloud Run - host server
- uvicorn - ASGI web server
- GCP Firestore - NoSQL database
Deployment:
- Docker
- GCP Artifact Registry - Docker Image Store for Cloud Run deployment
Follow these steps to set up your local development environment:
-
Clone the repository using:
git clone <repository-url>
-
Install the required packages by running:
pip install -r requirements.txt
-
Launch the service with:
uvicorn main:app --reload
Your local server should now be accessible at http://localhost:8000
.