Estimation :
-Method -> Post
-URL --> /api/short/:url
-Params --> url
-Method --> Get
-Url -> /api/redirect/:url
-Params -> url
ShortageUrl -> id : string, long_url: string , short_url: string, CreateedAt: Date
the main components in this system are :
the main modules
The First Request is to create the Short URL :
the client send the long URL to server and server process it and store the long and short URL and store them in he database
the second one is to redirect the user to the original URL :
the clcint already has has the short URL and he click on it so access the server to redirect the user to the origin al URL based on the shortage URL
and this system ahas cahning feature to fast the redirect process for the user and also has the loadbalaincer to distribute the requests for many nodes or pods or servers to increase the performance
this ystem ahs tow components or modules one for creating and another for the redirect the user
The first One for Create the shortge Url :
the user send to server the long URL the server use alogright to create short URL and this URL not replication for any user and store them in the database e and return it to user
the second one for redirect the user to the original Ulr
the user access the endpoint and send to server the short URL as a params the module take to this URL chack if exist or not if yse redirect the user to origin al URL if not return the user not found result
Frontend : ReactJs --> Trad of -> make the SEO week
Backend : NestJs --> Trad offs --> diffult to learn
Database : PostgreSQL
Caching : Rddis
Load balaincer: NGINX
Hosting: AWS or Hostinger