Simple Weather App to search for forecasts.
Built with Ruby on Rails 8, Bootstrap 5, Bootstrap Icons, RSpec, Capybara.
Powered by WeatherAPI
- Ruby version 3.3.x or 3.4.x
- git
- postgresql (might remove this dependency since the db isn't really needed at this time)
- create an account with WeatherAPI to obtain an API key
- Install Ruby version 3.3.x or 3.4.x with your package manager of choice (system, rvm, rbenv, homebrew, aptitude, etc.)
$ gem install bundler # install bundler (ruby app gem manager)
$ git clone https://github.com/jayywolff/weather-app.git # download the project with git clone
$ cd ./weather-app # set your working directory to the project root
$ bundle install # install ruby gem dependencies
$ bundle exec rails db:create # create dev/test databases
$ bundle exec rails dartsass:build # compile stylesheets (scss)
$ export WEATHER_API_KEY=mysecretkey # SET a local ENV var with your personal API key obtained from WeatherAPI
optional if you dont want to set the WEATHER_API_KEY ENV var everytime you run the app/tests in a new terminal
# add your WeatherAPI key in the rails credentials
# entry should be in yml format, for example: `weather_api_key: mysecretkey`
$ bundle exec rails credentials:edit --environment development
# add a WeatherAPI key in the rails credentials for the test env
# entry should be in yml format, for example: `weather_api_key: mysecretkey`
# tests don't actually hit the api, so this can be any string value
$ bundle exec rails credentials:edit --environment test
$ bundle exec rails server # start up the dev server
Open localhost:3000 in your browser
$ bundle exec rspec