/forecast

a sample Rails app that fetches and caches weather forecast data by ZIP

Primary LanguageRuby

README

This is a simple Rails app that gets current weather conditions as well as hourly and extended forecast by the supplied address. It uses weather.gov APIs and will cache conditions by ZIP code for 30 minutes. Development is done with Docker.

Getting Started with Docker

  1. Install Docker Desktop

  2. Clone the repository

git clone ssh://git@github.com/michaelirick/forecast
cd forecast
  1. Build the Docker image
docker-compose build
  1. Create the database
docker-compose run forecast rake db:create
  1. Run the migrations
docker-compose run forecast rake db:migrate
  1. Start the server
docker-compose up
  1. Visit the site at http://localhost:8010

  2. Run the tests

docker-compose run -e "RAILS_ENV=test" forecast rails db:create db:migrate
docker-compose run -e "RAILS_ENV=test" forecast rspec

About

I originally started on this application in 2021 when applying to Apple. I was passed on the position, but now have another opportunity to work with them. For my second attempt, I decided to revisit this project and make it better with some of the techniques and technologies I have since learned. I have added more tests to the cover the acceptance criteria with VCR mocking of the external API, improved the UI with React and Semantic-UI, and added Docker for development.