<?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: marco-bertelli</title>
    <description>The latest articles on DEV Community by marco-bertelli (@marcobertelli).</description>
    <link>https://dev.to/marcobertelli</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%2F488604%2F3b17e35e-b4f7-42ad-8f9d-b05e3b4b1b24.jpg</url>
      <title>DEV Community: marco-bertelli</title>
      <link>https://dev.to/marcobertelli</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/marcobertelli"/>
    <language>en</language>
    <item>
      <title>Exploring the Power of Language Models: Introducing the LLM RAG Chatbot Series</title>
      <dc:creator>marco-bertelli</dc:creator>
      <pubDate>Tue, 02 Jan 2024 13:50:20 +0000</pubDate>
      <link>https://dev.to/marcobertelli/exploring-the-power-of-language-models-introducing-the-llm-rag-chatbot-series-411g</link>
      <guid>https://dev.to/marcobertelli/exploring-the-power-of-language-models-introducing-the-llm-rag-chatbot-series-411g</guid>
      <description>&lt;p&gt;In recent years, language models have revolutionized the way we interact with technology. Their ability to understand and generate human-like text has opened doors to countless applications across various industries. One such innovation that has caught the attention of many is the creation of chatbots powered by Large Language Models (LLMs).&lt;/p&gt;

&lt;p&gt;If you've been following the advancements in AI, you might have come across the remarkable capabilities of LLMs like GPT-3. These models have sparked a wave of creativity and innovation, particularly in the realm of conversational AI. One fascinating avenue in this domain is the development of Responsive AI Generative (RAG) models for chatbots.&lt;/p&gt;

&lt;p&gt;I'm thrilled to announce a new series on Medium dedicated to exploring the potential and intricacies of LLM RAG chatbots. This series aims to delve deep into the technical aspects, practical applications, and the exciting possibilities that these chatbots offer.&lt;/p&gt;

&lt;p&gt;Understanding the Foundation: What is an LLM RAG Chatbot?&lt;br&gt;
Before diving into the series, let's grasp the fundamentals. LLM RAG chatbots leverage large language models like GPT-3 and utilize a Retrieve-And-Generate (RAG) approach. This approach combines the strengths of retrieval-based and generative models, allowing the chatbot to retrieve relevant information from a vast knowledge repository and generate human-like responses.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Series Overview:&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Unveiling the Architecture:&lt;br&gt;
The initial part of the series will focus on dissecting the architecture of LLM RAG chatbots. We'll explore how these models are built, discussing the intricate network of algorithms and techniques that enable their functioning.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Training and Fine-Tuning:&lt;br&gt;
Understanding how these models are trained and fine-tuned is crucial. In this segment, we'll dive into the methodologies used to train LLMs for chatbot applications, including data preprocessing, model optimization, and fine-tuning strategies.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Real-World Applications:&lt;br&gt;
The series wouldn't be complete without exploring the practical applications of LLM RAG chatbots. From customer support and education to healthcare and more, we'll examine how these chatbots are transforming various industries.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Ethical Considerations:&lt;br&gt;
With great technological advancements come ethical responsibilities. We'll dedicate a segment to discuss the ethical considerations surrounding LLM RAG chatbots, addressing concerns like bias, privacy, and the responsible use of AI.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Conclusion:&lt;/strong&gt;&lt;br&gt;
The potential of LLM RAG chatbots is vast and continuously evolving. Through this series, my goal is to provide a comprehensive guide for enthusiasts, developers, and curious minds keen on understanding and leveraging the capabilities of these advanced AI-driven chatbots.&lt;/p&gt;

&lt;p&gt;Stay tuned for the upcoming articles in this series as we embark on an insightful journey into the realm of LLM RAG chatbots. Join me in exploring the fascinating world where language meets AI, unlocking new frontiers of conversational technology.&lt;/p&gt;

&lt;p&gt;I look forward to sharing this exciting exploration with you all!&lt;/p&gt;

&lt;p&gt;If you're interested in the series or have insights to share, feel free to connect with me on Medium. Let's dive deep into the world of LLM RAG chatbots together!&lt;/p&gt;

&lt;p&gt;Medium: &lt;a href="https://medium.com/@marco.bertelli"&gt;https://medium.com/@marco.bertelli&lt;/a&gt;&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>python</category>
      <category>ai</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>SmartHome - your home data in real time!</title>
      <dc:creator>marco-bertelli</dc:creator>
      <pubDate>Sun, 28 Aug 2022 21:28:00 +0000</pubDate>
      <link>https://dev.to/marcobertelli/smarthome-your-home-data-in-real-time-2jjd</link>
      <guid>https://dev.to/marcobertelli/smarthome-your-home-data-in-real-time-2jjd</guid>
      <description>&lt;h3&gt;
  
  
  Overview of My Submission
&lt;/h3&gt;

&lt;p&gt;hi, today we are going to see a project that collect your home temperature and humidity in real time!&lt;/p&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%2Fuploads%2Farticles%2Fm3bmfae81zmhnnukv8lp.gif" 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%2Fuploads%2Farticles%2Fm3bmfae81zmhnnukv8lp.gif" alt="base app overview"&gt;&lt;/a&gt;&lt;br&gt;
before talking in the detail about the app is important to understand the architecture.&lt;/p&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%2Fuploads%2Farticles%2F2bp83qf82ocu7pcm64uh.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%2Fuploads%2Farticles%2F2bp83qf82ocu7pcm64uh.png" alt="architecture"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;as we can see there are many different parts:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Backend: write using node js and TS, handle the redis integration using redis OM, MongoDb integration, Aws Iot real time MQTT connection
and Tensorflow js model utilization. Use redis for reading the real time sensor messagges over the MQTT channel "machines" and try to find a sensor associated with it,
if found insert a datalog of the received data in both MongoDb and redis for rapid real time data into the frontend graph.
the alarm logic is associated to the datalogs, if when a datalog is created trigger an alarm rule an active alarm is created and will be closed only when an alarm below the trashold arrive, all the alarms are stored and not deleted.
Tensorflow is used to read a very simple regression model and use it for the next hour predictions.
the most cool features of the backend are: 

&lt;ul&gt;
&lt;li&gt;Aws Iot integration&lt;/li&gt;
&lt;li&gt;Tensorflow Js integration to parse an existing ML model and use it into JS&lt;/li&gt;
&lt;li&gt;Redis integration to cache data and use redis JSON and redis search to get real time data&lt;/li&gt;
&lt;li&gt;Redis model generator that take an existing Mongoose model and parse it into a redis one with no code logic!&lt;/li&gt;
&lt;li&gt;the alarms rules that are stored into the database!, an example is:
&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{
    "_id" : ObjectId("6300e639830e983ff546f7af"),
    "sensorId" : ObjectId("62fce2bc830e983ff546f775"),
    "rule" : {
        "&amp;gt;" : [
            {
                "var" : "temp"
            },
            25.0
        ]
    },
    "name" : "Bedroom High Temperature",
    "type" : "rule"
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;as you can see the rule is a sort of logic!, in fact this is possible by the JSON logic module. &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Frontend: retrieve the data from the backend API to make a graph based on a custom range time, in the graph you can choose the sensor who data you want to see,
there is also the average temperature and humidity cards in the bottom of the dashboard that show you the Average in the &lt;strong&gt;selected range&lt;/strong&gt;. 
the alrams are real time and retrived with only 1 minute cache to don't lose the new alarms, as explained before the alrams are created only when a value trigger an alarm trashold.
there is also a home map to see the sensors disposition and have an idea of the space, the "SUN" card show you the &lt;strong&gt;actual&lt;/strong&gt; values and not the average.
the last card show you the prediction fo the next hour.
All the components support the &lt;strong&gt;multi theme&lt;/strong&gt; feature to personalize the user experience.&lt;/li&gt;
&lt;/ul&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%2Fuploads%2Farticles%2Fviibmjdwtr2oo91csez2.gif" 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%2Fuploads%2Farticles%2Fviibmjdwtr2oo91csez2.gif" alt="theme"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;frontend also have mobile support but only &lt;strong&gt;Horizontal&lt;/strong&gt; not vertical!&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Sensors: send real time temperature and humidity data every 5 minutes, integrated with Aws-Iot. this sensor are made using Mongoose Os, a really cool it framework that help to increase speed using simil JS code. for the code see the Firmware repo&lt;/li&gt;
&lt;/ul&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%2Fuploads%2Farticles%2Fc6fyawk3lio1h4w5hdyg.jpg" 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%2Fuploads%2Farticles%2Fc6fyawk3lio1h4w5hdyg.jpg" alt="sensor"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Redis: used to store the cache and the partial datalogs data to speed up the responses time and keep retrive graphic data simple.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;MongoDb: used to store all other data like sensor and alarms&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;
  
  
  Previews
&lt;/h3&gt;

&lt;p&gt;Live Preview: &lt;a href="https://iot-sensor-frontend-git-master-marco-bertelli.vercel.app/pages/iot-dashboard" rel="noopener noreferrer"&gt;Site&lt;/a&gt;&lt;br&gt;
after enter into the site select a range and enjoy it!&lt;/p&gt;

&lt;p&gt;now that we know the base of the app is time to talk about the redis integration, it help a lot for the graph real time data, because as we say before the data are partial stored into redis to take i for graphs, before redis with only mongo the response time was 300 ms, after 120 ms what a great thing!. i also use redis cache to store the most important and slow enpoint (like the tensorflow one) and it was very helpfull, here we go too see a list of endpoints and used cache:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;datalogs/: 

&lt;ul&gt;
&lt;li&gt;/predict: predict the next hour data, using redis cache to keep it for 15 minutes&lt;/li&gt;
&lt;li&gt;/ambient/now: actual data&lt;/li&gt;
&lt;li&gt;/:sensorId/:interval: get datalogs of a sensor use redis JSON and redis Search!&lt;/li&gt;
&lt;li&gt;/ambient/humidity/:interval: Average humidity&lt;/li&gt;
&lt;li&gt;/ambient/temperature/:interval: Average temp&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;alarms/:

&lt;ul&gt;
&lt;li&gt;/active: get active alrams, use redis cache to store it for 1 minutes&lt;/li&gt;
&lt;li&gt;/finished: get finished alarms: use redis cache to keep it for 3 minutes&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;sensors/: get the sensor list, use redis cache to keep it for 30 minutes.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;so a full list of frontend feature you can try in the live demo!&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;real time graph data from my house sensors on 1 or more sensor in an interval&lt;/li&gt;
&lt;li&gt;2D map to take an idea of sensor position&lt;/li&gt;
&lt;li&gt;active alarms up to now!&lt;/li&gt;
&lt;li&gt;average temp and humidity in the selected range&lt;/li&gt;
&lt;li&gt;card with actuals info&lt;/li&gt;
&lt;li&gt;next hours prevision using ML!&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
  
  
  futures feature
&lt;/h2&gt;

&lt;p&gt;the only thing that i don't have time to make was a complete ML model, in fact this simple one use a regression but a complete one is a timeseries prevision model!&lt;/p&gt;
&lt;h3&gt;
  
  
  Submission Category: MEAN/MERN Mavericks
&lt;/h3&gt;
&lt;h3&gt;
  
  
  video overview of the project &lt;a href="https://www.youtube.com/watch?v=0IFBh0KPuxA" rel="noopener noreferrer"&gt;Video&lt;/a&gt;
&lt;/h3&gt;
&lt;h3&gt;
  
  
  Language Used
&lt;/h3&gt;

&lt;p&gt;Node js / TS for the backend&lt;br&gt;
Angular for the frontend&lt;br&gt;
Mongoose Os for the firmware code&lt;/p&gt;
&lt;h3&gt;
  
  
  Link to Code
&lt;/h3&gt;

&lt;p&gt;Live Preview: &lt;a href="https://iot-sensor-frontend-git-master-marco-bertelli.vercel.app/pages/iot-dashboard" rel="noopener noreferrer"&gt;Site&lt;/a&gt;&lt;br&gt;
after enter into the site select a range and enjoy it!&lt;br&gt;
BackeEnd repo: &lt;/p&gt;
&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&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%2Fassets%2Fgithub-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/marco-bertelli" rel="noopener noreferrer"&gt;
        marco-bertelli
      &lt;/a&gt; / &lt;a href="https://github.com/marco-bertelli/iotSensorBackend" rel="noopener noreferrer"&gt;
        iotSensorBackend
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      Backend with node js and TS for redis hackathon
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class="ltag-github-body"&gt;
    
&lt;div id="readme" class="md"&gt;
&lt;div class="markdown-heading"&gt;
&lt;h1 class="heading-element"&gt;SmartHome&lt;/h1&gt;
&lt;/div&gt;

&lt;p&gt;this is a project that get real time temperature and humidity data from esp32 with DHT22 AM2302 temperature sensor. after this the data
is stored in both redis and MongoDb and processed from the frontend (see the other repo for more frontend info)&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/marco-bertelli/iotSensorBackend./assets/baseGraph.gif" rel="noopener noreferrer"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fgithub.com%2Fmarco-bertelli%2FiotSensorBackend.%2Fassets%2FbaseGraph.gif" alt="Embed your YouTube video"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/marco-bertelli/iotSensorBackend./assets/customColor.gif" rel="noopener noreferrer"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fgithub.com%2Fmarco-bertelli%2FiotSensorBackend.%2Fassets%2FcustomColor.gif" alt="Embed your YouTube video"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/marco-bertelli/iotSensorBackend./assets/map.png" rel="noopener noreferrer"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fgithub.com%2Fmarco-bertelli%2FiotSensorBackend.%2Fassets%2Fmap.png" alt="Embed your YouTube video"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/marco-bertelli/iotSensorBackend./assets/footer.png" rel="noopener noreferrer"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fgithub.com%2Fmarco-bertelli%2FiotSensorBackend.%2Fassets%2Ffooter.png" alt="Embed your YouTube video"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;div class="markdown-heading"&gt;
&lt;h1 class="heading-element"&gt;Overview video&lt;/h1&gt;
&lt;/div&gt;

&lt;p&gt;Here's a short video that explains the project and how it uses Redis:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.youtube.com/watch?v=0IFBh0KPuxA" rel="nofollow noopener noreferrer"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fgithub.com%2Fmarco-bertelli%2FiotSensorBackend.%2Fassets%2Fmap.png" alt="Embed your YouTube video"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;How it works&lt;/h2&gt;
&lt;/div&gt;

&lt;p&gt;before start is important to understand the app architecture:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/marco-bertelli/iotSensorBackend./assets/architecture.png" rel="noopener noreferrer"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fgithub.com%2Fmarco-bertelli%2FiotSensorBackend.%2Fassets%2Farchitecture.png" alt="Embed your YouTube video"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;as we can see there are many different parts:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Backend: write using node js and TS, handle the redis integration using redis OM, MongoDb integration, Aws Iot real time MQTT connection
and Tensorflow js model utilization. Use redis for reading the real time sensor messagges over the MQTT channel "machines" and try to find a sensor associated with it
if found insert a datalog of the received data in both MongoDb and redis for rapid real time data into…&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
  &lt;/div&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/marco-bertelli/iotSensorBackend" rel="noopener noreferrer"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;br&gt;
FrontEnd repo: &lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&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%2Fassets%2Fgithub-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/marco-bertelli" rel="noopener noreferrer"&gt;
        marco-bertelli
      &lt;/a&gt; / &lt;a href="https://github.com/marco-bertelli/iotSensorFrontend" rel="noopener noreferrer"&gt;
        iotSensorFrontend
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      Angular ngx-admin frontend for redis challenge
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class="ltag-github-body"&gt;
    
&lt;div id="readme" class="md"&gt;
&lt;div class="markdown-heading"&gt;
&lt;h1 class="heading-element"&gt;SmartHome&lt;/h1&gt;
&lt;/div&gt;
&lt;p&gt;this is a project that get real time temperature and humidity data from esp32 with DHT22 AM2302 temperature sensor. after this the data
is stored in both redis and MongoDb and processed from the frontend (see the other repo for more frontend info)&lt;/p&gt;
&lt;p&gt;&lt;a href="https://github.com/marco-bertelli/iotSensorFrontend./assets/baseGraph.gif" rel="noopener noreferrer"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fgithub.com%2Fmarco-bertelli%2FiotSensorFrontend.%2Fassets%2FbaseGraph.gif" alt="Embed your YouTube video"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://github.com/marco-bertelli/iotSensorFrontend./assets/customColor.gif" rel="noopener noreferrer"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fgithub.com%2Fmarco-bertelli%2FiotSensorFrontend.%2Fassets%2FcustomColor.gif" alt="Embed your YouTube video"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://github.com/marco-bertelli/iotSensorFrontend./assets/map.png" rel="noopener noreferrer"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fgithub.com%2Fmarco-bertelli%2FiotSensorFrontend.%2Fassets%2Fmap.png" alt="Embed your YouTube video"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://github.com/marco-bertelli/iotSensorFrontend./assets/footer.png" rel="noopener noreferrer"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fgithub.com%2Fmarco-bertelli%2FiotSensorFrontend.%2Fassets%2Ffooter.png" alt="Embed your YouTube video"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;div class="markdown-heading"&gt;
&lt;h1 class="heading-element"&gt;Overview video&lt;/h1&gt;
&lt;/div&gt;
&lt;p&gt;Here's a short video that explains the project and how it uses Redis:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://www.youtube.com/watch?v=0IFBh0KPuxA" rel="nofollow noopener noreferrer"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fgithub.com%2Fmarco-bertelli%2FiotSensorFrontend.%2Fassets%2Fmap.png" alt="Embed your YouTube video"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;How it works&lt;/h2&gt;
&lt;/div&gt;
&lt;p&gt;before start is important to understand the app architecture:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://github.com/marco-bertelli/iotSensorFrontend./assets/architecture.png" rel="noopener noreferrer"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fgithub.com%2Fmarco-bertelli%2FiotSensorFrontend.%2Fassets%2Farchitecture.png" alt="Embed your YouTube video"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;as we can see there are many different parts:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Backend: write using node js and TS, handle the redis integration using redis OM, MongoDb integration, Aws Iot real time MQTT connection
and Tensorflow js model utilization. Use redis for reading the real time sensor messagges over the MQTT channel "machines" and try to find a sensor associated with it
if found insert a datalog of the received data in both MongoDb and redis for rapid real time data into…&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
  &lt;/div&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/marco-bertelli/iotSensorFrontend" rel="noopener noreferrer"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;br&gt;
Firmware repo: &lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&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%2Fassets%2Fgithub-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/marco-bertelli" rel="noopener noreferrer"&gt;
        marco-bertelli
      &lt;/a&gt; / &lt;a href="https://github.com/marco-bertelli/iotSensorFirmware" rel="noopener noreferrer"&gt;
        iotSensorFirmware
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      the firmware code for the esp32 sensors
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class="ltag-github-body"&gt;
    
&lt;div id="readme" class="md"&gt;
&lt;div class="markdown-heading"&gt;
&lt;h1 class="heading-element"&gt;SmartHome&lt;/h1&gt;
&lt;/div&gt;
&lt;p&gt;this is a project that get real time temperature and humidity data from esp32 with DHT22 AM2302 temperature sensor. after this the data
is stored in both redis and MongoDb and processed from the frontend (see the other repo for more frontend info)&lt;/p&gt;
&lt;p&gt;&lt;a href="https://github.com/marco-bertelli/iotSensorFirmware./assets/baseGraph.gif" rel="noopener noreferrer"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fgithub.com%2Fmarco-bertelli%2FiotSensorFirmware.%2Fassets%2FbaseGraph.gif" alt="Embed your YouTube video"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://github.com/marco-bertelli/iotSensorFirmware./assets/customColor.gif" rel="noopener noreferrer"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fgithub.com%2Fmarco-bertelli%2FiotSensorFirmware.%2Fassets%2FcustomColor.gif" alt="Embed your YouTube video"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://github.com/marco-bertelli/iotSensorFirmware./assets/map.png" rel="noopener noreferrer"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fgithub.com%2Fmarco-bertelli%2FiotSensorFirmware.%2Fassets%2Fmap.png" alt="Embed your YouTube video"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://github.com/marco-bertelli/iotSensorFirmware./assets/footer.png" rel="noopener noreferrer"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fgithub.com%2Fmarco-bertelli%2FiotSensorFirmware.%2Fassets%2Ffooter.png" alt="Embed your YouTube video"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;div class="markdown-heading"&gt;
&lt;h1 class="heading-element"&gt;Overview video&lt;/h1&gt;
&lt;/div&gt;
&lt;p&gt;Here's a short video that explains the project and how it uses Redis:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://www.youtube.com/watch?v=0IFBh0KPuxA" rel="nofollow noopener noreferrer"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fgithub.com%2Fmarco-bertelli%2FiotSensorFirmware.%2Fassets%2Fmap.png" alt="Embed your YouTube video"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;How it works&lt;/h2&gt;
&lt;/div&gt;
&lt;p&gt;before start is important to understand the app architecture:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://github.com/marco-bertelli/iotSensorFirmware./assets/architecture.png" rel="noopener noreferrer"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fgithub.com%2Fmarco-bertelli%2FiotSensorFirmware.%2Fassets%2Farchitecture.png" alt="Embed your YouTube video"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;as we can see there are many different parts:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Backend: write using node js and TS, handle the redis integration using redis OM, MongoDb integration, Aws Iot real time MQTT connection
and Tensorflow js model utilization. Use redis for reading the real time sensor messagges over the MQTT channel "machines" and try to find a sensor associated with it
if found insert a datalog of the received data in both MongoDb and redis for rapid real time data into…&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
  &lt;/div&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/marco-bertelli/iotSensorFirmware" rel="noopener noreferrer"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;br&gt;
Tensorflow Model: if you want more info of tensorflow visit the model here: &lt;a href="https://colab.research.google.com/drive/14tjipy3yHAeLTcxzom1SU8sERq2GiEgl?usp=sharing" rel="noopener noreferrer"&gt;colab&lt;/a&gt;
&lt;h2&gt;
  
  
  closure
&lt;/h2&gt;

&lt;p&gt;if you like the project or have any questions leave a like and a comment! &lt;br&gt;
all the shares will be appreciated!&lt;/p&gt;



&lt;ul&gt;
&lt;li&gt;&lt;em&gt;Check out &lt;a href="https://redis.io/docs/stack/get-started/clients/#high-level-client-libraries" rel="noopener noreferrer"&gt;Redis OM&lt;/a&gt;, client libraries for working with Redis as a multi-model database.&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;&lt;em&gt;Use &lt;a href="https://redis.info/redisinsight" rel="noopener noreferrer"&gt;RedisInsight&lt;/a&gt; to visualize your data in Redis.&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;&lt;em&gt;Sign up for a &lt;a href="https://redis.info/try-free-dev-to" rel="noopener noreferrer"&gt;free Redis database&lt;/a&gt;.&lt;/em&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>redishackathon</category>
      <category>showdev</category>
      <category>iot</category>
      <category>javascript</category>
    </item>
    <item>
      <title>Azure Trial Hackathon - EmotionalSound - perfect spotify song for your emotions</title>
      <dc:creator>marco-bertelli</dc:creator>
      <pubDate>Tue, 08 Mar 2022 00:47:24 +0000</pubDate>
      <link>https://dev.to/marcobertelli/azure-trial-hackathon-emotionalsound-perfect-spotify-song-for-your-emotions-4eg2</link>
      <guid>https://dev.to/marcobertelli/azure-trial-hackathon-emotionalsound-perfect-spotify-song-for-your-emotions-4eg2</guid>
      <description>&lt;p&gt;&lt;strong&gt;Project Links&lt;/strong&gt;&lt;br&gt;
&lt;a href="https://black-desert-0f8deaa10.1.azurestaticapps.net"&gt;Demo&lt;/a&gt;&lt;br&gt;
&lt;a href="https://github.com/marco-bertelli/emotional-sound-frontend"&gt;Frontend&lt;/a&gt;&lt;br&gt;
&lt;a href="https://bitbucket.org/becodebg/emotionsound/src/master/"&gt;BackEnd&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Overview of our project&lt;/strong&gt;&lt;br&gt;
This project goal is to suggest real Spotify songs by understanding face emotions.&lt;br&gt;
This project help you to find perfect sound for your actual mood!&lt;br&gt;
You only have to enter in the demo, take a photo of your face and see which new Spotify song &lt;strong&gt;EmotionalSound&lt;/strong&gt; suggest for you.&lt;br&gt;
If you click the button you can real time listen the song on Spotify!.&lt;br&gt;
Every 5 minutes the back-end search for new real time released and add it to song list.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Preview&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--OWjp98W9--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0qa9mfix94w43r5y5h0r.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--OWjp98W9--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0qa9mfix94w43r5y5h0r.gif" alt="Azure live demo" width="880" height="402"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Mobile&lt;/strong&gt;&lt;br&gt;
This project have full mobile support (also Safari), and if you click the Spotify Button you can open the Song in your mobile application&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Submission Category&lt;/strong&gt;:&lt;br&gt;
The category for this project is: AI Aces.&lt;br&gt;
I am using &lt;strong&gt;Azure Face API&lt;/strong&gt; for detecting the face emotions and a custom classification neural network made with &lt;strong&gt;Tensorflow&lt;/strong&gt; and compiled to be used by &lt;strong&gt;TensorFlowJs&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;In addition, to publish the frontend i am using an &lt;strong&gt;Azure Static Webapp&lt;/strong&gt; (great Angular support) and for the backend an &lt;strong&gt;Azure App Service&lt;/strong&gt; with custom Docker images.&lt;/p&gt;

&lt;p&gt;For docker images i use &lt;strong&gt;Azure Container Registry&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;For frontend i have implemented CI/CD with GitHub Actions.&lt;br&gt;
Instead for back-end i prefer to use Bitbucket with Custom Pipelines for build And Deploy the Docker images.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Neural Network Model&lt;/strong&gt;:&lt;br&gt;
the neural network model is a quite simple classification model that use the normalized data from &lt;strong&gt;Spotify API&lt;/strong&gt; to understand the mood of a song Based on Song Background Frequency and other values.&lt;br&gt;
To better Understand this part i suggest you to visit and try the &lt;strong&gt;Google Collab&lt;/strong&gt; project here!: &lt;a href="https://colab.research.google.com/drive/1Orj8wboKwYqoJhAyEQ5CU19va4Vtw7t-?usp=sharing"&gt;Collab Url&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Tech Stack&lt;/strong&gt;&lt;br&gt;
The frontend is written in Angular 11.&lt;br&gt;
From the homepage of the application,you can take picture from your webcam and the image is send as a base64 string directly to the Backend, through an API.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;YOUR DATA ARE NOT STORED IN ANY WAY&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The backend is written in &lt;strong&gt;Node js 16&lt;/strong&gt; and &lt;strong&gt;Express&lt;/strong&gt;.&lt;br&gt;
For the database to store the song retrived by Spotify Api i use &lt;strong&gt;MongoDb 4.4&lt;/strong&gt;.&lt;br&gt;
an example of Database doc is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{ 
    "_id" : ObjectId("6224cff6eff1e8fefdf67e45"), 
    "name" : "Don’t Forget My Love", 
    "__v" : NumberInt(0), 
    "image" : "https://i.scdn.co/image/ab67616d0000b2732cfa4b40e2d7b56fb171dd53", 
    "mood" : "2", 
    "spotifyUrl" : "https://open.spotify.com/track/5L7ddKqhj6xZFeb8ZOoI4r"
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For interact with Mongodb i use &lt;strong&gt;mongoose&lt;/strong&gt;, an npm library for easy wrap all.&lt;br&gt;
The API receives the base64 string image from the Frontend and sends it to the Azure Face API directly using a simple &lt;strong&gt;axios&lt;/strong&gt; call.&lt;br&gt;
The Back-end get the response from azure and understand the max mood (es happiness) and send it to the client with the saved songs generated from The Neural Network and Spotify Api.&lt;br&gt;
Every 5 minutes the back-end get new spotify releases from the API and &lt;strong&gt;Neural Network&lt;/strong&gt; analise the data for understand the mood of the new song, and save it to &lt;strong&gt;Mongo&lt;/strong&gt;.&lt;br&gt;
On the results page, we display a “dynamic” mood label with the founded songs and a button to real-time listen it.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Azure resources&lt;/strong&gt;&lt;br&gt;
This is the list of our services deployed on Azure:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--8QUHzLZ---/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7gaxcz978rsg5bpzlhue.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--8QUHzLZ---/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7gaxcz978rsg5bpzlhue.png" alt="Azure resources" width="880" height="210"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;CI/CD&lt;/strong&gt;&lt;br&gt;
I have automated the Frontend builds through CI/CD thanks to two GitHub Actions generated from Azure.&lt;/p&gt;

&lt;p&gt;For the back-end i need a more complicated one that make a docker image and release it on the &lt;strong&gt;Azure Container Registry&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;image: atlassian/default-image:2
clone:
  depth: full
pipelines:
  branches:

    master:
      - step:
          name: Deploy to Azure
          caches:
            - docker
          services:
            - docker
          script:
            - docker login emotionalsound.azurecr.io -u $AZURE_USER -p $AZURE_PASS
            - docker build -t emotionalsound.azurecr.io/prod:latest .
            - docker push emotionalsound.azurecr.io/prod:latest
definitions:
  services:
    docker:
      memory: 3072  # increase docker memory for unit testing into the pipe
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;RoadMap&lt;/strong&gt;&lt;br&gt;
the project is official on Beta stage, my roadMap is to improve before the end of &lt;strong&gt;Hackathon&lt;/strong&gt; the import system to get more song to suggest, and random shuffle it for get more result variety.&lt;/p&gt;

&lt;p&gt;If anyone encounters any kind of bug, please report it in the comments&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;About Me&lt;/strong&gt;&lt;br&gt;
My name is Marco Bertelli, i am a 21 years old back-end developer that work in &lt;a href="https://www.runelab.it"&gt;Runelab&lt;/a&gt;.&lt;br&gt;
This is my first &lt;strong&gt;Hackathon&lt;/strong&gt;, if you have suggestions or comments are Welcome.&lt;br&gt;
If you like the project &lt;strong&gt;Comment&lt;/strong&gt; and &lt;strong&gt;Share&lt;/strong&gt; this article on Linkedin or with your friend!&lt;/p&gt;

&lt;p&gt;If anyone has any questions or suggestions, don't hesitate to leave a comment!&lt;/p&gt;

</description>
      <category>azuretrialhack</category>
      <category>hackathon</category>
      <category>showdev</category>
      <category>javascript</category>
    </item>
    <item>
      <title>mongoose recommended plugin</title>
      <dc:creator>marco-bertelli</dc:creator>
      <pubDate>Sun, 28 Nov 2021 16:52:18 +0000</pubDate>
      <link>https://dev.to/marcobertelli/mongoose-recommended-plugin-gpe</link>
      <guid>https://dev.to/marcobertelli/mongoose-recommended-plugin-gpe</guid>
      <description>&lt;p&gt;the scope of this library is allow mongoose users to implement in a simple way a content-based recommended system with mongoose schema,&lt;br&gt;
is pretty simple and in future i want to introduce a collaborative-filter method.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;how work?&lt;/strong&gt;:&lt;br&gt;
calculate similarities between mongoose entities on a single text field using tfidf and vector distance, for more search content-based systems descriptions&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;how to use this library&lt;/strong&gt;&lt;br&gt;
after install in your project add the plugin in entity schema in wich you want similar entities:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import { RecommendedPlugin } from 'mongoose-recommended-plugin';

const mongooseSchema = {

    YOUR SCHEMA DEFINITION

    };


    // before generating the model 
    mongooseSchema.plugin(RecommendedPlugin);

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

&lt;/div&gt;



&lt;p&gt;after add the plugin to schema you can put in schema types two new field:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;similar = indicate the text field to calculate similarity like name or description&lt;/li&gt;
&lt;li&gt;minSimilarity = indicate the min percentage to mark another entity similar (es 0.1 is 10%)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;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;{
        offerCode: {
            type: String,
            odinQFilter: true
        },
        discountCode: {
            type: String,
        },
        // make sure place similar on a String field!
        discountDescription: {
            type: String,
            odinQFilter: true,
            similar: true,
            minSimilarity: 0.1
        },
        originalPrice: {
            type: Number
        },
        discountedPrice: {
            type: Number
        },
        discountPercentage: {
            type: Number
        },
        startDate: {
            type: Date
        },
        endDate: {
            type: Date
        },
        neverExpire: {
            type: Boolean,
            default: false
        },
        offerLink: {
            type: String
        },
}

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

&lt;/div&gt;



&lt;p&gt;after this on the basic schema you have 2 new methods that allow you to calculate similars and get it:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;calculateSimilars&lt;/li&gt;
&lt;li&gt;getSimilar&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;important&lt;/strong&gt; &lt;br&gt;
before calling getSimilar you have to call calculateSimilars to calculate and save in the db the similars.&lt;br&gt;
we will see it now&lt;/p&gt;

&lt;p&gt;now we have to call calculateSimilars to get and save into db the results (plugin will save results in a collection name: BASIC_COLLECTION_NAME+similarresults).&lt;/p&gt;

&lt;p&gt;for using it i suggest using a schedulr like it:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import schedule from 'node-schedule';
import Offers from '../../api/offers/model';

const log = logger.child({ section: '\x1B[0;35mScheduler:\x1B[0m' });

export const start = function () {
    log.info('Starting...');

    schedule.scheduleJob('*/10 * * * * *',calculateSimilarsResult);

    log.info('Starting...', 'DONE');
};

async function calculateSimilarsResult(){
    await Offers.calculateSimilars();
}

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

&lt;/div&gt;



&lt;p&gt;this is an example of how calculate similars every 10 seconds, ut you can call it when you want and how you want.&lt;/p&gt;

&lt;p&gt;after this we can call seconds method passing the _id of entity for wich we want similars:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
await Offers.getSimilar('619d2d91eac832002d2f36de')

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

&lt;/div&gt;



&lt;p&gt;and thats all!&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;db format of plugin save&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
{ 
    "_id" : ObjectId("61a25cae646804e510d84f92"), 
    "relatedScore" : [
        {
            "id" : ObjectId("619d2d91eac832002d2f36de"), 
            "score" : 0.45293266622972733
        }
    ], 
    "entityId" : "619ac77c39dd6b002d1bd3bb", 
    "__v" : NumberInt(0)
}

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

&lt;/div&gt;



&lt;p&gt;for questions or contribute write at &lt;a href="mailto:marco.bertelli@runelab.it"&gt;marco.bertelli@runelab.it&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;i hope this library will be helpfull, if you like the project like and share this article!&lt;/p&gt;

</description>
      <category>mongodb</category>
      <category>node</category>
      <category>opensource</category>
      <category>javascript</category>
    </item>
    <item>
      <title>Terraform Trello integration</title>
      <dc:creator>marco-bertelli</dc:creator>
      <pubDate>Wed, 11 Aug 2021 09:12:43 +0000</pubDate>
      <link>https://dev.to/marcobertelli/terraform-trello-integration-jjb</link>
      <guid>https://dev.to/marcobertelli/terraform-trello-integration-jjb</guid>
      <description>&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--INhiQGOT--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mtag4node77raa5hfk38.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--INhiQGOT--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mtag4node77raa5hfk38.png" alt="amazing go"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Hi everyone, today we are going to watch my first open-source terraform custom provider in collaboration with Runelab (an italian custom software and project agency).&lt;/p&gt;

&lt;p&gt;but first what do this provider?&lt;/p&gt;

&lt;p&gt;allow you to create a workspace,board and custom list when you create a normal project on terraform!&lt;/p&gt;

&lt;p&gt;this automate the process of creating a trello workspace, board and lists when you create a normal project.&lt;/p&gt;

&lt;p&gt;see 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;#other resources creations like server and cloudfront

  required_providers {
    trello = {
      source = "marco-bertelli/trello"
      version = "0.2.3"
    }
  }
}


resource "trello_board" "my-board-name" {
    key = "your-key"
  token = "your-token"
  workspace_name = "terraform-trello"
  board_name = "test"
  cards = ["new","todo","custom"]
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;you must put this code into main.tf&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;how you can see you need a trello api key and a trello token of the account in who you want to create the workspace and board (you can find key and token here &lt;a href="https://trello.com/app-key"&gt;link&lt;/a&gt;)&lt;/p&gt;

&lt;p&gt;and later chose a name for workspace the board name and the lists names and is all! &lt;br&gt;
run:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;terraform init&lt;/li&gt;
&lt;li&gt;terraform apply 
and you will see all online&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;here the result:&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--N9PyT1K9--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vf8n301hixuhlmk7n7e1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--N9PyT1K9--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vf8n301hixuhlmk7n7e1.png" alt="final result"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;if you like this like and share to the community!&lt;/p&gt;

</description>
      <category>showdev</category>
      <category>tutorial</category>
      <category>productivity</category>
      <category>devops</category>
    </item>
    <item>
      <title>A LOT OF ANGULAR TUTORIALS!</title>
      <dc:creator>marco-bertelli</dc:creator>
      <pubDate>Sat, 17 Oct 2020 15:17:10 +0000</pubDate>
      <link>https://dev.to/marcobertelli/a-lot-of-angular-tutorials-1fdo</link>
      <guid>https://dev.to/marcobertelli/a-lot-of-angular-tutorials-1fdo</guid>
      <description>&lt;p&gt;how i wrote in my last post in the next two weeks it we will up my new project (a new site called angularDevCommunity in which i will post a lot of angular tutorial since lazy loading up to develop a full headless cms angular responsive project), stay tunned !&lt;/p&gt;

</description>
      <category>angular</category>
      <category>css</category>
      <category>productivity</category>
      <category>contributorswanted</category>
    </item>
    <item>
      <title>A BIG ANGULAR IDEA...</title>
      <dc:creator>marco-bertelli</dc:creator>
      <pubDate>Tue, 13 Oct 2020 07:58:58 +0000</pubDate>
      <link>https://dev.to/marcobertelli/a-big-angular-idea-3m21</link>
      <guid>https://dev.to/marcobertelli/a-big-angular-idea-3m21</guid>
      <description>&lt;p&gt;hi guys, i am new but i have a big idea, what do you think if i do a sites called AngularForDeveloper in which i post angular tutorial and my real project??&lt;/p&gt;

</description>
      <category>angular</category>
      <category>challenge</category>
      <category>css</category>
      <category>startup</category>
    </item>
  </channel>
</rss>
