URLShortener

URL shortening is used to create shorter aliases for long URLs. We call these shortened aliases “short links.” Users are redirected to the original URL when they hit these short links. Short links save a lot of space when displayed, printed, messaged, or tweeted. Additionally, users are less likely to mistype shorter URLs. Url shortener service is used to share shortened url via SMS or link via mail. URL shortening is used for optimizing links across devices, tracking individual links to analyze audience and campaign performance, and hiding affiliated original URLs.

In this project, I have created URLShortener - a service which will primarily shorten url for a given long url and give long url for a short url.

Requirements

This URL shortening system ensembles following requirements:

Technical Specifications

URLShortener service utilises following technologies for the development and proper functioning:

System APIs

System will follow REST API nomenclature for defining APIs. Following table shows the list of APIs which are defined in the NanoURL system.

POST - /url

	* Input Request-Body JSON { “longUrl”: String }
	* Output JSON { “shortUrl”: String, “longUrl”: String }
	* Service createUrl (newUrl)

GET - /url

	* Input Request-Param(“shorturl” - String)
	* Output String (long url)
	* Service getLongUrl (shortUrl)

DELETE - /url

	* Input NA
	* Output NA
	* Service removeOldUrls ()

GET - /report

	* Input Request-Param (“date” - String) [ format: dd-mm-yyyy ]
	* Output JSON { “numTotalClicks”: Number, “numUniqueClicks”: Number, “numShortUrlCreated”: Number, “numLongUrlAdded”: Number}
	* Service getReportByDate ()

POST - /report

	* Input NA
	* Output JSON { “numTotalClicks”: Number, “numUniqueClicks”: Number, “numShortUrlCreated”: Number, “numLongUrlAdded”: Number}
	* Service generateReport ()