<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: d3mn8</title>
    <description>The latest articles on Forem by d3mn8 (@d3mn8).</description>
    <link>https://forem.com/d3mn8</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F39393%2Fe727be4f-dd47-49c0-9f38-a61f6ade6d55.png</url>
      <title>Forem: d3mn8</title>
      <link>https://forem.com/d3mn8</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/d3mn8"/>
    <language>en</language>
    <item>
      <title>I used my own app for a month and here is what I learned</title>
      <dc:creator>d3mn8</dc:creator>
      <pubDate>Fri, 07 Aug 2020 15:03:37 +0000</pubDate>
      <link>https://forem.com/d3mn8/i-used-my-own-app-for-a-month-and-here-is-what-i-learned-2emm</link>
      <guid>https://forem.com/d3mn8/i-used-my-own-app-for-a-month-and-here-is-what-i-learned-2emm</guid>
      <description>&lt;p&gt;&lt;strong&gt;I always wondered, I have written so many software solutions for others but I never developed anything for myself. So I decided to build something and use it every day.&lt;/strong&gt; &lt;/p&gt;

&lt;h4&gt;
  
  
  What to build 🤔
&lt;/h4&gt;

&lt;p&gt;So the immediate question was what can I build. After spending few days thinking here is what I came up with&lt;/p&gt;

&lt;p&gt;Being a developer, I keep exploring the buzz around technology. I explore following things&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Trending repositories&lt;/li&gt;
&lt;li&gt;Latest dev blogs&lt;/li&gt;
&lt;li&gt;Discussions about different topics&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I had to hop around multiple sites to do this e.g. GitHub, reddit, dev blog etc. I decided to bring them all together in one place for overview and deep link to the original sites for detailed reading.&lt;/p&gt;

&lt;h4&gt;
  
  
  TL;DR
&lt;/h4&gt;

&lt;p&gt;If you are in hurry, here is a screenshot and link of what I developed&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Url: &lt;a href="https://sp-fanas.web.app"&gt;https://sp-fanas.web.app&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;GitHub: &lt;a href="https://github.com/spoman007/fanas"&gt;https://github.com/spoman007/fanas&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;GraphQL: &lt;a href="https://fanas.herokuapp.com/graphql"&gt;https://fanas.herokuapp.com/graphql&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--HPN8J5x3--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/2tqhs3xsqftkks4nufqe.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--HPN8J5x3--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/2tqhs3xsqftkks4nufqe.png" title="Fanas" width="873" height="1778"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  Technology stack
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;Scrapper using nodejs and scrapeit&lt;/li&gt;
&lt;li&gt;Rest APIs using express (And GraphQL as well because why not!! 😛) &lt;/li&gt;
&lt;li&gt;Host backend on Heroku&lt;/li&gt;
&lt;li&gt;PWA Website using React&lt;/li&gt;
&lt;li&gt;Firebase for Hosting PWA&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;And thats it, the PWA was up. This was easy but the real learning began when I started to use the app every day&lt;/p&gt;

&lt;h4&gt;
  
  
  Adding Animations
&lt;/h4&gt;

&lt;p&gt;The site was fast, but still it felt like a website and not like an app. So I decided to add animations. Adding transitions and other effects using Framer Motion (Great library BTW 💗) made really big difference. I started to get sense of satisfaction with smooth UI.&lt;/p&gt;

&lt;h4&gt;
  
  
  Initial load time
&lt;/h4&gt;

&lt;p&gt;Heroku is a great platform for free hosting, however after 30 minutes of inactivity the dyno goes to sleep and for any request it takes a while (30 seconds) to show response.&lt;br&gt;
Now this would not be a big deal if it was a POC or tutorial app. But the extra waiting started to annoy me. One of my colleague also mentioned that he abandoned the app because of this.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;setInterval(async () =&amp;gt; {&lt;br&gt;
  await fetch("https://fanas.herokuapp.com")&lt;br&gt;
}, 1140000)&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;With this single line I was able to fix it, around every 20 mins mark I make a call to API, this keeps dyno awake. (It does restart once in 24 hours but because of this code it is up again)&lt;/p&gt;

&lt;h4&gt;
  
  
  The Bookmarks
&lt;/h4&gt;

&lt;p&gt;One of my friend who was using this app said that the information keeps updating and there is no way to see a repository (or article, discussion) again if it is gone. &lt;br&gt;
To fix this I added the bookmark feature which uses local storage but it turned out tobe really helpful&lt;/p&gt;

&lt;h4&gt;
  
  
  PWA Store
&lt;/h4&gt;

&lt;p&gt;After adding all the necessary features, I decided to add the app to &lt;a href="https://progressiveapp.store/pwa/Fanas"&gt;PWA Store&lt;/a&gt;&lt;br&gt;
To my surprise they added the to Editors Choice list&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--t9I44Xpu--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/djlpj86a4xz5r5shq940.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--t9I44Xpu--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/djlpj86a4xz5r5shq940.png" alt="Alt Text" width="880" height="360"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After 2 months more than 30 people are using this application and I am getting lot of feedback about how it can be improved even further.&lt;/p&gt;

&lt;h3&gt;
  
  
  Conclusion
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;It is an awesome feeling to use application created by yourself, but it is more awesome when others are using it as well&lt;/strong&gt;&lt;/p&gt;

</description>
      <category>node</category>
      <category>pwa</category>
      <category>react</category>
      <category>javascript</category>
    </item>
    <item>
      <title> Face Recognising Node Server</title>
      <dc:creator>d3mn8</dc:creator>
      <pubDate>Thu, 30 Jan 2020 17:08:24 +0000</pubDate>
      <link>https://forem.com/spoman007/face-recognising-node-server-215o</link>
      <guid>https://forem.com/spoman007/face-recognising-node-server-215o</guid>
      <description>&lt;h1&gt;A web server that recognises you if you are registered in the system 🔥🔥🔥&lt;/h1&gt;

&lt;p&gt;&lt;a href="https://github.com/spoman007/face-login-website" rel="noopener noreferrer"&gt;Click Here&lt;/a&gt; for github repository!!&lt;/p&gt;

&lt;h2&gt;
  
  
  What is this and who is it for 🤷‍♀️
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;This is a node and express based web server. It uses face api js to detect and recognise the face from the web cam feed.
If the person is registred in the system the server will recognise the face and a welcome message will be displayed. 😃 &lt;/li&gt;
&lt;li&gt;This is for developers who want to play around with Machine Learning but does not know python or confused about where to start (Like Me 😜😜 )&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Technologies used
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Faf1igdieedv4mhyh1ptl.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Faf1igdieedv4mhyh1ptl.png" alt="Tech logos"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://github.com/justadudewhohacks/face-api.js/" rel="noopener noreferrer"&gt;Face Api Js&lt;/a&gt; JavaScript API for face detection and face recognition in the browser and nodejs with tensorflow.js&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.tensorflow.org/js" rel="noopener noreferrer"&gt;TensorFlow.js&lt;/a&gt; Library for machine learning in JavaScript&lt;/li&gt;
&lt;li&gt;Express js to create a node server&lt;/li&gt;
&lt;li&gt;Jquery, HTML and CSS for web page&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Running on local machine 💻💻
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;npm install&lt;/code&gt; To install dependencies&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;npm start&lt;/code&gt; To run the server&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Credit 🤝🤝🤝
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://codepen.io/coinoperatedgoi/pen/VrVbvX" rel="noopener noreferrer"&gt;Terminator scanning theme!!! 🆒&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/WebDevSimplified" rel="noopener noreferrer"&gt;WebDevSimplified&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Author: Sandeep Poman ✍️
&lt;/h3&gt;

&lt;h3&gt;
  
  
  License
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://opensource.org/licenses/MIT" rel="noopener noreferrer"&gt;MIT&lt;/a&gt;&lt;/p&gt;

</description>
      <category>node</category>
      <category>tensorflow</category>
      <category>express</category>
      <category>faceapi</category>
    </item>
    <item>
      <title>Reuse business logic between React and React Native</title>
      <dc:creator>d3mn8</dc:creator>
      <pubDate>Wed, 10 Jul 2019 10:28:38 +0000</pubDate>
      <link>https://forem.com/spoman007/reuse-business-logic-between-react-and-react-native-5gj0</link>
      <guid>https://forem.com/spoman007/reuse-business-logic-between-react-and-react-native-5gj0</guid>
      <description>&lt;p&gt;React ecosystem encourages the Learn Once Write Everywhere style. Once we know the core concepts of react, we can write both web and mobile applications with ease. Even though there are small differences like types of components etc, the core of applications remains same.&lt;/p&gt;

&lt;p&gt;React being a library, we generally need help from some state management package to develop large applications. Redux is the more preferred one. Using redux helps us define the flow, business logic and application state.&lt;/p&gt;

&lt;p&gt;When we were developing projects for our customers, we realised that even though the view layer of web and mobile application is different, we were writing lot of duplicate code as well.&lt;br&gt;
For example, both our web and mobile applications had a login screen. Now the UI layer of this is different in react and react native. But once we get past that, we need to dispatch same action, make same service call, use same reducer and many more.&lt;br&gt;
So we decided to take this business logic and put it in a separate npm package. We called this npm package Core. Both mobile and web applications can load this as a dependency or link to this package via symlink.&lt;/p&gt;

&lt;p&gt;This helped us reduce the duplication of code. We were able to reuse almost 60% of code between React and React Native application. This also helped us in better predictability and consistent error reproduction. If something worked or failed it would happen in both web and mobile applications.&lt;/p&gt;

&lt;p&gt;So ultimately we were able to deliver a product with faster turnaround and with less budget.&lt;/p&gt;

&lt;p&gt;I created a working repository with sample todo app built in.&lt;br&gt;
Here is the link&lt;br&gt;
&lt;a href="https://github.com/spoman007/reactXstarter"&gt;https://github.com/spoman007/reactXstarter&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;What is this Repository?&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Demo of how the code can be reused between React and React Native Application&lt;/li&gt;
&lt;li&gt;Extracts the business logic to a seperate npm package&lt;/li&gt;
&lt;li&gt;Uses Redux to write application business logic: Actions and Reducers are extracted to a seperate npm package.&lt;/li&gt;
&lt;/ol&gt;

</description>
      <category>react</category>
      <category>reactnative</category>
      <category>redux</category>
    </item>
  </channel>
</rss>
