Skip to content

yash-kapila/open-weather-app-es6

Repository files navigation

OpenWeather App

About

OpenWeather App displays the current weather, sunrise time(GMT) and the sunset time(GMT) for 5 major European cities. On selecting a particular city, the user can then see the sea level(hPa) and weather predictions for next 5 days.

This application has been developed using Angular 1.6.1 and Bootstrap 3.3.6. Routing in the application has been handled using ngRoute module provided by Angular itself.

The application is a single-page-application and follows a component-based architecture where screens are divided in components(stateful & stateless). Separation of concerns was also taken care while development. All business logic is kept in services thus keeping keeping them out of controllers thus keeping them skinny.

The directory structure of the application is:

  • components
  • services
  • styles
  • assets

Components folder contain all our application components. Sub-folder 'common' contains all components that are used across the application i.e the Spinner component. Cities component is a re-usable stateless component which depends on the data fed to it by its parent component. Details and Home are two parent components representing the two views of the application.

Services folder contain all application service and constant files. Constants have been defined for the cities which appear on the first screen and strings used in component's templates. There is a data service whose purpose is to interact with the APIs and get requested data for the controller. Routing service is used to manage all routing in the application thus keeping it separate from the controller. App service contains all the business logic of the application.

Assets folder contains all static assets like the background image used in the application.

Styles folder contains a single style-sheet that is used by the components.

Installation

Run the below command to install all project related dependencies

npm install

Launching the application

Execute either of the below to start a local node server.

npm start
node server.js

Server will be running at: http://localhost:8080/

About

Angular 1.6, ES6 & Webpack 2

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published