This service provides information about the current weather and weather forecasts for a specific address (location, city, zip, etc.) requested by a user.
1 .Clone repository to your working directory with:
git clone git@github.com:oryolo/weatherapp.git
- Install dependencies with:
bundle install
-
Create
config/master.key
file and insert and save it with the master key secret that you were provided with. -
Setup the database with:
bundle exec rails db:setup
- Run the development server:
bundle exec rails s
- Now you can open a browser and navigate to http://localhost:3000 to use the service.
- OpenWeather API documentation
- GeoApify API documentation
SearchRequest
- stores user requests as a normalized string(downcased, stripped).
Location
- stores geo coordinates, city name, state, and other geo properties.
WeatherRecord
- stores fetched current weather data and used as a cache store.
WeatherForecast
- stores weather forecast data (requires a premium subscription to OpenWeather API).
LocationLookup
- tracks search requests and manages geo locations(using gem 'geocoder' and Geoapify API)
WeatherProvider
- fetches weather data from the OpenWeather API.
- Currently, only US addresses are supported.
- Weather cache threshold is set to 30 minutes per geo location.
Run tests with the following command:
bundle exec rspec
TBD