<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Vishal Gupta on Medium]]></title>
        <description><![CDATA[Stories by Vishal Gupta on Medium]]></description>
        <link>https://medium.com/@provish?source=rss-f40ef9e437b2------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*vsEgiPD1P8Tr49Hd.jpg</url>
            <title>Stories by Vishal Gupta on Medium</title>
            <link>https://medium.com/@provish?source=rss-f40ef9e437b2------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 27 Nov 2026 15:10:03 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@provish/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Backend For Frontend]]></title>
            <link>https://medium.com/@provish/backend-for-frontend-43053e1fa3?source=rss-f40ef9e437b2------2</link>
            <guid isPermaLink="false">https://medium.com/p/43053e1fa3</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[nodejs]]></category>
            <category><![CDATA[backend]]></category>
            <dc:creator><![CDATA[Vishal Gupta]]></dc:creator>
            <pubDate>Fri, 07 Feb 2020 16:41:13 GMT</pubDate>
            <atom:updated>2020-02-07T16:41:13.960Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xi1CWtBDQh_OyUpEEGawVg.png" /></figure><blockquote>Super fast client application is the need of current digital era, personalisation in the client application is icing on the cake</blockquote><p>At Goibibo, Hotels Business is very much focussed, as much as we care about customers’ experience for booking the hotel on our B2C platform, we also care about the experience for the hoteliers while using our platform to manage their Hotel.</p><p>For Hoteliers we have a very vast application to manage their property, the application is built using React.js at frontend and Django at backend and it is well known as Extranet in Hotels domain.</p><h3>Challenges</h3><p>We follow micro-service architecture at the core and all the client applications catering hoteliers, directly get data from those micro-services, this started influencing engineers to debate on where to keep the representation logic like, if we keep it at frontend then all the client applications (web, iOS, android and mobile-web) have to write the same logic 3 times, and keeping it in backend is never a good idea. Moreover, getting data from more than one service is again an overhead for client apps and it also exposes all backend services to client applications, that is why we need a Backend For Frontend or BFF.</p><h4>UI processing on Client</h4><p>Most of the UI processing logic resides on the client, so there is always chance of duplicity in the UI rendering logic for different screen size client application.</p><h4>Payload Variance</h4><p>For different screen size clients we can keep the payload size as per the client requirement, which will eventually help in optimising system performance.</p><h4>Collective Response</h4><p>Different micro services, returns response as per their implementation, so client application needs to process that response every time as per their requirement.</p><h3>BFF implementation</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/642/1*M09G7MHjvfrQdO4LFRNzPA.png" /></figure><p>BFF is again a micro service, which listens to client request and figures out from which backend micro-service it has to fetch the data to serve client application.</p><p>We have implemented BFF in Express.js, we chose express because of default non-blocking IO behaviour, following is the <strong>tech stack</strong>:</p><ul><li><strong>Express.js — Server</strong></li><li><strong>Mongo DB — For caching API Data</strong></li><li><strong>PM2 — Process Manager</strong></li><li><strong>Redis — For caching user token</strong></li></ul><h3>BFF Responsibilities</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/612/1*q0FVsiVRQ-89yaJ2xfKPnA.jpeg" /></figure><p><strong>BFF act as the main source of truth for all the frontend clients,</strong> following the major <strong>responsibilities</strong> for BFF layer:</p><ol><li><strong>Authenticated response </strong>for client side applications</li><li><strong>Merge response</strong> from various backend services and provide the response as per the client requirement</li><li><strong>Trim response</strong> as per client app requirement, dynamic pagination</li><li><strong>Support </strong><a href="https://grpc.io/docs/tutorials/basic/node/"><strong>GRPC</strong></a> enabled micro-services by exposing http APIs as proxy</li><li><strong>Caching</strong> frequent static API calls</li><li><strong>Personalisation</strong> for rendering selective UI for the varied sized client application</li><li><strong>Multi language support</strong> for different client applications</li><li>Support <strong>Client-Server Socket</strong> connection for realtime updates</li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=43053e1fa3" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Experience As Senior Engineer at YourQuote]]></title>
            <link>https://medium.com/@provish/experience-as-senior-engineer-at-yourquote-eee7986fbc4f?source=rss-f40ef9e437b2------2</link>
            <guid isPermaLink="false">https://medium.com/p/eee7986fbc4f</guid>
            <category><![CDATA[yourquote]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[nuxtjs]]></category>
            <category><![CDATA[journey]]></category>
            <category><![CDATA[vuejs]]></category>
            <dc:creator><![CDATA[Vishal Gupta]]></dc:creator>
            <pubDate>Mon, 05 Aug 2019 17:32:25 GMT</pubDate>
            <atom:updated>2019-12-06T19:54:04.482Z</atom:updated>
            <content:encoded><![CDATA[<h3>My Experience as Senior Engineer at YourQuote</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SeGL_QvWw0NbZintI7zcRA.png" /></figure><h3>Interview</h3><p>After a fantastic discussion with <a href="https://medium.com/u/5091a9913dbd">Harsh Snehanshu</a>(CEO) and <a href="https://medium.com/u/891ed2461635">Ashish Singh</a>(CTO), Ashish decided to give me a problem statement to solve which will decide my journey with <a href="https://www.yourquote.in/"><em>Yourquote</em></a>.<br>After waiting for a day with excitement, I received a problem statement which is explained in detail at the end of this post.<br>Tried to provide a probable solution to Ashish on the same day, he suggested some optimisations and I was able to quickly present the modified solution.<br>Next day Harsh Notified me that I am in, super happy I was.</p><h3>Joining</h3><p>Joined <a href="https://www.yourquote.in/">YQ</a> within a month and came to know that Ashish and whole Backend team is going on trekking that sounded cool and scary as all the responsibilities came on my shoulders now.</p><h3>First Challenge</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/595/1*uU53clp4V5CkopVm1JCEmw.png" /></figure><p>First Challenge was to keep up the server in the absence of Ashish, and no one expected that celery workers will mess up.<br>Notifications got affected due to some problem in celery workers, some how was able to fix that issue, after that there was no looking back.</p><h3>YQ Web Resurrected</h3><p>YQ website was written in jQuery to serve for <strong>SEO needs</strong>, but performance and UX was not very satisfactory, so we started planning to revamp it to achieve SEO and Performance.<br><strong><em>I am huge fan of Vue.js and hence I figured out a way of doing SSR with Vue.js which can serve for SEO and Performance. We sat with the design team and development kicked off in no time.</em></strong><br>Within <strong>30 working days</strong> we were able to completely revamp the YQ website.<br>Rendering of web pages was so fast, transitions were so smooth, I felt like everyone falling in love with me and YQ web.<br><strong><em>Info → </em></strong><a href="https://www.alexa.com/siteinfo/yourquote.in"><strong><em>YQ web alexa rank</em></strong></a><strong><em> is improved drastically, now under 1900 in India.</em></strong></p><h3>Tough Times (Entry of Google Ads)</h3><p>YQ is facing tough time as of now, since god knows why insvestors are interested to invest in platforms like some RandomChat rather than YQ.<br>Well, YQ knows how to survive and YQ family is so supportive that they will not let YQ die.<br>Getting some support from google ads as of now.<br>You can also support <a href="https://www.yourquote.in/">YQ</a> by using YQ premium from <a href="https://www.yourquote.in/store">YQ Store</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*z91P6hIzDtb9UEAZ32K7Wg.png" /><figcaption>YQ Store</figcaption></figure><h3>Interview Problem Statement</h3><p>Think of User to User Recommendation Engine, figure out optimised ways to store the recommendations and process them efficiently, also figure out how to serve those recommendation to client machine.<br>Lately I initiated this project using dGraph.</p><h3>Closing Words</h3><blockquote>YQ is love, YQ team is bunch of some really intelligent, calm and humble people. YQ as a company never wants to adopt any evil practice to exploit customers. Try YQ once, it will take all your pain.</blockquote><p><a href="https://play.google.com/store/apps/details?id=in.yourquote.app">Download YQ App</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=eee7986fbc4f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Express Server Architecture]]></title>
            <link>https://medium.com/@provish/express-server-architecture-8688421d0d60?source=rss-f40ef9e437b2------2</link>
            <guid isPermaLink="false">https://medium.com/p/8688421d0d60</guid>
            <category><![CDATA[architecture]]></category>
            <category><![CDATA[how-to]]></category>
            <category><![CDATA[servers]]></category>
            <category><![CDATA[nodejs]]></category>
            <category><![CDATA[expressjs]]></category>
            <dc:creator><![CDATA[Vishal Gupta]]></dc:creator>
            <pubDate>Mon, 05 Aug 2019 16:26:21 GMT</pubDate>
            <atom:updated>2019-08-19T17:49:08.671Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_5LmRsI5lOMi2NVLUB8lbQ.png" /><figcaption>I love Express</figcaption></figure><p><a href="https://expressjs.com/">Express</a> is Fast, unopinionated, minimalist web framework for <a href="https://nodejs.org/en/">Node.js</a>.<br>There are lot of starter kits available for express, I have created one for my own use case but seems to suit on large scale as well.</p><p>Before jumping to the code let us discuss the question below.</p><h3>Why Architecture is Important ?</h3><blockquote>Most of the tech Giants are moving there Business Intelligence APIs to node.js, and saving a lot of development and infra cost all because of some awesome minds behind making super awesome code architecture.<br>A stable architecture is the foundation for stable and scalable projects.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*J8sn0hDxXQ_NUDDq8VzKvA.png" /><figcaption>Solid &amp;&amp; Stable Architecture</figcaption></figure><h3><strong>I used the following architecture in some of the live API servers.</strong></h3><h4>Package.json</h4><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/cdde2f0fe55e177b674f49610d647fa7/href">https://medium.com/media/cdde2f0fe55e177b674f49610d647fa7/href</a></iframe><h4>Index.js</h4><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/c68b81f402e7cd3d7ea7a47de3f8ff4d/href">https://medium.com/media/c68b81f402e7cd3d7ea7a47de3f8ff4d/href</a></iframe><h4>/Apps/Index.js</h4><p>There can be multiple sub apps inside a big express app, so you can divert respective api urls to different express apps.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/029f0d639aea09145c70aa4a1b4f13df/href">https://medium.com/media/029f0d639aea09145c70aa4a1b4f13df/href</a></iframe><h4>/Apps/&lt;app_name&gt;/Index.js</h4><p>Main route file/controller</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/d2ddd2083afbbda90dca28d587ca5e12/href">https://medium.com/media/d2ddd2083afbbda90dca28d587ca5e12/href</a></iframe><h4>Note:</h4><blockquote>For simplicity, I have shown only one endpoint, in real world scenario there can be multiple modules and each module can have multiple controllers</blockquote><p>The whole <strong>idea</strong> is to <strong>initialise express app</strong> <strong>once</strong> and then pass it down to the bottom controller in the hierarchy.</p><p>In a trivial example, people end up initialising multiple express apps inside parent app, leading to bigger memory snapshot.</p><h3><strong>Folder Structure</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/412/1*5qx-Y21Gw91e76q1vBCrNA.png" /></figure><h4>Express is love</h4><p><em>Open for suggestions.</em><br>Thanks a lot.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8688421d0d60" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>