Metrichor Challenge
The purpose of this exercise is to create a live weather report for a given location.
What you need to do
-
Signup to OpenWeatherMap to get a free API key
- You will need to use the current API call for this exercise
- You can find an example of the JSON output in src/data/weather.json but you may not use this JSON in your implementation
-
Install and run the provided server
npm install
npm start
-
Prioritise and resolve the list of missing features that are required to build this application. These are (in no particular order):
- Update any out of date packages
- Fetch and display the weather for a user entered location (city name)
- When a location is chosen, it should refresh the weather data every 1 minute
- Count down how long since the last refresh and time to the next refresh
- Toggle temperate between Kelvin and degrees Celsius
- Track your changes using git
- Make it so when the user queries another location, the previous one stays in a sidebar as a history (up to 5 locations)
- Style the application as close to the spec as possible (see src/data/spec.png)
- Handle errors when an incorrect location is chosen
- Write at least one test for your code
-
Write tests to test your code. An example can be found for each component in
*.test.js
files. To run your tests:npm test
-
You should deliver your solution as a
git
repository, preferably hosted on GitHub.
Things you should know
- For clues on how/where to get started search for
TODO
in thesrc/
directory - You may NOT use css pre-processors such as sass/scss.
- You will use React and JSX for DOM manipulation and the native fetch API for data fetching. Sample response data is provided in src/data/weather.json. You can view this file but you can't change the data in it.
- An example component has been provided to get you started, but feel free to restructure the project layout in any way that makes sense to you.
- NB: At a minimum, you should produce an interface as close to that in src/data/spec.png
- Please read familiarize yourself with our disclaimer
What we are looking for:
- Functionality (you write code that does what it's supposed to do)
- Readability (you clean/lint your code)
- Good code design (you demonstrate code re-use)
- Best practice (you acknowledge established code conventions from the React community)
Libraries:
You may not use any external libraries (Except for linters)