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.
- Address suggestions are provided by Mapbox API
- Weather details are provided by Weather API
- Weather data is cached by zip code for 30 minutes
- Ruby 3.0.2
- Rails 7.0.5
- Bundler 2.2.22
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.
If the caching of weather data does not appear to be working, you may need to run rails dev:cache
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