An application developed in Ruby. It accomplishes URL shortening and redirection from shortened URLs. With shortest possible length.
This template currently works with:
- Ruby 2.6.0
- Rails 5.2.3
- Sidekiq
- PostgreSQL
Project details
- Strategy:
- Take the ID in the database of the URL and then convert it to either Base 36 [a-z0-9] (case insensitive) to generate shortened URL;
- I used ActiveJob to perform the title search in the background;
- I used gem Faker to populate the database for the Top 100 board;
- Performed Model, Request and Acceptance tests.
- Repository: https://github.com/luiseugenio/shortenerofluis
- Production server on Heroku:
- Host: https://vast-thicket-11159.herokuapp.com/
- Configuration File: Procfile
To execute in development mode:
rake db:create
rake db:migrate
rake db:seed
rspec spec
cucumber
rails s
To promote in production mode:
git push heroku master
- The database supported by this app is
postgresql
.
The app will perform this actions:
- Index
get https://vast-thicket-11159.herokuapp.com/
- Generate Short URLs
get https://vast-thicket-11159.herokuapp.com/short_urls/new
- Un-Short Shortened URLs
get https://vast-thicket-11159.herokuapp.com/:shortened_url
- Show TOP 100 most visit links
https://vast-thicket-11159.herokuapp.com/short_urls/top_100
- Utilities
- sidekiq – Redis-based job queue implementation for Active Job
- faker – A library for generating fake data such as names, addresses, and phone numbers.
- bootstrap – Build responsive, mobile-first projects on the web with the world's most popular front-end component library
- mechanize – Mechanize is a ruby library that makes automated web interaction easy
- Testing
- capybara – Acceptance test framework for web applications
- database_cleaner – Strategies for cleaning databases in Ruby.
- cucumber-rails – Rails Generators for Cucumber with special support for Capybara and DatabaseCleaner
- factory_bot_rails – is a fixtures replacement with a straightforward definition syntax, support for multiple build strategies
- shoulda-matchers – Simple one-liner tests for common Rails functionality