Skip to content

dsaw/weatherman-react

Repository files navigation

WeatherMan React

Build Status Open Source Helpers

A minimalistic weather forecast app made in React.

Access it here. You can search by typing any location to get daily forecast & location map

Features

  • 7 day forecast plus 4 times a day feels like temperature.
  • Map snippet - show location with cloud, wind, temperature layers.
  • Uses OpenWeatherMap to fetch the forecast/layers & OpenStreetMap for the map tiles.

Getting Started

Basic Setup

Fork the repository & use the master branch

Install packages

yarn install

Start development

yarn start

Open http://localhost:3000. After changes are done, run:

yarn lint
yarn prettify

Proxy

Accessing 3rd party API requires a CORS proxy. Have used cors-anywhere running on Heroku

To setup your own, clone this repo & run:

git checkout weather-proxy
heroku create

API key

You'll need to export on the proxy environ after obtaining the key from OWM.

OWM_API_KEY=*YOUR_KEY*

Challenges

  • All free API services don't have hourly forecasts. OpenWeatherMap has released a one call API with 7-day forecast but only 48 hour hourly forecast.
  • Tried out MetaWeather in v0.1 which is good. There were issues though - one was time zones were incorrect.
  • For search, Algolia API had been used which fetches list of latitudes & longitude. The actual data came from MetaWeather, which returns locations based on 'where on earth ids' so another API call has to be made to search the possible list of locations closest to the location parameters. This was unreliable with results sometimes coming from neighbouring countries.

Attribution

Contact

Built by Devesh!

Support my work

For feedback, questions or just anything email on: [email protected]

License

  • GNU GPLv3 Copyright (c) Devesh Sawant 2020.