Giter Site home page Giter Site logo

weather_app's Introduction

WeatherApp

The assignment has the following requirements:

  • Must be done in Ruby on Rails
  • Accept an address as input
  • Retrieve forecast data for the given address. This should include, at minimum, the current temperature (Bonus points - Retrieve high/low and/or extended forecast)
  • Display the requested forecast details to the user
  • Cache the forecast details for 30 minutes for all subsequent requests by zip codes.
  • Display indicator if result is pulled from cache.

Assumptions

  • Imperial units (Fahrenheit, mph, etc)
  • US-only addresses (requirements indicate caching on zip code as opposed to postal code)
  • This project assumes you already have ruby install on your system. If not, please follow the instructions here:
Install Ruby with asdf
  • Install asdf
     sudo apt-get update
     sudo apt install autoconf bison build-essential libssl-dev libyaml-dev libreadline-dev zlib1g-dev libncurses-dev libffi-dev libgdbm-dev
     sudo apt install curl git
     git clone https://github.com/asdf-vm/asdf.git ~/.asdf --branch v0.8.1
    
  • call code ~/.bashrc to open your bash profile
  • add . $HOME/.asdf/asdf.sh and . $HOME/.asdf/completions/asdf.bash to the end of the file
  • add plugins and install ruby
     asdf plugin add ruby
     asdf install ruby latest
    
  • find the version you installed with asdf list ruby and set the version globally
     asdf list ruby
     asdf global ruby 3.2.2
    

Setup Instructions

  1. Install homebrew

    /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
    
  2. Install and start redis

    brew install redis
    brew services start redis
    
  3. Clone the repository

    git clone https://github.com/krodante/weather_app.git
    

    Note: I uploaded the master.key file to the repository in order for the assessment to be sent with only a single github link. I would not add this file in a true production environment, and instead would send it securely or use Vault secrets.

  4. Navigate to the project directy and install gems

    cd weather_app
    bundle install
    
  5. Run tests

    rspec spec
    
  6. Run server at localhost:3000

    rails s
    

Usage

Fetch current and forecast weather for a given address.

  • In the browser, navigate to the root url http://localhost:3000/
  • Enter any address
    • Address must contain a zip code. If there is no zip code, an error is returned.
  • Current and Forecast weather is shown on the weather/show page.
    • It's a lot of information! Each column is one day, and each row of a column is a 3-hour segment.
    • For example, if you search at 11pm on May 11, 2023, one column will have up to eight forecasts for May 12, 2023, with the timestamps 0:00, 3:00, 6:00, 9:00, 12:00, 15:00, 18:00, and 21:00
  • Click on the button or navigate back in the browser to return to the root url and search for another address.

Questions

Please feel free to contact me at [email protected] if you have any questions. Thank you!

weather_app's People

Contributors

krodante avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.