Git Product home page Git Product logo

city-aqi's Introduction

city-aqi

Objective | What does the project work to achieve ?

  • Pull real-time AQI Data of cities.
  • To show data into tabular format.
  • To show charts through Visualization library like Highcharts.js.
  • To Show most recent data of Metropolitan cities.

Business Case | What is the Problem being solved ?

  • Getting real-time updates can increase user stickability and interaction.
  • Tabular and Graphical Visualization makes it easy for users to compare data of different cities.

Assumptions

  • Data is being received in intervals of 2 seconds.
  • Only 12 Indian cities are being pulled as AQI Data.

Tech Stack

  • Vue.js as Frontend Framework
  • Vuex for global State Management
  • Element-ui for enhancing UI and pre-built components
  • Highcharts.js for Visualizing Data into chart, specifically Highchart stock.
  • Web worker for offloading expensive work of the main thread.
  • Web socket to Pull Real time data.
  • AWS S3 as origin and AWS Cloudfront as content delivery network

Features Built (~ 10-12 hrs)

  • Metro cities AQI Overview Component: Provides Quick look into live Data of Metropolian cities.
  • Tabular AQI Data View: Provides Most Recent Data of all cities i.e Filterable by Category and Sortable by AQI value.
  • City AQI Comparsion View: Provides Comparsion of Historical Data Injected into graph (no limit on cities selection) with pre-built timeline selector and range selector.
  • Word Cloud View: Provides Most recent City AQI Data into word cloud where each word will carry weight according to its AQI value
  • Responsive Design: Used Grids and flex to make it Highly responsive, works well with all Device Screen types from SM to XL.
  • Data Archival: Data gets Automatically archived after 5 hours of active session.

R&D and Optimizations (~ 5 hrs)

  • Preloaded link tags.
  • Avoided inline styles to avoid layout shifts.
  • Used Hash map for O(1) Insertion.
  • Avoided cloneDeep from lodash where it should have been, instead used Object.assign() for objects and spread Operators for shallow copying for State Mutation.
  • Used Computed Properties from Vue Component Instead of getter methods as they cache values based on their Reactive Dependencies.
  • Optimised/̧Compressed Image assets using imagemin and webp images ( 250KB-450KB to 4-8 KB)
  • Using Web Worker to Reduce Blocking time to ~0ms.
  • Reduce Layout Shifts to bare minimum using optimized re-rendering of components using preloading of Default view into component.

Lighthouse Optimization Results

Device Type: Mobile

Result 2

Device Type: Desktop

Result 3 For more details goto

HLD

High Level Design

Project setup

npm install

Compiles and hot-reloads for development

npm run serve

Future Thoughts

  • A good time-series Store can be used like Druid for fast querying and AWS S3 as Data lake.
  • To Add Data Persistence layer on frontend(with Archival Strategy) using IndexedDB and using pre-aggregated data and setting up Indexes for Search Optimization.
  • Shared Web workers can also be used, will optimize n/w load of browser having multiple tabs opened up for same application.

city-aqi's People

Contributors

abhidtu2014 avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.