Made simply and with few functions, the project consists of shortening a long URL submitted by the user. Furthermore, this repository contains solution design, ORM mapping, use of third-party libraries, use of GIT and creativity.
The project consist in two cases:
- Shorten URL
- Retrieve URL
- User submits a long URL
- API generates a short URL by randomizing characters in the range [A-Z], [a-z], [0-9], bringing the possibility of 62^7 shortened URLs
- Checks whether the long URL exists in cache (we can use Redis, for example). If yes, retrieve it from the cache. If not, add the two URLs (long and short) and their respective hash to the database.
- Returns the shortened URL to the user