<?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 Antonio Mesquita on Medium]]></title>
        <description><![CDATA[Stories by Antonio Mesquita on Medium]]></description>
        <link>https://medium.com/@antoniomesquita09?source=rss-df10a881f2ee------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*xbk-Fj42dLhA56W3dhQpiA.jpeg</url>
            <title>Stories by Antonio Mesquita on Medium</title>
            <link>https://medium.com/@antoniomesquita09?source=rss-df10a881f2ee------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 03 Dec 2026 05:44:40 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@antoniomesquita09/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[How details change everything]]></title>
            <link>https://medium.com/ifood-engineering/how-details-change-everything-e1533bfc5135?source=rss-df10a881f2ee------2</link>
            <guid isPermaLink="false">https://medium.com/p/e1533bfc5135</guid>
            <category><![CDATA[react-native]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[frontend]]></category>
            <category><![CDATA[ux]]></category>
            <dc:creator><![CDATA[Antonio Mesquita]]></dc:creator>
            <pubDate>Tue, 29 Jun 2021 13:52:05 GMT</pubDate>
            <atom:updated>2021-08-30T16:42:40.913Z</atom:updated>
            <content:encoded><![CDATA[<h4>Big small details that change the user experience inside your application</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jvaW4exT3Ba68yTHAeFEgQ.jpeg" /></figure><p>This article aims to show how small details can make a huge difference on your consumer experience using your application. It’s just like unseasoned food. Imagine eating barbecue without seasoning it. Terrible, of course. But that changes when you sprinkle the right amount of salt, and don&#39;t forget to choose the right cut of meat, otherwise the salt won&#39;t save your barbecue.</p><p>I always loved the small details, but they can usually be thought as useless junk or a waste of time. But instead, it changes the experience of your most valuable asset: your user. And they will see and appreciate your effort to offer them the best experience using your website or app. Don&#39;t deliver an ordinary experience, but an exceptional one.</p><p>Now let&#39;s talk about these UX tricks inside our Front-end apps. I&#39;ll focus on Single Page Applications using React and mobile apps using React-Native. But those tips can be applied on any application using any language or framework, so don&#39;t leave me now.</p><h3><strong>Skeleton</strong></h3><p>That’s a simple change, but I guess the most important and most significant one. I like to call it loading without loading. It&#39;s a powerful strategy used by many tech giants as Instagram, Facebook and iFood. Your application looks much fluid and pretty for your user view.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-Fn0-OlA5SaGBYM2mPO55Q.png" /></figure><p>Avoid dispatching that big spinner in the middle of the screen while the app truncated renders under the full screen shadow background. It&#39;s really easy to implement skeleton loading using libraries such as <a href="https://github.com/dvtng/react-loading-skeleton#readme">react-loading-skeleton</a>.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/162e5c33b5ba8952d3e84e77632381cf/href">https://medium.com/media/162e5c33b5ba8952d3e84e77632381cf/href</a></iframe><h3><strong>Infinite Scroll</strong></h3><p>Not even your worst enemy deserves to have to click over and over again to go to the next page every time he/she reaches the end of the page, right? Computers should know when you want to see more data (it&#39;s already 2021).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/732/1*Kjmn85LG_jdice43DpdFWA.png" /></figure><p>There is a big conflict of interest between users and server data delivery. As developers, we are always thinking about how to improve application performance, resilience and scalability. But maybe handling pagination like we always did is not the best experience for the person in the other side.</p><p>The social medias made us very used to infinite scrolling like Facebook, Instagram and even Google. But it&#39;s not very simple to implement it with React, but I&#39;ll show you the best way to do it, from my personal point of view.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/777dc868f850aad439c9db5d8287d952/href">https://medium.com/media/777dc868f850aad439c9db5d8287d952/href</a></iframe><p>You can read more about the implementations details here: <a href="https://dev.to/somtougeh/building-infinite-scroll-in-react-with-hooks-and-intersection-observer-3e09">https://www.pluralsight.com/guides/how-to-implement-infinite-scrolling-with-reactjs</a></p><h3>Fallback Page</h3><p>Maybe that&#39;s the most necessary detail. It&#39;s like a friend&#39;s help for your lovely user. A fallback page is an indication to everyone that something went wrong (not only from success lives your website, don&#39;t forget that). Please prevent your clients from seeing that ugly 404 page! Show them a custom error page that clearly means that they committed a mistake, but it&#39;s ok (we do it all the time and it&#39;s fine).</p><p>Some big tech companies use this space (fallback pages) to express their teams creativity with animations, easter eggs and jokes. See the Github and iFood examples below (both sites use cool animations to interact with us 😍):</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rv9fRwZ5yfH3rUOIJVd4jA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2-YMWfj_vMfi9SY0NdvGsg.png" /></figure><p>Creating a custom fallback page with React and react-router-dom is very simple and you can show to the users a funny/helpful page every time they reach a broken link. I&#39;ll call it NotFoundPage and you can customize it as you want. It&#39;s also a good idea to add a bottom that redirect them to the home page.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/38215d9751a4b7618f5a4f84f91fd8ec/href">https://medium.com/media/38215d9751a4b7618f5a4f84f91fd8ec/href</a></iframe><p>Your user will appreciate and reward you for this help.</p><h3>Errors Boundaries</h3><p>This time around to improve the user experience while navigating on your app and catching an unexpected error, but this time generated by a code error.</p><p>Unfortunately you&#39;ll probably deploy a bug to production. As we don&#39;t want your users being blocked by our mistakes we should wrap the application with an Error Boundary.</p><p>So we can tell them that something went wrong, it&#39;s not their fault and they should come back later. Although that&#39;s a page with an error feedback, you can also use that space to make your users smile as we did with the fallback page (Not found page). So express all your team creativity here too.</p><p>It&#39;s really common in Javascript and React applications, as a loosely typed language, to forget to check if an object property exists before calling it. And the result to our final client is a beautiful blank page. They will probably think it&#39;s their fault and be really frustrated about it. To avoid this bad behavior it&#39;s very simple with <a href="https://reactjs.org/docs/error-boundaries.html">React Error Boundaries</a>. Let&#39;s see the implementation below:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/b076c785d0e360bb8d3d287171947b5d/href">https://medium.com/media/b076c785d0e360bb8d3d287171947b5d/href</a></iframe><p>Here is an example of a custom error boundary page from one iFood React App:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-XKLB0XMaDKCTVPIHE4PWg.png" /></figure><p>Is your application resilient to different types of errors?</p><h3>Keyboard Types</h3><p>I think that&#39;s the smallest detail, but also the most annoying one. Imagine you&#39;re trying to sign up into a e-commerce, but when you&#39;re trying to input your phone number the keyboard shown is the alphabetic one. When you&#39;re typing your email you have to change to the symbol page to type dots and &quot;@&quot;.</p><p>That&#39;s so annoying and, maybe in a way, you can lose many leads or don&#39;t convert users because of this minor effort that you are making your user do. The experience changes from water to wine simply by changing the native keyboard type (email, phone, text, …). I&#39;ll show an exemple using React-Native.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/d5e97ef9102f503846349899357d1cdf/href">https://medium.com/media/d5e97ef9102f503846349899357d1cdf/href</a></iframe><p>You can learn more on React-Native official docs: <a href="https://reactnative.dev/docs/textinput#keyboardtype">https://reactnative.dev/docs/textinput#keyboardtype</a></p><p>A really good exemple of how to ease the life of your user is to giving them options of famous email domains like we do at iFood consumer app.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/750/1*AgOrU4_8NUfZX37xyvHCfA.png" /></figure><p>Thanks for reading till now and don&#39;t think that User Experience is only designer&#39;s business. You&#39;re also equally (or more) responsible for the final result of your site/app and the full experience of your consumer. Would you enjoy navigating on your own application?</p><p>Take a look at the <a href="https://carreiras.ifood.com.br/en/foodtech">vacancies available</a> in iFood and learn more about the selection process.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e1533bfc5135" width="1" height="1" alt=""><hr><p><a href="https://medium.com/ifood-engineering/how-details-change-everything-e1533bfc5135">How details change everything</a> was originally published in <a href="https://medium.com/ifood-engineering">iFood Engineering</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Building a Live Chat with GraphQL + MongoDB + NodeJs + Docker]]></title>
            <link>https://antoniomesquita09.medium.com/building-a-live-chat-with-graphql-mongodb-nodejs-docker-1ca58d5c19a9?source=rss-df10a881f2ee------2</link>
            <guid isPermaLink="false">https://medium.com/p/1ca58d5c19a9</guid>
            <category><![CDATA[graphql]]></category>
            <category><![CDATA[apollo-client]]></category>
            <category><![CDATA[docker]]></category>
            <category><![CDATA[mongodb]]></category>
            <category><![CDATA[nodejs]]></category>
            <dc:creator><![CDATA[Antonio Mesquita]]></dc:creator>
            <pubDate>Mon, 22 Feb 2021 19:28:20 GMT</pubDate>
            <atom:updated>2021-02-22T19:28:20.574Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/870/0*KfO5josAueB80IHR.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IkS0uAYb11fvglDfAfvapg.png" /></figure><p>First of all to understand this tutorial you need to have a basic knowledge with javascript and NodeJs.</p><p>Let&#39;s start our node app:</p><pre>yarn init -y</pre><p>I&#39;ll create a Dockerfile and docker-compose to help us to start and live reload our application. And to save time I will also start my <strong>mongoDb</strong> inside a <strong>docker</strong> <strong>container</strong>:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/5420dba86fc39d0cdaa47d930eb4dd1c/href">https://medium.com/media/5420dba86fc39d0cdaa47d930eb4dd1c/href</a></iframe><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/6cacf8e1428104289b81dfe0377b3f98/href">https://medium.com/media/6cacf8e1428104289b81dfe0377b3f98/href</a></iframe><p>And setup our .env :</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/e745f6de29ea062776849318fbb9aa84/href">https://medium.com/media/e745f6de29ea062776849318fbb9aa84/href</a></iframe><p>Now we need to install some packages:</p><pre>yarn add express mongoose http-status</pre><pre>yarn add nodemon -D</pre><p>And setup our scripts to run the node server editing the package.json file:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/4628107dc12d7867bffcdc869f8f3abe/href">https://medium.com/media/4628107dc12d7867bffcdc869f8f3abe/href</a></iframe><p>That’s enough for now. Let’s starting coding. We will create the src/index.js to start our server and connect to our database:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/1852e2e4cc7a480af5fbbd189d834cb1/href">https://medium.com/media/1852e2e4cc7a480af5fbbd189d834cb1/href</a></iframe><p>And we need to setup our express server as well:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/e1de0f81ea7f5439bc3731f2bb136e48/href">https://medium.com/media/e1de0f81ea7f5439bc3731f2bb136e48/href</a></iframe><p>If you didn’t forget any step now you can run the docker command below in your terminal to start the app for the first time (it will build the containers, start your mongo database and your node + express app). That may take a few minutes, so go make a coffee while you wait ☕️ .</p><pre>docker-compose up --build</pre><p>And the app is working and connected to the database.</p><p>Now we can start connecting our express integration to <strong>GraphQL</strong> server using <strong>Apollo Server Express</strong>. So let&#39;s install the apollo-server-express, apollo-server, graphql and graphql-tools:</p><pre>yarn add apollo-server-express apollo-server graphql graphql-tools</pre><p>And we need to setup the src/server.js:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/1ba7a90c259a61fc674c26a86e8ca12c/href">https://medium.com/media/1ba7a90c259a61fc674c26a86e8ca12c/href</a></iframe><p>Navigate to <a href="http://localhost:4000/graphql">http://localhost:4000/graphql</a> and see the apollo server <strong>playground</strong>, where we will debug our queries and mutations. You can see that we didn&#39;t setup our types and resolvers yet. But that&#39;s ok, let&#39;s continue :)</p><p>First let&#39;s setup our models: <strong>user</strong>, <strong>message</strong> and <strong>room</strong>. I&#39;ll place it at src/models.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/a2f11bed784df666a4dd4dbdfb651ad5/href">https://medium.com/media/a2f11bed784df666a4dd4dbdfb651ad5/href</a></iframe><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/f8f9cc249ea7b7eff901ccf56e57fcd9/href">https://medium.com/media/f8f9cc249ea7b7eff901ccf56e57fcd9/href</a></iframe><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/66fe394e21be23c0e1f63f6ae10ca3d2/href">https://medium.com/media/66fe394e21be23c0e1f63f6ae10ca3d2/href</a></iframe><p>Now we will code our queries and mutations. That will work basically as endpoints from our GraphQL api. <strong>Queries</strong> are similar to <em>get http protocol method</em> and <strong>mutations</strong> are similar to <em>post, put, patch and delete methods</em>, all together :). But our star to create real time messages are <strong>subscriptions</strong> that will work with <strong>pub sub</strong> to get real time updates from our GraphQL server.</p><p>Inside /graphql folder we will create three folders to place our (user, message and room) <strong>types</strong> and <strong>resolvers</strong>.</p><p>graphql/user</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/6fc11d8de17f4be2a02fa110da7ff9e1/href">https://medium.com/media/6fc11d8de17f4be2a02fa110da7ff9e1/href</a></iframe><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/a8a4b2068f010dd1f9e12acd42b0d77e/href">https://medium.com/media/a8a4b2068f010dd1f9e12acd42b0d77e/href</a></iframe><p>graphql/room</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/6efec955ae247e941de535f201cd0f9e/href">https://medium.com/media/6efec955ae247e941de535f201cd0f9e/href</a></iframe><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/146aac2436befc5d113064b8990f30e7/href">https://medium.com/media/146aac2436befc5d113064b8990f30e7/href</a></iframe><p>graphql/message</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/f345b64737bc206b812d5990a64b8f12/href">https://medium.com/media/f345b64737bc206b812d5990a64b8f12/href</a></iframe><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/9b4a970499fd77c4e7b349c3e20efb83/href">https://medium.com/media/9b4a970499fd77c4e7b349c3e20efb83/href</a></iframe><p>Now we have everything ready to glue and call inside our server.js. Let&#39;s do it :P</p><p>We need to create three files inside our /graphql folder; resolver.js, schema.js and type.js:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/a0446b6c030d5efff0166ad444a914b3/href">https://medium.com/media/a0446b6c030d5efff0166ad444a914b3/href</a></iframe><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/df05c3463be43048b8a42a5f4105a2a1/href">https://medium.com/media/df05c3463be43048b8a42a5f4105a2a1/href</a></iframe><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/523e27b15a6cb38396a5c244666eea70/href">https://medium.com/media/523e27b15a6cb38396a5c244666eea70/href</a></iframe><p>And to finish we just need to import the new schema inside our server.js file:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/facb15fd35bb69705c5fbae5813aec3a/href">https://medium.com/media/facb15fd35bb69705c5fbae5813aec3a/href</a></iframe><p>To see everything working you just need to follow the steps below:</p><ul><li>Create a room (<strong>room mutation</strong>);</li><li>Create a user (<strong>user mutation</strong>) passing the room id as parameter;</li><li>Subscribe to your room messages sent (<strong>messageSent subscription</strong>) passing the room id as parameter;</li><li>Send your messages (<strong>message mutation</strong>) passing the content and author id as parameters.</li><li>Enjoy your subscription printing your messages in real time :)</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*k61lJahOHd0V9CSS23_Pzg.gif" /></figure><p>If something went wrong with your code you can see the final result here: <a href="https://github.com/antoniomesquita09/medium-chat-backend">https://github.com/antoniomesquita09/medium-chat-backend</a></p><p>Hope you enjoy and if you have any doubt or suggestions to improve this code tutorial leave a message below 😁</p><p>Linkedin: <a href="https://www.linkedin.com/in/antonio-mesquita-b51aa6183/">https://www.linkedin.com/in/antonio-mesquita-b51aa6183/</a></p><p>Personal site: <a href="https://antoninhom.com/">https://antoninhom.com/</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1ca58d5c19a9" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to create a dynamic search using Rxjs debounce custom hook in react]]></title>
            <link>https://antoniomesquita09.medium.com/how-to-create-a-dynamic-search-using-rxjs-debounce-custom-hook-in-react-a0a6b3a1724f?source=rss-df10a881f2ee------2</link>
            <guid isPermaLink="false">https://medium.com/p/a0a6b3a1724f</guid>
            <category><![CDATA[react]]></category>
            <category><![CDATA[rxjs]]></category>
            <category><![CDATA[react-hook]]></category>
            <category><![CDATA[input-field]]></category>
            <category><![CDATA[debounce]]></category>
            <dc:creator><![CDATA[Antonio Mesquita]]></dc:creator>
            <pubDate>Fri, 02 Oct 2020 00:50:43 GMT</pubDate>
            <atom:updated>2020-10-02T00:50:43.650Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/751/1*oA2LeBCaKwrV-3nnM_1klg.png" /></figure><p>It’s very common to face the problem you want to create a dynamic search inside your react app.</p><p>The first solution that comes to mind is probably to store the input in a state and update it while the user texts. And every time the user types we send a new request to the backend (as you don’t want to create a button to submit that input only when the user finishes).</p><p>Maybe we just need to set up a delay every time the user types and when he has already typed the full string he wants to search we will manage it content as we want. eg.: dispatching an action, filtering a list or anything you want.</p><p>That delay will reset every time the person types a character, of course. And as soon as the debounce reaches it’s delay time, we will manage the data. That way we minimize the number of requests to our backend and increase the user experience with a clean and fluid dynamic search.</p><blockquote>Less talk and let’s code. All you’re going to need is <strong>Rxjs</strong> and <strong>React </strong>(of course).</blockquote><pre>yarn add rxjs</pre><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/b1f38941e65416ed2d006982fafab449/href">https://medium.com/media/b1f38941e65416ed2d006982fafab449/href</a></iframe><p>First we create a state with an initial value from the hook second parameter.</p><p>And another state with an initial callback function to Rxjs Subject class, that is simply an special type of observable which shares a single execution path among observers.</p><p>We create a pipe to our <strong>values </strong>subject. Pipeable operators are functions, so they <em>could</em> be used like ordinary functions.</p><p>That pipe triggers a <strong>debounceTime </strong>function from Rxjs that is responsible to discard emitted values that took less than the time received from the useDebounce hook first parameter.</p><p>Then we can simply set the new state value with the subscribe method.</p><p>And of course in the useEffect we monitor the changes from our two variables: <strong>time</strong> and <strong>values</strong>.</p><p>It’s important to assign that operation to a variable to safely unsubscribe our observable when our component is unmounted.</p><p>Finally we return an array, exactly working as an useState hook from react. The first element is the current value storage with the debounce hook and the second one is the function that we will call from our component. As a useState it will receive a string value to our debounce hook to set the hole operation queue.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/e413a8c187598ea5db1c4633c24600cf/href">https://medium.com/media/e413a8c187598ea5db1c4633c24600cf/href</a></iframe><p>And it’s all done :P</p><p><a href="https://github.com/antoniomesquita09/debounce-medium">antoniomesquita09/debounce-medium</a></p><p>Hope you enjoy! Leave a comment below so we can discuss more about it :)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a0a6b3a1724f" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>