Skip to content

agus-prayitno/weather-react

Repository files navigation

weather-react

Overview

A simple weather application which shows the current weather and hourly forecasts based on the current geolocation of accessing device.

Prerequisites

Basic Environment

The following software is required to be installed on your system:

  • Node 10.x
  • Npm 6.x

Type the following commands in the terminal to verify your Node and Npm versions.

node -v
npm -v

External APIs

  1. Get API keys

  2. Setup environment variables

    It is required to setup a few environment variables that are used by the WeatherService and GeolocationService to authenticate against the above external APIs.

    Please follow the following steps:

    • Add '.env' file

      Create a file called '.env' at the root of the application.

    • Add environment variables to '.env' file

      GOOGLE_GEOLOCATION_API_KEY=PUT_YOUR_API_KEY_HERE OPEN_WEATHER_API_KEY=PUT_YOUR_API_KEY_HERE

    • Add dotenv-webpack setting into Webpack config files

      The config files can be found by typing the following command in the terminal.

      ls node_modules/react-scripts-ts/config/ | grep webpack.config

    For more information about '.env', please visit dotenv-webpack.

About

Sample weather app using React

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published