Skip to content

oryolo/weatherapp

Repository files navigation

Weather Service

This service provides information about the current weather and weather forecasts for a specific address (location, city, zip, etc.) requested by a user.

Development Setup

1 .Clone repository to your working directory with:

git clone git@github.com:oryolo/weatherapp.git 
  1. Install dependencies with:
bundle install
  1. Create config/master.key file and insert and save it with the master key secret that you were provided with.

  2. Setup the database with:

bundle exec rails db:setup
  1. Run the development server:
bundle exec rails s
  1. Now you can open a browser and navigate to http://localhost:3000 to use the service.

Development Notes

Data Providers

Data Modeling

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).

Service Classes

LocationLookup - tracks search requests and manages geo locations(using gem 'geocoder' and Geoapify API)

WeatherProvider - fetches weather data from the OpenWeather API.

Restrictions and limitations

  • Currently, only US addresses are supported.
  • Weather cache threshold is set to 30 minutes per geo location.

Running Tests

Run tests with the following command:

bundle exec rspec

Screenshots

Production Setup

TBD

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published