The goal of this exercise is to create a URL shortener web application in the same vein as bitly, TinyURL, or the now defunct Google URL Shortener.
- When navigating to the root path (e.g.
http://localhost:8080/) of the app in a browser a user should be presented with a form that allows them to paste in a (presumably long) URL (e.g.https://www.google.com/search?q=url+shortener&oq=google+u&aqs=chrome.0.69i59j69i60l3j0j69i57.1069j0j7&sourceid=chrome&ie=UTF-8). - When a user submits the form they should be presented with a simplified URL of the form
http://{domain}/{slug}(e.g.http://localhost:8080/h40Xg2). The format and method of generation of the slug is up to your discretion. - When a user navigates to a shortened URL that they have been provided by the app (e.g.
http://localhost:8080/h40Xg2) they should be redirected to the original URL that yielded that short URL (e.ghttps://www.google.com/search?q=url+shortener&oq=google+u&aqs=chrome.0.69i59j69i60l3j0j69i57.1069j0j7&sourceid=chrome&ie=UTF-8).
- Source Code.
- Makefile.
- Other Notes: I was trying to automate database installation but could not complete due to time constraint. Please follow these process to build and run the application.
- Install MySQL 8 if its not already installed. Create database BLOGS.
- Run the attached script: shortener.sql to create the ShortLink table.
- Edit the provided config.json file with database credentials.
- Test by running:
make test
- Run the application by executing command:
make server
- Golang
- MySQL
- Vue.js
- Html, CSS, Javascript
- Technical design - API REST/JSON Driven. Persistence, Service, Model, Commons, modules -- Note on the Database- Requires MySQL Server 8 to be installed on the host machine as well as Go 1.15 The test contains both unit and integration tests involving database. Test coverage is 68.1% with no db. 78% with database configured.