lerna

Weather forecast monorepo

What is it

Is full stack exercise for General Assembly SEI (Español 🇪🇸 ) students.

Is an application that provide 7 days weather forecast for a given location

The structure of this repo is following principles of monorepo

It is divided in two main packages

  • Server: A simple Express server that receive GET request to /forecast?city=Madrid would return a JSON payload with a weekly forecast of a given location.
  • Client A simple React application that render 7 days weather forecast for a given location

How to install

  1. Clone this repo
git clone git@github.com:pataruco/weather-forecast-monorepo.git
  1. Navigate to the folder weather-forecast-monorepo
cd weather-forecast-monorepo
  1. Install dependencies
yarn

How to run

Locally

Please run the following commands in different console tabs

  • To run the API server, type:
yarn workspace server start
  • To run the React server, type:
yarn workspace client start

How to deploy

Server

  1. Login into heroku

    heroku login
  2. If you are not tet created an herku folder for this app, run the following, otherwise step this

    heroku create --region=eu
  3. Deploy

    git push heroku master
  4. Once is deployed and functional take the URL of the app and added as a value of the REACT_APP_SERVER_URL on .env.production

# ./client/.env.production
REACT_APP_SERVER_URL='https://hipster-name.herokuapp/forecast'

Client

  1. Create a react production build

    yarn workspace client build
  2. Deploy to Netlify

    netlify deploy