Skip to content

A Rails 7 app that allows a user to look up the current and forecasted weather for a location by using Mapbox API and Weather API

Notifications You must be signed in to change notification settings

danwa5/weather-forecaster

Repository files navigation

Screenshot

Weather Forecaster

This is a Rails 7 app that allows a user to look up the current and forecasted weather for a location. A location can be a specific address, a point of interest, or a zip code. Upon typing the address, the app will look up address suggestions from Mapbox API and display them below the search field. The user can select an address to get weather details.

Features

  • Address suggestions are provided by Mapbox API
  • Weather details are provided by Weather API
  • Weather data is cached by zip code for 30 minutes

Dependencies

  • Ruby 3.0.2
  • Rails 7.0.5
  • Bundler 2.2.22

Troubleshooting

Environment variables

The MAPBOX_API_ACCESS_TOKEN and MAPBOX_API_URL environment variables are required to fetch address suggestions from Mapbox API. The WEATHER_API_URL, WEATHER_API_KEY, and WEATHER_API_HOST env variables are required to access Weather API.

Create a .env file and set these variables. Refer to .env.sample as an example.

Caching

If the caching of weather data does not appear to be working, you may need to run rails dev:cache

Tests

Run full test suite and the test coverage will appear on the last line:

$ bundle exec rspec

To see test coverage details:

$ open coverage/index.html

To see any linting errors:

$ rubocop

About

A Rails 7 app that allows a user to look up the current and forecasted weather for a location by using Mapbox API and Weather API

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published