see it in action at https://cg-shrturl.herokuapp.com/
- Ruby 3.0.2
- Rails 6.1.4
- Rspec 5
- Postgres 14.1
- Redis 6.2.5
- Sidekiq 6.3.1
Options:
- install and run Docker
- run
docker-compose run web rake db:create db:migratein the project root directory - run
docker-compose upto boot the web server - access web app at http://localhost:3000
- install dependencies as per Stack
- set database environment variables (see
database.yml):DATABASE_HOSTDATABASE_USERNAMEDATABASE_PASSWORD
- run
rake db:create db:migrate - run
foreman start(see.foremanfor default configuration) - access web app at http://localhost:3000
- set config vars as found in
.env.sample
This project uses Geocoder to geocode ClickEvent from IP Addresses, which relies on a free 3rd party API.
This API has rate limits, and if there is a high rate of click events it may exceed the quota.
Currently the project handles it by attempting the geocode lookup after a delay, which assumes that it was just a spike in clicks. However, if the overall traffic increases, we will need to either upgrade to a paid API, or fallback to alternative APIs or a local database lookup.