This is a simple URL Shortener service built as a microservice. It maps a short-form URL ("Short URL") to a user-provided target URL ("Target URL"), similar to services like bit.ly and tinyurl.com. It also provides a simple usage report for the application where it tracks the number of clicks, originating geolocation and timestamp of each visit to a Short URL.
You can access the deployed application at https://url-shortener-assessment-2a1611018c4a.herokuapp.com
- Ruby (version 3.x)
- Rails (version 7.x)
- PostgreSQL (version 16)
-
Clone the repository:
git clone https://github.com/leonjensentan/url-shortener-assessment.git cd url-shortener
-
Install Dependencies
bundle install
-
Set up the database: Make sure you have PostgreSQL installed and running. Then run:
rails db:create rails db:migrate
-
Run the server
rails s
-
Visit the Application Open your browser and go to http://localhost:3000
- PostgreSQL : RDBMS for the web application
- Geocoder : IP address geocoding
- Nokogiri : DOM Parser for HTML
- FactoryBot : For Test Data
- TailWind CSS : CSS framework for rapid UI development
To run the tests, use the following command:
bundle exec rspec