The URL Shortener application is a web-based service designed to help users generate short and shareable URLs from longer links. In addition to providing shortened URLs, the application also tracks usage statistics, such as the number of clicks, originating geolocation, and timestamp for each visit to a short URL.
Follow these steps to install and run the URL Shortener application:
- Git
- Node.js (version 14.x or higher)
- Ruby (version 3.x or higher)
- Rails (version 7.x or higher)
- PostgreSQL (version 9.x or higher)
-
Clone the repository into local machine using the following git command:
git clone https://github.com/JacksonTai/url-shortener.git
-
Change directory to
url-shortener
and install the dependencies (Gem):cd url-shortener bundle install
-
Setup the database creation and migration using the following rails commands separately:
rails db:create
rails db:migrate
-
Start the web server using the following rails command:
rails server
The URL Shortener application relies on the following dependencies (Gem):
- nokogiri: HTML/XML parser and searcher
- geocoder: Complete geocoding solution for Ruby
- rspec-rails: RSpec testing framework for Rails 5+
- factory_bot_rails: Test data creation library for Rails
The test suite includes test cases for models, run the test suite using the following command:
rspec models
This command will run all tests for models using the rspec-rails and display the test results in the terminal.