Skip to content

Latest commit

 

History

History
137 lines (102 loc) · 5.37 KB

SPEC.md

File metadata and controls

137 lines (102 loc) · 5.37 KB

App Specifications

Table of Contents generated with DocToc

User Stories and Required Features

User Stories and Notes on Required Features

As a user, I would like...

to (action) in order to (desired outcome) notes on required features
enter city name or geocoords see current weather and 5-10 days forecast weather API
choose units imperial or metric see temperature, wind speed etc. as I am accustomed to refresh weather data on unit switch
have my units choice remembered avoid switching every time from same device and browser browser's storage
have a list of favoirite cities switch between favourite cities fast browser's storage; add/remove fav city
have a list of recently viewed cities switch between recently viewed cities browser's storage; save valid city names only
see current city or latitude and longitude in the link in the address bar of the browser bookmark the url, navigate through browser history URL API; History API
see weather for the city in URL, last search, current location, default - whichever is available first see not blank page
click 'current location' see weather from my current location GPS/Location API
have clickable city name suggestions while typing search for existent city and avoid mis-search for homonym cities from different countries/states pre-loaded city list with country codes; autocompletion
see fancy icons for forecast and design be visually pleased improved CSS, colour scheme, animations
have geo coordinates fixed when typed incorrectly get sensible results
[NTH] have geo coordinates autoadjusted to the nearest supported see weather instead of no data warning pre-loaded list
get warned when search query reverts no result make sure the app works no data per query; data provider is down or quota exceeded; no connectivity
[NTH] get historical weather data from last searches (no older than 3 days) when data provider is unreachable have outdated info rather than no data browser's storage
[NTH] when data source is not available see in history list only those entries where weather data is max 3 days old avoid browsing cities where no cached data available

TOC

Key Features

TOC

App Components

App components are:

  • AppController - app bootstrapper
  • Native Services - browser native data stores (LocalStorage, IndexedDB) available via Services
  • helpers - helper functions and 3rd party libraries
  • Services - app data stores
  • UI Controllers - app user interaction and feedback
  • External Data Providers - external data sources available via Services

TOC

AppController

  • owns global app config
  • creates required Services
  • supplies Services with settings and dependecies (from among other Services)
  • creates required UI Controllers
  • supplies UI Controllers with settings and dependencies (from among Services and other UI Controllers)

TOC

UI Controllers

An UI Controller

  • controls UI elements
  • receives User activities
  • inquires a Service for data
  • can be called by a Service or another Controller
  • stores data via Service
  • serves data to UI elements

App UI Controllers:

  • UnitSwitchController
  • CityInputController
  • SearchHistoryController
  • FavouriteCityController
  • UrlController
  • WeatherController
  • ProgressController

TOC

Services

  • StorageService employs idb lib to cache data
  • WeatherService
  • SettingsService
  • CityListService
  • CityHistoryService
  • FavCityService
  • WeatherIconService

TOC

helpers

  • a set of custom global functions
  • idb - a layer to communicate with browser's IndexedDB; used by StorageService

TOC

External Data Providers

Native Services

  • Browser's IndexedDB used to cache app data by StorageService via idb

TOC

View Design

Inspirations

TOC