Git Product home page Git Product logo

pwa-sushi-hunt's Introduction

Sushi Hunt

Quick note: The current version of the codebase is different from the one covered in the blogs. It's now written in a custom MVC like solution for extendability.

A progressive web app that lets you find the best sushi restaurants around you. The app currently uses Zomato's API to retrieve the list of restaurant recommendations.

Visit https://sushi-hunt.herokuapp.com/ on your mobile Chrome browser on your Android device. Head to 'settings' in Chrome and tap 'Add to Home Screen' to see it in action.

What makes an app progressive

Service Worker

A Service Worker is a script that runs on your browser as a separate thread from your regular Javascript that you use to access the DOM or other Web APIs in the front-end. The Service Worker can intercept network requests and can be used to communicate with browser storage mechanisms like Cache or IndexedDb to retrieve your web app’s assets to create offline experiences.

Promises

Promises are an alternative to how we generally write code to handle asynchronous computations. Browser events like XMLHttpRequests are asynchronous in nature, meaning they complete execution in an unknown order and time. To overcome this we tend to write a lot of nested callback functions which become difficult to read and maintain over time. Promises allow us to represent these asynchronous events in a sequence in which we want them to execute.

Here’s a rough example:

firstEvent().then(secondEvent).then(thirdEvent);`

Developers have used libraries like Q and Bluebird to implement Promises over the last few years. As of today all major browsers have enabled Promises by default except Internet Explorer (what a surprise!). Service Workers heavily use Promises too so that we can follow what is happening to our assets we intend to cache at a glance.

Cache

The Cache in our browser is going to be where we store all our assets using a Service Worker in this tutorial series. For more structured data like files or blobs, IndexedDB can be used as client-side storage.

Web App Manifest

The Web App Manifest is a JSON file that stores information about the app such as its name, author, icons, screen orientation and more. Without this file our app cannot be saved to the home screen of our (Android) mobile device.

HTTPS

Perhaps the most critical component of all, if you’re interested in deploying your app is to make sure your user connection to the web server is protected by the HTTPS protocol. Without the HTTPS, the power of our Service Worker makes the application vulnerable to man-in-the-middle attacks.

My step by step guide to build this PWA

pwa-sushi-hunt's People

Contributors

ashiq-r31 avatar

Stargazers

Robbie Page avatar Syed Peer avatar STONE avatar Hassan Tafreshi avatar Manojkumar avatar Moronfoluwa Akintola avatar Haroldo de Oliveira Pinheiro avatar Spaceman avatar Tobias Baldauf avatar  avatar Aman Bhargava avatar Federico Degiovanni avatar  avatar walleva avatar Ayush Gupta avatar Ashwin avatar Andy Gower avatar Ronaldo Hoch avatar

Watchers

James Cloos avatar  avatar Federico Degiovanni avatar  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.