Live Link: https://just-ly.herokuapp.com/
WARNING: Do not use this application to save all of your URLs. There is no data persistence in this free Redis plan. Your links will expire.
The following design will be implemented in this microservice with a few exceptions. Rather than creating multiple servers, to keep it at a smaller scale, makeshift microservices will be created using different files and functions. Although, future developments will allow a creation of the system architecture with multiple microservices, and load balancing.
In accordance to the system design there are several technologies that we are using to interact with one another, and to manipulate the flow of fate. The following technologies that are going to be used are:
Though some ES6 is used such as destructuring and arrow functions, the most notable use of this is ES7's async and await to promote cleanliness in the syntax.
This is used on the client side, and is actually using a CDN online. This is to make requests to the server with the input entry.
This is used to validate whether or not a website is valid. I've tried other modules that do the same thing, but there are some valid website entries that were marked as invalid. This particular module has been the most reliable one.
NOTE: This module only evaluates the syntax of your website, it does not send a request checking whether or not there is a 404 error.
This is a middleware used in order to parse and populate the request with either the body, params, or query property (depending on the request) in order to promote cleanliness and convenience in the code.
This is used to promisify the Redis methods (which are asynchronous), and utilize async and await from ES7 to simplify the Express callbacks and treat everything as if it was synchronous.
This will be the backbone of our service, we will have two routes, two GET requests that serve different functions. One is to create the URL, and the other is to serve using the shortened URL.
We will be using the key-value function of this cache/store to store/acquire our URL using the shortened ID as our key. In order to use in the internet, a third-party Redis server might be needed. Redis Labs is going to be used to complete this project
This will be our endpoint generation for the shortened url, and our key for the actual url to be stored in Redis.