Code Monkey home page Code Monkey logo

five-day-weather's Introduction

Build Status

Five Day Weather

This project was bootstrapped with Create React App.

Demo.

Description

A single page HTML app displaying the last five days of data provided by the OpenWeatherMap API.

Frontend

  • React: a facebook library to build user interfaces.
  • Redux: predictable state container for JavaScript apps.
  • React Bootstrap: React library for the Bootstrap framework.

Dev Stack

  • Babel: An es6/es7 compiler.
  • Eslint: The pluggable linting utility for JavaScript and JSX.
  • Flow: A Static Type Checker for JavaScript.
  • Jest: JavaScript testing framework.
  • Webpack: module bundler for the browser.

Setup

Assuming node and yarn (or npm) is already installed.

https://github.com/RichardWithnell/five-day-weather.git
cd five-day-weather
npm install # npm
yarn # Yarn

Dev Server

Either add your API key for OpenWeatherMap to the .env file.

.env file

REACT_APP_OPEN_WEATHER_API_KEY='Insert your API key here'

Or set your key in the current shell when starting the app:

Windows

set REACT_APP_OPEN_WEATHER_API_KEY='Insert your API key here' && npm start

Linux

REACT_APP_OPEN_WEATHER_API_KEY='Insert your API key here' && npm start

Startup the development server, the app will automatically open at http://localhost:3000.

yarn start

Test

Run automated tests using Jest and Enzyme.

yarn test

Build

Create the production ready build.

yarn build

Deploy

Deploy the latest build to gh-pages.

yarn deploy

Additional Work

Given more time there are a number of additional features that could be added to improve the user experience, development process, and deployment.

Features

  • Allow a user to select the city/country, using a typeahead and a location API.

  • Add a refresh button to reload the data, without refreshing the page.

  • Show an overview of weather data for each day.

  • Use Geolocation.getCurrentPosition() to show the weather for the users current location by default.

Testing

  • Increase test coverage (especially for redux: containers, reducers, and actions).

  • Add cross browser testing using Selenium.

  • Utilise BDD tools (e.g. cucumber) to take each user story and ensure the associated tests pass.

Refactoring

  • Improve the redux store structure, create separate objects for metadata associated with each day and the list of data, both referenced by allIds.
  • Refactor component/container folder structure as repository grows, the flat directory structure doesn't scale well.
  • Increase flow coverage and usage of types to improve static type checking when building.

CI/CD

  • Currently just using travis to run tests on push, should report coverage to the repository as well.
  • Automate deployment of the master branch when the CI stage passes.

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.