The Weather Forecast App is a Rails application that allows users to enter an address to retrieve and display a seven-day weather forecast. The app uses the Geocoder gem to convert addresses into geographic coordinates and a weather API to fetch forecast data based on these coordinates.
- Address-based weather search
- Display of daily weather forecast including temperature highs and lows, sunrise and sunset times, and precipitation probabilities
- Caching of forecast data to reduce API calls and improve response times
- Ruby Version: Ruby 3.0.0 or higher
- Rails Version: Rails 6.0.0 or higher
- System Dependencies:
- PostgreSQL: For database management
- Redis: For caching weather data
- Sidekiq: For background job processing
-
Clone the repository:
git clone https://yourrepository.com/weather_forecast_app.git cd weather_forecast_app
-
Install dependencies:
bundle install
-
Setup environment variables:
WEATHER_API_KEY
: Key for accessing the weather API.
-
Create the database:
rails db:create
-
Run migrations:
rails db:migrate
-
Seed the database (if applicable):
rails db:seed
Run the following command to execute the tests:
rails test
- Job Queues: Sidekiq is used for processing background jobs such as asynchronous API calls to fetch weather data.
- Cache Servers: Redis is utilized as a cache server to store the weather data temporarily and reduce the load on the weather API.
- Search Engines: Not applicable unless integrated for address searching capabilities.
-
Set up Heroku:
- Create a Heroku account and log in.
- Install the Heroku CLI and log in through the CLI.
-
Create a new Heroku app:
heroku create
-
Add buildpacks:
heroku buildpacks:set heroku/ruby heroku buildpacks:add --index 1 heroku/nodejs
-
Configure environment variables on Heroku:
heroku config:set WEATHER_API_KEY="your_api_key_here"
-
Deploy the application:
git push heroku master
-
Run migrations on Heroku:
heroku run rails db:migrate
-
Monitor logs:
heroku logs --tail
For additional help or feedback, you can contact Bill Kohler. bkohler4 [at] gmail [dot] com