Skip to content

DancingColors/weather-app

Repository files navigation

Weather App small challenge

Simple web application to show weather information.

The challenge

Have a running react app with that displays the weather of a given location in a box.

The box should be horizontally and vertically centered.

Windspeed should be displayed in knots per hour.

Document your steps via commits.

Provide your solution as a pull request for master

Bonuses:

  • Use Typescript
  • Add weather icon to the top right (weather api specs)
  • Integrate forecast for tomorrow
  • Add a location search

Data Sources As a starting point, use this location to retrieve the weather: https://www.metaweather.com/api/location/638242/ When you are done, please, submit your solution to a Git Repository of your choice.

Installation

I've used yarn for package managing but npm can be also used.

Just run

yarn

or

npm install

Architecture

This project was created using create-react-app with its Typescript template.

I've also used eslint and prettier for code formatting and sass for styling.

State management

I've choosen prop drilling as data flow strategy. Using Redux or prefereably the React's Context API are overkill in this case.

Requests

Due to the size of the application and low requirements in terms of communications, I haven't used any external HTTP client such as Axios or http-cient. Fetch API with proper error handling is fairly enough.

Requests for weather data are made directly in the App component. Requests for locations came from the DaySelector component. And that's all.

Cors

Unfortunatelly, MetaWeather responses do not contain the 'Access-Control-Allow-Origin: *' header so I opted to enable the proxy from the React dev server.

This makes the project not suitable for a production environment, but it's fine for this showcase.

Visual assets

As an extra challenge for myself I added several visuals to the application generated by the browser. No extra downloads.

Conclussion

I had a lot of fun doing this challenge and I want to thank you for the opportunity.

Hope you like it.

About

Simple web weather app

Resources

License

GPL-3.0, GPL-3.0 licenses found

Licenses found

GPL-3.0
LICENSE
GPL-3.0
LICENSE.md

Stars

Watchers

Forks