React Progressive Web Apps — Part 1 – Gethyl George Kurian – Medium

  • How to create your first PWA app and/or convert your existing app into PWA.In this example I created new React app with PWA in mind, but the idea should be quite similar if you have to convert your existing app into PWA.You need to understand the lifecycle of a SW, which are listed below, and you can read more about it in this link.Register the Service Worker(SW)If a browser supports SW, then the service worker will be registered.
  • Here is the code snippet from index.htmlRegister SW if browser supportsIf the above registration step was successful, then the SW file will be downloaded.
  • This would be ideal place to clean up the cache to remove any cache item which is no longer required maybe.Apart from the above lifecycle of SW, if you noticed in the earlier section, I mentioned to also go through the Fetch API.
  • Well that is because SW can intercept the fetch event, and this will help if you want to cache something from the network.Updating Cache / Making network calls — Fetch eventSW listens to fetch event, and in our example since we handle only the basic case of caching only the static files, you can see below, when there is a fetch event within the SW’s scope (Refer the registration step to see the scope),it is intercepted, and we checked if request has a response already in the cache, then we return the response from cache.
  • Adding your app to the Home Screen.Perfect!Step 1 above showed you the importance of SW and how it helps to make your app to be offline first.Step 2, tells you how you can run it from your virtual device.And now let us make it feel a bit more like an app, but letting you add this to your homepage, so that you can launch it anytime later without the need to remember the url or bookmark it.This is where you need to under about web manifest json file, which was one of the topic I mentioned would be good to know.

Progressive Web Apps(PWA) are gaining a lot of popularity these day, and with one of the updates this year (2017), the Create React App creates your project by default as PWA. If you haven’t heard of…
Continue reading “React Progressive Web Apps — Part 1 – Gethyl George Kurian – Medium”

Designing Apps using Webflow – ConsciousApps – Medium

Hey React folks, give a try to designing apps using Webflow:  #ReactJS

  • Clearly, styling components from hand using CSS is tough… and not necessary when you have Webflow.
  • Instead, within Webflow, you design each component from scratch.
  • Let’s say you want to create a series of buttons:As you’re designing these individual components in Webflow, be sure to assign them unique classNames since you’ll later be using these classes inside your React component.
  • Once the components look exactly the way you want—and perform all the actions you want (such as on focus, hover, etc.) — simply export the code from within Webflow, like this:Highlight and copy the CSS and paste it into a CSS file that’s called from your root index.html file:link rel=”stylesheet” href=”assets/css/index.
  • css” /Inside your react components, then, simply call the CSS styles, like this:So much easier than creating all this CSS from hand!CSS code exported from Webflow.You can even add nifty transitions inside Webflow!

Anyone who’s talked to me for more than a few minutes about website and app development knows I’m a big fan of Webflow. What used to take me hours to create using raw html, css, and javascript, now…
Continue reading “Designing Apps using Webflow – ConsciousApps – Medium”

Using Horizon/RethinkDB with React

  • Horizon, which is built on RethinkDB and by the RethinkDB team, facilitates common application development tasks like backend setup, real-time data transfer, security and scalability.
  • This tutorial will give you an introduction to Horizon and RethinkDB while also showing you how to build a simple app with Horizon and React.
  • Before hitting the code, let’s learn a few basic Horizon concepts:

    Horizon groups data into horizon collections and each collection is backed by a RethinkDB table.

  • Here’s a visual to help you make sense of the data flow in this app:

    Note that any change in the data is sent from one React client into Horizon and Horizon sends it back to all React apps so they can update their view, this flow makes sure that all clients are always watching the same without inconsistencies.

  • Our app will use two Horizon collections, one for the “we need list” and other for the “we have list”.

Horizon is an open source Backend as a Service (BaaS) that allows developers to easily build data-driven web and mobile applications. Horizon, which is built on RethinkDB and by the RethinkDB team, facilitates common application development tasks like backend setup, real-time data transfer, security and scalability. Horizon can be run locally, on a private server or in the cloud.
Continue reading “Using Horizon/RethinkDB with React”

Microservices with Docker, Flask, and React

  • In Part 4, we’ll add an end-to-end (e2e) testing solution, form validation to the React app, a Swagger service to document the API, and deal with some tech debt.
  • We’ll also set up a staging environment to test on before the app goes into production.
  • By the end of part 4, you should be able to…

    Check out the live app, running on EC2 –

    You can also test out the following endpoints…

In Part 4, we’ll add an end-to-end (e2e) testing solution, form validation to the React app, a Swagger service to document the API, and deal with some tech debt. We’ll also set up a staging environment to test on before the app goes into production.
Continue reading “Microservices with Docker, Flask, and React”

How HBO’s Silicon Valley built “Not Hotdog” with mobile TensorFlow, Keras & React Native

  • The depth openness of the deep learning community, and the presence of talented minds like R.C. is what makes deep learning viable for applications today — but they also make working in this field more thrilling than any tech trend we’ve been involved with.Our final architecture ended up making significant departures from the MobileNets architecture or from convention, in particular:We do not use Batch Normalization Activation between depthwise and pointwise convolutions, because the XCeption paper (which discussed depthwise convolutions in detail) seemed to indicate it would actually lead to less accuracy in architecture of this type (as helpfully pointed out by the author of the QuickNet paper on Reddit).
  • While this is a subject of some debate these days, our experiments placing BN after activation on small networks failed to converge as well.To optimize the network we used Cyclical Learning Rates and (fellow student) Brad Kenstler’s excellent Keras implementation.
  • This was hard to defend against as a) there just aren’t that many photographs of hotdogs in soft focus (we get hungry just thinking about it) and b) it could be damaging to spend too much of our network’s capacity training for soft focus, when realistically most images taken with a mobile phone will not have that feature.
  • Of the remaining 147k images, most were of food, with just 3k photos of non-food items, to help the network generalize a bit more and not get tricked into seeing a hotdog if presented with an image of a human in a red outfit.Our data augmentation rules were as follows:We applied rotations within Âą135 degrees — significantly more than average, because we coded the application to disregard phone orientation.Height and width shifts of 20%Shear range of 30%Zoom range of 10%Channel shifts of 20%Random horizontal flips to help the network generalizeThese numbers were derived intuitively, based on experiments and our understanding of the real-life usage of our app, as opposed to careful experimentation.The final key to our data pipeline was using Patrick Rodriguez’s multiprocess image data generator for Keras.
  • Phase 2 ran for 64 more epochs (4 CLR cycles with a step size of 8 epochs), with a learning rate between 0.0004 and 0.0045, on a triangular 2 policy.Phase 3 ran for 64 more epochs (4 CLR cycles with a step size of 8 epochs), with a learning rate between 0.000015 and 0.0002, on a triangular 2 policy.UPDATED: a previous version of this chart contained inaccurate learning rates.While learning rates were identified by running the linear experiment recommended by the CLR paper, they seem to intuitively make sense, in that the max for each phase is within a factor of 2 of the previous minimum, which is aligned with the industry standard recommendation of halving your learning rate if your accuracy plateaus during training.In the interest of time we performed some training runs on a Paperspace P5000 instance running Ubuntu.

How Silicon Valley build the real AI app that identifies hotdogs — and not hotdogs using mobile TensorFlow, Keras & React Native.
Continue reading “How HBO’s Silicon Valley built “Not Hotdog” with mobile TensorFlow, Keras & React Native”

Designing Apps using Webflow – ConsciousApps – Medium

  • Clearly, styling components from hand using CSS is tough… and not necessary when you have Webflow.
  • Instead, within Webflow, you design each component from scratch.
  • Let’s say you want to create a series of buttons:As you’re designing these individual components in Webflow, be sure to assign them unique classNames since you’ll later be using these classes inside your React component.
  • Once the components look exactly the way you want—and perform all the actions you want (such as on focus, hover, etc.) — simply export the code from within Webflow, like this:Highlight and copy the CSS and paste it into a CSS file that’s called from your root index.html file:link rel=”stylesheet” href=”assets/css/index.
  • css” /Inside your react components, then, simply call the CSS styles, like this:So much easier than creating all this CSS from hand!CSS code exported from Webflow.You can even add nifty transitions inside Webflow!

Anyone who’s talked to me for more than a few minutes about website and app development knows I’m a big fan of Webflow. What used to take me hours to create using raw html, css, and javascript, now…
Continue reading “Designing Apps using Webflow – ConsciousApps – Medium”