<?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>DEV Community: Chuong Tang</title>
    <description>The latest articles on DEV Community by Chuong Tang (@chuongtang).</description>
    <link>https://dev.to/chuongtang</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%2F670954%2Ff4e25779-4e12-462b-a52b-858adc5189fc.png</url>
      <title>DEV Community: Chuong Tang</title>
      <link>https://dev.to/chuongtang</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/chuongtang"/>
    <language>en</language>
    <item>
      <title>InSelfView</title>
      <dc:creator>Chuong Tang</dc:creator>
      <pubDate>Wed, 11 May 2022 18:16:50 +0000</pubDate>
      <link>https://dev.to/chuongtang/inselfview-4n3i</link>
      <guid>https://dev.to/chuongtang/inselfview-4n3i</guid>
      <description>&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--xmlUHHWW--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/owqfzh4qo4xal13kvl2b.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--xmlUHHWW--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/owqfzh4qo4xal13kvl2b.jpg" alt="InSelfView Logo" width="368" height="108"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Overview of My Submission
&lt;/h3&gt;

&lt;p&gt;The introduction of live video interviews have created a pandora’s box of new challenges and struggles for candidates. For jobseekers, improving their online presentation is one of the first steps toward the final goal. &lt;strong&gt;&lt;em&gt;InSelfView&lt;/em&gt;&lt;/strong&gt; was built to give a simulation for virtual interview. Users can practice in a safe environment and improve the result through a supportive community.&lt;/p&gt;

&lt;h3&gt;
  
  
  Submission Category:
&lt;/h3&gt;

&lt;p&gt;Web2 Wizards&lt;/p&gt;

&lt;p&gt;&lt;em&gt;(ah... I am not a wizard at all 🤓)&lt;/em&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Link to Code
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://github.com/chuongtang/InSelfView"&gt;My repo&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;(don't forget to click the &lt;code&gt;★&lt;/code&gt; . Thanks your visit 🙏. PRs are always appreciated.)&lt;/p&gt;

&lt;h3&gt;
  
  
  Additional Resources / Tech stack
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Front-end: &lt;a href="https://vitejs.dev"&gt;&lt;em&gt;VITEjs&lt;/em&gt;&lt;/a&gt; _ a super fast frontend tool to render React App.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;State Management: &lt;a href="https://redux.js.org"&gt;&lt;em&gt;Redux&lt;/em&gt;&lt;/a&gt; _ a Predictable State Container for React.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Back-end: &lt;a href="https://appwrite.io"&gt;&lt;em&gt;Appwrite&lt;/em&gt;&lt;/a&gt; _ Secure Open-Source Backend Server for Web, Mobile &amp;amp; Flutter Developers. Its extensive APIs gives developers a full range of different services for building apps (Users, Account, Storage, Database, Functions...)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Styling: &lt;a href="https://windicss.org/guide"&gt;&lt;em&gt;WindiCSS&lt;/em&gt;&lt;/a&gt; _ faster load times, full compatibility with Tailwind and integrated with VITE.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Server deployment: &lt;a href="https://www.vultr.com/products/cloud-compute"&gt;&lt;em&gt;Vultr&lt;/em&gt;&lt;/a&gt; _ Appwrite's deployed on a Vultr instance with an Ubuntu Virtual Machine.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Front-end deployment: &lt;a href="https://pages.cloudflare.com"&gt;&lt;em&gt;Cloudflare Pages&lt;/em&gt;&lt;/a&gt; _ support Git integration for automated deployments. Just connect your repo and push.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Live Demo
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://inselfview.pages.dev/"&gt;InSelfView&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It's responsive on your mobile as well 📱📟💻🖥&lt;/p&gt;

&lt;h3&gt;
  
  
  Feedback / Suggestion?
&lt;/h3&gt;

&lt;p&gt;Please send your comments to &lt;a href="mailto:email@chuongtang.com"&gt;email@chuongtang.com&lt;/a&gt;&lt;/p&gt;

</description>
      <category>appwritehack</category>
      <category>vite</category>
      <category>react</category>
      <category>redux</category>
    </item>
    <item>
      <title>Azure Trial Hackathon Submission : WordleLike </title>
      <dc:creator>Chuong Tang</dc:creator>
      <pubDate>Tue, 08 Mar 2022 18:57:06 +0000</pubDate>
      <link>https://dev.to/chuongtang/azure-trial-hackathon-submission-wordlelike-4oie</link>
      <guid>https://dev.to/chuongtang/azure-trial-hackathon-submission-wordlelike-4oie</guid>
      <description>&lt;h3&gt;
  
  
  Overview of My Submission
&lt;/h3&gt;

&lt;p&gt;One of the great ways to learn any new tools is using them to build app. I've tried several cloud platforms for backend and server-less experiences. For this app, I decided to learn a new tech by diving into  &lt;a href="https://azure.microsoft.com/en-ca/"&gt;Microsoft Azure&lt;/a&gt;. Especially the newly launched &lt;a href="https://devblogs.microsoft.com/microsoft365dev/msal-for-react-is-here/"&gt;MSAL for React&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Submission Category:
&lt;/h3&gt;

&lt;p&gt;Computing &lt;a href="https://azure.microsoft.com/en-us/services/app-service/"&gt;App Service&lt;/a&gt; 🚀&lt;/p&gt;

&lt;h3&gt;
  
  
  Link to Code on GitHub
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://github.com/chuongtang/wordlelike"&gt;Repo on Github&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;PRs are always appreciated 🙌&lt;/p&gt;

&lt;h3&gt;
  
  
  Additional Resources / Info
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--KEUwkqDa--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gbrsq7f5rub2f75e40a5.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--KEUwkqDa--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gbrsq7f5rub2f75e40a5.jpg" alt="Tech Stack" width="880" height="447"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  Setting up frontend for UI build:
&lt;/h4&gt;

&lt;p&gt;With &lt;a href="https://vitejs.dev"&gt;VITE&lt;/a&gt;, initiating a development environment for React is as easy as 4 commands:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm init vite@latest wordlelike -- --template react
cd wordlelike
npm install
npm run dev
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Those lines fired up a scaffolded React App with a Vite dev server and...it's fast ⚡&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--1ekNBlNm--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jq12du138fcleau92o1y.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--1ekNBlNm--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jq12du138fcleau92o1y.jpg" alt="Vite Run" width="495" height="220"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  Setting up MSAL for React Typescript:
&lt;/h4&gt;

&lt;p&gt;&lt;a href="https://github.com/AzureAD/microsoft-authentication-library-for-js/tree/dev/samples/msal-react-samples/typescript-sample#msaljs-for-react-typescript-sample---authorization-code-flow-in-single-page-applications"&gt;MSAL Docs&lt;/a&gt; Step-by-step guides with great examples &lt;/p&gt;

&lt;p&gt;Main &lt;em&gt;engine&lt;/em&gt; is the &lt;code&gt;AuthConfig.tsx&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--d0RMVKNf--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7352c89bi65dioa310o8.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--d0RMVKNf--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7352c89bi65dioa310o8.jpg" alt="IAuthConfg" width="880" height="275"&gt;&lt;/a&gt;&lt;br&gt;
&lt;code&gt;ClientID&lt;/code&gt; is obtained from &lt;strong&gt;App registration&lt;/strong&gt; in &lt;strong&gt;Azure Portal&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--7PY-7ej4--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/70rleolo24m8bmjrbw9j.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--7PY-7ej4--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/70rleolo24m8bmjrbw9j.jpg" alt="Client Id" width="852" height="469"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;There is no need to protect the &lt;code&gt;clientId&lt;/code&gt; with an environment variable as it is exposed when the login client is called&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--PDWIYNW9--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/g8kebrkk44n50wmyiwos.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--PDWIYNW9--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/g8kebrkk44n50wmyiwos.jpg" alt="Display ID" width="814" height="249"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  Deploy to Azure App Service using Visual Studio Code
&lt;/h4&gt;

&lt;p&gt;There is a very thorough docs from &lt;a href="https://docs.microsoft.com/en-us/azure/devops/pipelines/targets/deploy-to-azure-vscode?view=azure-devops#:~:text=Open%20your%20application%20folder%20in%20VS%20Code%20and,Search%20for%20Deploy%20to%20Azure%20extension%20and%20install."&gt; Azure DevOps &lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://docs.microsoft.com/en-us/azure/devops/pipelines/targets/deploy-to-azure-vscode?view=azure-devops#install-the-extension"&gt;Install VS COde extension&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://docs.microsoft.com/en-us/azure/devops/pipelines/targets/deploy-to-azure-vscode?view=azure-devops#install-the-extension"&gt;Set up GitHub + GitHub Actions &lt;/a&gt; &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;Build&lt;/code&gt;, &lt;code&gt;commit&lt;/code&gt; and &lt;code&gt;push&lt;/code&gt; then &lt;strong&gt;Azure Pipelines for GitHub&lt;/strong&gt; will handle all the magic&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--k-Wx8jm3--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5vgfmttc454gfo0kpydh.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--k-Wx8jm3--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5vgfmttc454gfo0kpydh.jpg" alt="Azure build" width="653" height="659"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://ambitious-ocean-0a556771e.1.azurestaticapps.net/"&gt;Demo Link&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--OoI_SdW6--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vyuaxul0m4nrmus1wn4e.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--OoI_SdW6--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vyuaxul0m4nrmus1wn4e.gif" alt="Demo COnfetti" width="500" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>azuretrialhack</category>
      <category>azure</category>
      <category>react</category>
      <category>vite</category>
    </item>
    <item>
      <title>Watchkeeping: a timesheet compiling tool for Seafarers</title>
      <dc:creator>Chuong Tang</dc:creator>
      <pubDate>Thu, 13 Jan 2022 22:56:57 +0000</pubDate>
      <link>https://dev.to/chuongtang/watchkeeping-a-timesheet-compiling-tool-for-seafarers-396d</link>
      <guid>https://dev.to/chuongtang/watchkeeping-a-timesheet-compiling-tool-for-seafarers-396d</guid>
      <description>&lt;h3&gt;
  
  
  Overview of My Submission
&lt;/h3&gt;

&lt;p&gt;One of the great ways to experience all pros and cons of any technology is using them to build an app. In this project, I've dived into a trending tool from MongoDB : &lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--zAWFeZ2Q--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://chuongtang.github.io/sourceStore/logos/Realm.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--zAWFeZ2Q--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://chuongtang.github.io/sourceStore/logos/Realm.png" alt="Realm" title="Realm logo" width="800" height="255"&gt;&lt;/a&gt;&lt;br&gt;
This app is event-driven cloud-based systems of which,  the development relies solely on a combination of MongoDB  hosted remote procedure calls (Realm functions), client-side logic (React states).&lt;/p&gt;
&lt;h3&gt;
  
  
  Submission Category:
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Choose Your Own Adventure&lt;/strong&gt;: &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--p5usaBDz--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/i855uwhdw8f9muki5sic.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--p5usaBDz--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/i855uwhdw8f9muki5sic.png" alt="MongoDB Realm Functions Logo" width="269" height="200"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;Realm functions&lt;/em&gt; allow you to define and execute server-side logic for your application. You can call functions from your client applications as well as from other functions and in JSON expressions throughout Realm.&lt;/p&gt;
&lt;h3&gt;
  
  
  Link to Code repository
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://github.com/chuongtang/Watchkeeping-MongoDB-Serverless"&gt;Watchkeeping-MongoDB-Serverless&lt;br&gt;
 &lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;
  
  
  Additional Resources / Info
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Client:&lt;/strong&gt; &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://vitejs.dev"&gt;VITE:&lt;/a&gt; superfast front-end tool to render React app.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://www.primefaces.org/primereact"&gt;PrimeREACT: &lt;/a&gt; design-agnostic, flexible and accessible React UI Components.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Serverless:&lt;/strong&gt; &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://www.mongodb.com/realm/appdev"&gt;Mongo Realm Application Services: &lt;/a&gt; ready-to-go back end. &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Database:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://www.mongodb.com/atlas/database"&gt;MongoDB Atlas: &lt;/a&gt; multi-cloud database services.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Front-end User Authorization:&lt;/strong&gt; Autho0&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://auth0.com"&gt;Auth0: &lt;/a&gt; A drop-in solution to add authentication and authorization services.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Backend Serverless User Authorization:&lt;/strong&gt; &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://docs.mongodb.com/realm/authentication/api-key/#overview"&gt;MongoDB API Key: &lt;/a&gt; MongoDB Realm provides several authentication providers that you can integrate into a client application to allow users to log in to your Realm app. Server API keys are generated in the Realm UI. Creating a server API key associates that API key with an automatically created Realm server user. Provide a server key to external applications and services to allow them to authenticate directly with Realm.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;PDF rendering tool&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://github.com/eKoopmans/html2pdf.js"&gt;html2pdf.js: &lt;/a&gt; Client-side HTML-to-PDF rendering using pure JS.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Deployment&lt;/strong&gt; &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://docs.mongodb.com/realm/hosting/"&gt;MongoDB Realm &lt;/a&gt; Just drop your build-files into the hoisting directory. Realm allows you to host, manage, and serve your application's static media and document files. Just drop your build-files into the hoisting directory&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
  
  
  License
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://www.apache.org/licenses/LICENSE-2.0"&gt;&lt;br&gt;
&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--gy2bGB4c--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://img.shields.io/badge/License-APACHE%2520LICENSE%252C%2520VERSION%25202.0-green" alt="Apache License" title="Apache licenses Apache Software" width="238" height="20"&gt;&lt;br&gt;
&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  Demo
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Setting up Realm function in MongoDB&lt;/strong&gt;&lt;br&gt;
Similar to writing all the callbacks in NodeJS and Express,  serverless functions are small units of logic that take input arguments, operate on the input and return the result.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--c08XvqtB--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/s44mg4g2brsuudt0r270.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--c08XvqtB--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/s44mg4g2brsuudt0r270.png" alt="Setting Up serverless functions" width="880" height="631"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Logging-in MongoDB Realm from client&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;    const REALM_APP_ID &lt;span class="o"&gt;=&lt;/span&gt; import.meta.env.VITE_REALM_APP_ID&lt;span class="p"&gt;;&lt;/span&gt;
    const REALM_APP_APIKEY &lt;span class="o"&gt;=&lt;/span&gt; import.meta.env.VITE_REALM_APP_APIKEY&lt;span class="p"&gt;;&lt;/span&gt;

    useEffect&lt;span class="o"&gt;(&lt;/span&gt;async &lt;span class="o"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;

    const app &lt;span class="o"&gt;=&lt;/span&gt; new Realm.App&lt;span class="o"&gt;({&lt;/span&gt; &lt;span class="nb"&gt;id&lt;/span&gt;: REALM_APP_ID &lt;span class="o"&gt;})&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    const credentials &lt;span class="o"&gt;=&lt;/span&gt; Realm.Credentials.apiKey&lt;span class="o"&gt;(&lt;/span&gt;REALM_APP_APIKEY&lt;span class="o"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

    try &lt;span class="o"&gt;{&lt;/span&gt;
      setMongoUser&lt;span class="o"&gt;(&lt;/span&gt;loggedInUser&lt;span class="o"&gt;)&lt;/span&gt;
    &lt;span class="o"&gt;}&lt;/span&gt; catch &lt;span class="o"&gt;(&lt;/span&gt;error&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
      console.error&lt;span class="o"&gt;(&lt;/span&gt;error&lt;span class="o"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="o"&gt;}&lt;/span&gt;
  &lt;span class="o"&gt;}&lt;/span&gt;, &lt;span class="o"&gt;[])&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Calling Realm functions from React front-end&lt;/strong&gt;&lt;br&gt;
There's no need to declare any routes or endpoints. Serverless functions can be called from the front-end when MongoUser is authenticated.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;    const updateCrewDetail &lt;span class="o"&gt;=&lt;/span&gt; async &lt;span class="o"&gt;(&lt;/span&gt;newDetail&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
        const updatedCrew &lt;span class="o"&gt;=&lt;/span&gt; await user.functions.FindOneAndUpdate&lt;span class="o"&gt;(&lt;/span&gt;newDetail&lt;span class="o"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="o"&gt;}&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Deployment&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://watchkeeping.win"&gt;Live demo &lt;/a&gt; &lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>atlashackathon</category>
    </item>
  </channel>
</rss>
