The Weather App is a Ruby on Rails application that fetches weather data based on a ZIP code. It utilizes caching to store results and optimize API calls, ensuring faster responses for repeated requests.
- Fetches weather data using an external API.
- Caches responses to reduce redundant API calls.
- Implements RSpec tests for validation.
Ensure you have the following installed:
- Ruby 3.2.2
- Rails 7.x
- Bundler
-
Clone the repository:
git clone https://github.com/yourusername/weather-app.git cd weather-app
-
Install dependencies:
bundle install
-
Set up the environment variables: Create a
.env
file in the root directory and add your API key:WEATHER_API_KEY=your_api_key_here
You may need to use
dotenv
gem to load environment variables. -
Run the server:
rails server
Access the app at
http://localhost:3000
.
To run RSpec tests, use:
rspec
To deploy the application, ensure your environment variables are correctly set in the production environment, and follow standard Rails deployment procedures.