<?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: Purushothaman Raju</title>
    <description>The latest articles on Forem by Purushothaman Raju (@problemsolver03).</description>
    <link>https://forem.com/problemsolver03</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%2F756606%2F6169f944-2c60-43fb-8d53-682793faa185.png</url>
      <title>Forem: Purushothaman Raju</title>
      <link>https://forem.com/problemsolver03</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/problemsolver03"/>
    <language>en</language>
    <item>
      <title>Place Insights app using cloudflare</title>
      <dc:creator>Purushothaman Raju</dc:creator>
      <pubDate>Wed, 10 Apr 2024 15:02:37 +0000</pubDate>
      <link>https://forem.com/problemsolver03/place-insights-app-using-cloudflare-3ad6</link>
      <guid>https://forem.com/problemsolver03/place-insights-app-using-cloudflare-3ad6</guid>
      <description>&lt;p&gt;&lt;em&gt;This is a submission for the &lt;a href="https://dev.to/devteam/join-us-for-the-cloudflare-ai-challenge-3000-in-prizes-5f99"&gt;Cloudflare AI Challenge&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  What I Built
&lt;/h2&gt;

&lt;p&gt;I built an simple application to look up any popular place and quickly summarize and understand the sentiment of the place using reviews data&lt;/p&gt;

&lt;h2&gt;
  
  
  Demo
&lt;/h2&gt;

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

&lt;h2&gt;
  
  
  My Code
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://github.com/problemsolver03/place-insights-cloudflare"&gt;https://github.com/problemsolver03/place-insights-cloudflare&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Journey
&lt;/h2&gt;

&lt;p&gt;The idea was to utilize the Google Maps review data and use it as the input data to summarize the reviews and also to provide users with the  sentiment of the consolidated reviews.&lt;br&gt;
This quick summarization and sentiment classification will help users quickly get an overview of the place they want to visit.&lt;/p&gt;

&lt;p&gt;Once the idea was clear I procured a Google Maps API key to get the reviews of the place.&lt;br&gt;
then I created two workers on Cloud Flare one for review summarization and the other for analyzing the sentiment of the reviews, with these workers setup. I was able to pass the review data to the workers and get the output of the models through API response, which I used in my react frontend to visualize it and later hosted the react application on Cloudflare pages.&lt;/p&gt;

&lt;p&gt;Technologies/Libraries used&lt;br&gt;
React, Serverless functions, TailwindCSS&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqriwskbeh8kn7bt0192c.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqriwskbeh8kn7bt0192c.gif" alt="Image description" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Multiple Models and/or Triple Task Types&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;bart-large-cnn&lt;br&gt;
distilbert-sst-2-int8   &lt;/p&gt;

</description>
      <category>cloudflarechallenge</category>
      <category>devchallenge</category>
      <category>ai</category>
      <category>webdev</category>
    </item>
    <item>
      <title>MANGO - An service directory to find experts and book appointments</title>
      <dc:creator>Purushothaman Raju</dc:creator>
      <pubDate>Wed, 12 Jan 2022 18:24:27 +0000</pubDate>
      <link>https://forem.com/problemsolver03/mango-an-service-directory-to-find-experts-and-book-appointments-2fhn</link>
      <guid>https://forem.com/problemsolver03/mango-an-service-directory-to-find-experts-and-book-appointments-2fhn</guid>
      <description>&lt;h3&gt;
  
  
  Overview of My Submission
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Mango&lt;/strong&gt;&lt;br&gt;
An service directory to find experts in any field and book appointments with the experts&lt;/p&gt;
&lt;h3&gt;
  
  
  Submission Category:
&lt;/h3&gt;

&lt;p&gt;E-Commerce Creation&lt;/p&gt;
&lt;h3&gt;
  
  
  Link to Code
&lt;/h3&gt;

&lt;p&gt;&lt;em&gt;Frontend Code&lt;/em&gt;&lt;br&gt;
&lt;a href="https://github.com/problemsolver03/Mango-Frontend"&gt;https://github.com/problemsolver03/Mango-Frontend&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Backend Code&lt;/em&gt;&lt;br&gt;
&lt;a href="https://github.com/problemsolver03/mango-serverside"&gt;https://github.com/problemsolver03/mango-serverside&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;
  
  
  Additional Resources / Info
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Features in the application&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Add a service&lt;/li&gt;
&lt;li&gt;Add Reviews&lt;/li&gt;
&lt;li&gt;Book Appointments&lt;/li&gt;
&lt;li&gt;View Appointment Schedules&lt;/li&gt;
&lt;li&gt;Search for experts&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Mongo Features used&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Atlas Search &lt;/li&gt;
&lt;li&gt;Mongo DB cluster&lt;/li&gt;
&lt;li&gt;Realm for hosting and serverless functions&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Tech Stack&lt;/strong&gt;&lt;br&gt;
 Frontend : &lt;em&gt;ReactJS, Tailwind UI&lt;/em&gt;&lt;br&gt;
 Backend : &lt;em&gt;NodeJS, ExpressJS, MongoDB&lt;/em&gt;&lt;br&gt;
 Authentication :&lt;em&gt;JWT based authentication , Cryptr for password encryption&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Database Schema&lt;/strong&gt;&lt;br&gt;
USER SCHEMA&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;username: {
    type: String,
    required: true,
  },
  password: {
    type: String,
    required: true,
  },
  name: {
    type: String,
    required: true,
  }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;SERVICES SCHEMA&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;title: {
    type: String,
    required: true,
  },
  description: {
    type: String,
    required: true,
  },
  image: String,
  contactNo: {
    type: String,
    required: true,
  },
  email: {
    type: String,
    required: true,
  },
  address: String,
  price: {
    type: String,
    required: true,
  },
  category: {
    type: String,
    required: true,
  },
  user: {
    type: String,
    required: true,
  },
  rating: Number
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;APPOINTMENTS SCHEMA&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;  serviceID: {
    type: String,
    required: true,
  },
  user: {
    type: String,
    required: true,
  },
  date: {
    type: Date,
    required: true,
  }

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;REVIEWS SCHEMA&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;  review: {
    type: String,
    required: true,
  },
  rating: {
    type: Number,
    required: true,
  },
  serviceID: {
    type: String,
    required: true,
  },
  user: {
    type: String,
    required: true,
  }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Screenshots of Application&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--q3Fl2_-x--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/bdghrg79cu9xngcheckk.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--q3Fl2_-x--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/bdghrg79cu9xngcheckk.png" alt="Homepage" width="880" height="720"&gt;&lt;/a&gt;&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--3jCS3EJA--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hqx6u2uxjof2nghuwwq9.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--3jCS3EJA--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hqx6u2uxjof2nghuwwq9.png" alt="Dashboard" width="880" height="642"&gt;&lt;/a&gt;&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--pH3VvYOX--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wtxh9418z36sibebekob.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--pH3VvYOX--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wtxh9418z36sibebekob.png" alt="Appointments" width="880" height="695"&gt;&lt;/a&gt;&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--3BNckNut--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/88au5gu84vesrbaik0a6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--3BNckNut--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/88au5gu84vesrbaik0a6.png" alt="Search" width="880" height="542"&gt;&lt;/a&gt;&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--H0ZBMg1F--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/sv43kmhhoszb7zqq9v9o.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--H0ZBMg1F--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/sv43kmhhoszb7zqq9v9o.png" alt="Details" width="880" height="762"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Link to Application&lt;/strong&gt;&lt;br&gt;
  &lt;a href="https://appointmentschedulerapp-ojqay.mongodbstitch.com/"&gt;Application Demo&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Test credentials for application&lt;br&gt;
  email:&lt;a href="mailto:test@test.com"&gt;test@test.com&lt;/a&gt;&lt;br&gt;
  password :123&lt;/p&gt;

</description>
      <category>atlashackathon</category>
    </item>
    <item>
      <title>Conditional rendering in React</title>
      <dc:creator>Purushothaman Raju</dc:creator>
      <pubDate>Thu, 23 Dec 2021 16:55:36 +0000</pubDate>
      <link>https://forem.com/problemsolver03/conditional-rendering-in-react-2c1f</link>
      <guid>https://forem.com/problemsolver03/conditional-rendering-in-react-2c1f</guid>
      <description>&lt;p&gt;To decide which UI elements to show or render in react is what we refer to as conditional rendering. This can be achieved by 3 ways which are helper functions, using ternary operators, and lastly by using simple if-else conditions in the render method. let us see some code examples to better understand these techniques.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Conditional rendering using helper functions&lt;/strong&gt;&lt;br&gt;
The idea is we abstract the logic from the render method and add it inside a function that will return some JSX or UI based on some conditions. &lt;br&gt;
Here is an example&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;class App extends React.Component{
  helperFunction = () =&amp;gt; {
      return (
          &amp;lt;h2&amp;gt;
              I was returned from a helper function
          &amp;lt;/h2&amp;gt;
      )
  }
  render() {
      return (
          &amp;lt;div&amp;gt;
              {this.helperFunction()}
          &amp;lt;/div&amp;gt;
      )
  }
}
export default App;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;class App extends React.Component {
  render() {

    const helper = () =&amp;gt; {
      return &amp;lt;h2&amp;gt;I was returned from a helper function&amp;lt;/h2&amp;gt;;
    };

    return &amp;lt;div&amp;gt;{helper()}&amp;lt;/div&amp;gt;;
  }  
}
export default App;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Using Ternary operators&lt;/strong&gt;&lt;br&gt;
This is the most common way of handling conditional rendering in the react world to show a price of UI or to manipulate the values like adding classNames or showing values inside elements, this usually written inside the return method of components.&lt;br&gt;
Let us see an example to understand this approach better&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;class App extends React.Component {

  state = {
    data:true
  }

  render() {

    return (
      &amp;lt;div&amp;gt;
        {
          this.state.data ? &amp;lt;p&amp;gt;Data is available&amp;lt;/p&amp;gt; : &amp;lt;p&amp;gt;Sorry no data can be shown&amp;lt;/p&amp;gt;
        }
      &amp;lt;/div&amp;gt;
    )
  }
}

export default App;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Use of If/Else conditions&lt;/strong&gt;&lt;br&gt;
This is a very straight forward approach to decide which piece of UI or JSX we want to return to the user. see the below example to&lt;br&gt;
understand this approach better.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;class App extends React.Component {  
  state = {
    data:true
  }
  render() {
    if (this.state.data) { 
      return (&amp;lt;p&amp;gt;Data is available&amp;lt;/p&amp;gt;)
    }
    else {
      return (&amp;lt;p&amp;gt;Sorry not data is available&amp;lt;/p&amp;gt;)
    }    
  }
}
export default App;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;if you like this article please do visit my blog here &lt;a href="https://www.uiuxtek.in/"&gt;www.uiuxtek.in&lt;/a&gt;&lt;/p&gt;

</description>
      <category>react</category>
      <category>javascript</category>
      <category>tutorial</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Flattening a multidimensional array using Javascript</title>
      <dc:creator>Purushothaman Raju</dc:creator>
      <pubDate>Thu, 18 Nov 2021 16:33:37 +0000</pubDate>
      <link>https://forem.com/problemsolver03/flattening-a-multidimensional-array-using-javascript-4ea4</link>
      <guid>https://forem.com/problemsolver03/flattening-a-multidimensional-array-using-javascript-4ea4</guid>
      <description>&lt;p&gt;So as the title implies let’s see how to flatten an multidimensional array, As we know a multidimensional array looks something like this [[1,2],[3,4],[5,[6,7]]] and we would want to flatten this to something like this [1,2,3,4,5,6,7] since we know the expected output let’s get started.      &lt;/p&gt;

&lt;p&gt;First, we define a function called arrFlatten and declare a variable called flattendArray to store the flattened array. We will be using recursion since it’s an efficient solution for problems like these, inside the arrFlatten. &lt;/p&gt;

&lt;p&gt;We define another function called recurseFlatten , which will loop over every item inside the array and identify if the array item is not an object, This check is added to ensure that we only add a number or string to the flattendArray. If the check returns false we push the array item into the flattendArray and finally return the flattendArray.&lt;/p&gt;

&lt;p&gt;Here it the complete code for flattening an multidimensional array&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const arrFlatten = (arr) =&amp;gt; {
        let flattendArray = [];
        const recurseFlatten = (arr) =&amp;gt; {
          for (let i = 0; i &amp;lt; arr.length; i++) {
            if (typeof arr[i] === "object") {
              recurseFlatten(arr[i]);
            } else {
              flattendArray.push(arr[i]);
            }
          }
        };
        recurseFlatten(arr);
        return flattendArray;
      };

let multiDimesionArray = [0, [1, 2], [3, 4], [5, 6, [7, 8]]];
 console.log(arrFlatten(multiDimesionArray));
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
    </item>
  </channel>
</rss>
