/openweather-vue

A simple Vue.js app, fetching weather forecast data for a user-selected location

Primary LanguageVue

A simple Vue.js app, fetching weather forecast data for a user-selected location.

Overview

I use the Google Geocode API for location suggestions based on user input or GPS position (if available), and OpenWeatherMap API to render 5 days weather forecast.

I also use Vuex for state management, for no other reason than getting to know the workings of it. HTTP requests are handled with axios. Finally, I use a local, patched version of Vue Select component, with a couple of PRs baked in. It should be updated, eventually.

This app was made while I learn webpack, Vue.js, ES6, Vuex, Mocha and expect — and I have a lot to learn. I had to cheat and retrofit the tests, so this was not build with TDD, but one has to start somewhere! I welcome constructive critisism and well documented PRs that whould make me, and anybody else, better developers!

ToDo

Instructions

If you want to run this project, you need a couple of API keys: Google Geocoding API and OpenWeatherMap. These are saved in Vuex state — there is a related comment in /src/js/vue/store.js.

There are 4 npm scripts:

  • npm run dev starts the webpack-dev-server with your local IP at the default port (8080), for you to develop your application. I still have an issue with rebuilding and injecting the stylesheets and I will find a solution, sooner or later…
  • npm run build compiles production-ready styles and scripts
  • npm run test runs the Mocha / expect tests, once
  • npm run watch runs the above tests continuously, to enable true Test Driven Development