<?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: Gabriel Leonte</title>
    <description>The latest articles on DEV Community by Gabriel Leonte (@gabrielleonte).</description>
    <link>https://dev.to/gabrielleonte</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%2F222356%2F40a77da8-e5d2-4493-bc50-23729e9cfd83.jpg</url>
      <title>DEV Community: Gabriel Leonte</title>
      <link>https://dev.to/gabrielleonte</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/gabrielleonte"/>
    <language>en</language>
    <item>
      <title>Stories - Share a love story, tell him/her anonymous and earn money using Web Monetization API and COIL! (Submission)</title>
      <dc:creator>Gabriel Leonte</dc:creator>
      <pubDate>Fri, 29 May 2020 11:11:19 +0000</pubDate>
      <link>https://dev.to/gabrielleonte/stories-share-a-love-story-tell-him-her-anonymous-and-earn-money-using-web-montetization-api-and-coil-2ej2</link>
      <guid>https://dev.to/gabrielleonte/stories-share-a-love-story-tell-him-her-anonymous-and-earn-money-using-web-montetization-api-and-coil-2ej2</guid>
      <description>&lt;h2&gt;
  
  
  What I built
&lt;/h2&gt;

&lt;p&gt;Stories is a web application that allows users to sent anonymous letters to a loved person. The best part of using our platform is the fact that everybody can earn moneys using Web Monetization API. The Platform Provides free content and premium content based on a COIL Subscription (5$ per month). &lt;/p&gt;

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

&lt;p&gt;Exciting Experiments and Creative Catalyst&lt;/p&gt;

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

&lt;p&gt;&lt;a href="https://stories-aca62.web.app/" rel="noopener noreferrer"&gt;Go to Stories&lt;/a&gt;&lt;/p&gt;

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

&lt;p&gt;&lt;a href="https://github.com/GabrielLeonte/Stories" rel="noopener noreferrer"&gt;Client&lt;/a&gt;&lt;br&gt;
&lt;a href="https://github.com/GabrielLeonte/Stories-Functions" rel="noopener noreferrer"&gt;Firebase Functions&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  How I built it
&lt;/h2&gt;

&lt;p&gt;The slack is a composite between Firebase and NuxtJS and Send Grid API&lt;br&gt;
We're using Firebase Hosting (for demo), Firebase Real Time Database to store every public post, and Firebase Functions for Send Grid API to deliver each amazing love letter.&lt;/p&gt;

&lt;p&gt;Day 1 started with another kind of idea, first project was a way that photographers can monetize their own photos, but after around 2 weeks while scrolling through Coil web page i just realized that this kind of project already exists and its Imgur Emerald.&lt;/p&gt;

&lt;p&gt;Day 20: After i found out that Imgur Emerald already exists, I've decided to build this love story project, because we're living a pandemic time, and the love expression has gone low because of the social distancing, so its the perfect time to write a love letter to the one we love. Why anonymous ? Well, you still have the opportunity to tell who you are, but let's get our loved ones more active and challenge them to find out who is behind that magic letter.&lt;/p&gt;

&lt;p&gt;Submission Day: Here we are with a working application that is ready to deliver awesome letters to our loved ones. This platform still has a lot of potential, i would like to make in production, but first of all, i need some teammates to do it, add email scheduling function, filtering functions, improve the UI and UX, and many more awesome things.&lt;/p&gt;

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

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://undraw.co/illustrations" rel="noopener noreferrer"&gt;Illustrations from Undraw.co&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://bulma.io/" rel="noopener noreferrer"&gt;Bulma Framework&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Screen Shots
&lt;/h2&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%2Fi%2Fa2rkbp4gcmh931urvkba.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%2Fi%2Fa2rkbp4gcmh931urvkba.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;br&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%2Fi%2Fp7sups9jhbf8ojaib5qd.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%2Fi%2Fp7sups9jhbf8ojaib5qd.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;br&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%2Fi%2Fler45f0zth9rgyr7fxdy.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%2Fi%2Fler45f0zth9rgyr7fxdy.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>gftwhackathon</category>
      <category>showdev</category>
    </item>
    <item>
      <title>#twiliohackathon #WeHelp - A platform made for everyone in the town (Submission)</title>
      <dc:creator>Gabriel Leonte</dc:creator>
      <pubDate>Wed, 29 Apr 2020 16:19:48 +0000</pubDate>
      <link>https://dev.to/gabrielleonte/twiliohackathon-wehelp-a-platform-made-for-everyone-in-the-town-submission-1685</link>
      <guid>https://dev.to/gabrielleonte/twiliohackathon-wehelp-a-platform-made-for-everyone-in-the-town-submission-1685</guid>
      <description>&lt;h2&gt;
  
  
  What I built
&lt;/h2&gt;

&lt;p&gt;We help is a platform that connects local citizens and volunteers, with the goal of helping them getting necessary products from local markets with the help of volunteers&lt;/p&gt;

&lt;h1&gt;
  
  
  How it works?
&lt;/h1&gt;

&lt;p&gt;This application has the backend built in NodeJS using Sequelize as ORM Manager, ExpressJS as handle server for Twilio API, and Socket.IO as client handle server. The frontend is entirely built in VueJS, CSS and Bulma.&lt;/p&gt;

&lt;h1&gt;
  
  
  How it works for the local citizens?
&lt;/h1&gt;

&lt;p&gt;A local citizen can call the free phone number provided by local authority, and say his requirements, with some contact data like his name, street, etc. 2-3 volunteers would have to forward his requirements to the volunteers from the field, with, who have a local budget and maybe a car. The field volunteer will receive through SMS Volunteer Delivery System, the contact data (contact name, phone number) + a little description, and his mission would be to contact the local citizen and provide his requirements right to his door.&lt;/p&gt;

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

&lt;p&gt;&lt;a href="https://we-help-5b11d.web.app/" rel="noopener noreferrer"&gt;We Help&lt;/a&gt;&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%2Fi%2Fa8zknv5q2tefexxv0hpp.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%2Fi%2Fa8zknv5q2tefexxv0hpp.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;br&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%2Fi%2F41e6wij5idhb0zqkialx.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%2Fi%2F41e6wij5idhb0zqkialx.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

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

&lt;p&gt;&lt;a href="https://github.com/GabrielLeonte/Dev.To-Hackathon" rel="noopener noreferrer"&gt;Github Repo&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Test Account
&lt;/h1&gt;

&lt;p&gt;Phone: +15014380799&lt;br&gt;
Password: 1234&lt;/p&gt;

&lt;h1&gt;
  
  
  Free USA Call Number (you may test it with skype)
&lt;/h1&gt;

&lt;p&gt;Number: +18554101733&lt;/p&gt;

&lt;h1&gt;
  
  
  Register Codes (Only USA Numbers)
&lt;/h1&gt;

&lt;p&gt;&lt;code&gt;E6LS-CZQ6-17I2&lt;br&gt;
S2LP-JJY9-14C9&lt;br&gt;
A5YH-YKJ1-38G5&lt;br&gt;
J3OP-PAW3-62V1&lt;br&gt;
I7NV-TZI1-55H7&lt;br&gt;
L1TE-DBP2-41B1&lt;br&gt;
L1VZ-GYH5-43Y2&lt;br&gt;
H9XL-YWK1-61Y8&lt;br&gt;
D8CP-OCA6-14J8&lt;br&gt;
K6IV-KDM3-29X9&lt;br&gt;
D8HE-FAD4-77Y3&lt;br&gt;
R8XV-MBF5-23T4&lt;br&gt;
B1SU-GAQ1-42R4&lt;br&gt;
K1AK-PFW6-82W3&lt;br&gt;
U1VP-GMB1-57H5&lt;br&gt;
C5UT-XDR5-74W4&lt;br&gt;
M5TB-FMI3-32X6&lt;br&gt;
V4AF-XCT7-88L8&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;!Reset password may now work because the phone number may be in a wrong format or the Twilio api is replying a &lt;a href="https://www.twilio.com/docs/api/errors/21408" rel="noopener noreferrer"&gt;21308 ERROR&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  How I built it (what's the stack? did I run into issues or discover something new along the way?)
&lt;/h2&gt;

&lt;p&gt;Well, actually twilio api was something new for me, and i can say that i am lucky. The last month was a productive one for me.&lt;/p&gt;

&lt;p&gt;I've started from the idea that such a country like Romania, has a lot of small villages where a lot of population are 65+ years, so a platform like mine may be a essential one.&lt;/p&gt;

&lt;p&gt;As a conclusion after 1 month, building this was not only a Hackathon project, it was a fun project, because while doing this i've experience so much things, from math homeworks to beautiful README fashion models 😆 &lt;br&gt;
Just check my commits name &lt;a href="https://github.com/GabrielLeonte/Dev.To-Hackathon/commits/master" rel="noopener noreferrer"&gt;Right Here 😸&lt;/a&gt;&lt;/p&gt;

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

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://help.github.com/en/github/creating-cloning-and-archiving-repositories/creating-a-repository-from-a-template" rel="noopener noreferrer"&gt;GitHub's repository template&lt;/a&gt; functionality&lt;/li&gt;
&lt;li&gt;&lt;a href="https://undraw.co/illustrations" rel="noopener noreferrer"&gt;Ilustrations from Undraw.co&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://bulma.io/" rel="noopener noreferrer"&gt;Bulma Framework&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>twiliohackathon</category>
      <category>node</category>
      <category>vue</category>
    </item>
    <item>
      <title>How I learned from my mistakes - JavaScript Mobile App</title>
      <dc:creator>Gabriel Leonte</dc:creator>
      <pubDate>Sun, 26 Jan 2020 18:14:18 +0000</pubDate>
      <link>https://dev.to/gabrielleonte/how-i-learned-from-my-mistakes-m4e</link>
      <guid>https://dev.to/gabrielleonte/how-i-learned-from-my-mistakes-m4e</guid>
      <description>&lt;p&gt;So, in the last 4 days. I have been working on a project for a contest in Romania. &lt;/p&gt;

&lt;p&gt;My competition idea says something like that: &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;I have to build a mobile application for a small town (~30K peoples), that will let a user, to temporarily hire another user, to do different kinds of jobs, like bringing you food, walk the dog, do the shopping, babysitting, bringing the clothes to the laundry, and other activities that require a small amount of movement &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;To build this mobile application, I should use Java for the mobile application and NodeJS for the back-end, right? Yes! You are right! But I love JavaScript! &lt;/p&gt;

&lt;p&gt;So I went with JavaScript for back-end and NuxtJS (first) + Cordova for IOS and Android applications!&lt;/p&gt;

&lt;h1&gt;
  
  
  The Beginning
&lt;/h1&gt;

&lt;p&gt;The project started with a simple back-end structure, written in Node.JS and a NuxtJS Project. &lt;/p&gt;

&lt;p&gt;After finishing the design for some basic screens (Splash, login, register),&lt;br&gt;
I've built the HTML and CSS for the Splash screen as a component inside the NuxtJS project, then inside the &lt;code&gt;layout/default.vue&lt;/code&gt;, I wrote a script that switches a variable from true to false.&lt;/p&gt;

&lt;p&gt;Using &lt;code&gt;v-if&lt;/code&gt; and &lt;code&gt;v-else&lt;/code&gt;, I was able to show my Splash for 3000 ms, then the Nuxt router view.&lt;br&gt;
Everything was perfect! For now...&lt;/p&gt;

&lt;p&gt;Meanwhile, I've created a Cordova project and generate the first &lt;code&gt;dist/&lt;/code&gt; folder. After moving the generated files from &lt;code&gt;dist/&lt;/code&gt; inside the &lt;code&gt;www/&lt;/code&gt; folder of the Cordova project, I added Android as the platform and build the first demo.&lt;/p&gt;

&lt;h1&gt;
  
  
  First Problem
&lt;/h1&gt;

&lt;p&gt;I ran it and surprise the splash screen wasn't working&lt;/p&gt;

&lt;p&gt;First, I thought Cordova wasn't running JavaScript because of some kind of option. I was lazy and I have not tried to check the documentation of both, only after 6 hours of trying different things, when I gave up on it, for the next day. &lt;/p&gt;

&lt;p&gt;The next day I gave up on NuxtJS after finding some Github issue about that (which I wasn't able to find the day before, because of being tired), which tells you NuxtJS is not compatible with Cordova.&lt;/p&gt;

&lt;h1&gt;
  
  
  How I Solved it?
&lt;/h1&gt;

&lt;p&gt;I used just VueJS instead of NuxtJS, which I chose first just because I am more familiar with it.&lt;/p&gt;

&lt;h1&gt;
  
  
  The Second Problem
&lt;/h1&gt;

&lt;p&gt;I've built a new project using Vue-CLI and Cordova. After that, I've built again the Splash screen and this time, the Login screen. &lt;/p&gt;

&lt;p&gt;Meanwhile, I integrated &lt;code&gt;vue-route-middleware&lt;/code&gt; to help me build easier middlewares in an elegant style, and set the mode to &lt;code&gt;history&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;After that, I've built a middleware that redirects to &lt;code&gt;/login&lt;/code&gt; if a state variable is empty. &lt;/p&gt;

&lt;p&gt;And then I've repeated the app-building process.&lt;/p&gt;

&lt;p&gt;Well, now redirecting was not working! The App punched me in the face, again. I gave up on it. The next day I tried Ionic with React, and here I failed, because the docs weren't clear about the status bar plugin... that was another problem!&lt;/p&gt;

&lt;h1&gt;
  
  
  How I Solved it?
&lt;/h1&gt;

&lt;p&gt;That night I found a Github issue to the same problem that I had with the VueJS + Cordova pack, and that issue topic was talking about the fact that Cordova is not able to redirect a Vue build application, that is using &lt;code&gt;mode:"history"&lt;/code&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Conclusion?
&lt;/h1&gt;

&lt;ol&gt;
&lt;li&gt;You should always check for a solution online, do not waste your time. Some frameworks things might not be documented!&lt;/li&gt;
&lt;li&gt;It is my first mobile app project using VueJS and Cordova, and I learned a lot from basic things.&lt;/li&gt;
&lt;li&gt;Always you should learn from your mistakes.&lt;/li&gt;
&lt;li&gt;You should always keep learning, doing what you love to do&lt;/li&gt;
&lt;li&gt;Remember FAIL means "First Attempt Into Learning!"&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;About the project, if anybody is curious it will be open source in the next months on my Github 😀&lt;/p&gt;

</description>
      <category>discuss</category>
      <category>javascript</category>
      <category>todayilearned</category>
      <category>vue</category>
    </item>
    <item>
      <title>Technologies that makes JavaScript a beautiful programming language!</title>
      <dc:creator>Gabriel Leonte</dc:creator>
      <pubDate>Mon, 13 Jan 2020 17:31:11 +0000</pubDate>
      <link>https://dev.to/gabrielleonte/technologies-that-makes-javascript-a-beautiful-programming-language-278c</link>
      <guid>https://dev.to/gabrielleonte/technologies-that-makes-javascript-a-beautiful-programming-language-278c</guid>
      <description>&lt;p&gt;Everybody should know that JavaScript is not just a language used for web pages. Below you are going to find some interesting JavaScript libraries :D&lt;/p&gt;

&lt;h1&gt;
  
  
  1. ExpressJS
&lt;/h1&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--FUVSYLQz--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/u5ihv74fgfllvcpex5fz.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--FUVSYLQz--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/u5ihv74fgfllvcpex5fz.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Express its the simplest way to create a web application. Built for Web Apps and API's, it is easy to learn, and provides a huge set of middleware with multiple scopes. Here is a simple Express app.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;express&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;express&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;app&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;express&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt; &lt;span class="c1"&gt;// create a new express object&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;port&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;3000&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// declare express server port&lt;/span&gt;

&lt;span class="c1"&gt;// create a get http route&lt;/span&gt;
&lt;span class="nx"&gt;app&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="kd"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;/&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;req&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
&lt;span class="c1"&gt;// Write on localhost:3000/ the string below&lt;/span&gt;
   &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;send&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Hello dev.to user :D I hope you will have a greate and productive day&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; 
&lt;span class="p"&gt;});&lt;/span&gt;

&lt;span class="c1"&gt;// listen the server on the declared port&lt;/span&gt;
&lt;span class="nx"&gt;app&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;listen&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;port&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
   &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;`The most simple and beautiful express app is live on port &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;port&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;And this is a simple Express web application!&lt;/p&gt;

&lt;p&gt;So let's talk about some Express middlewares.&lt;/p&gt;

&lt;h2&gt;
  
  
  A. Passport
&lt;/h2&gt;

&lt;p&gt;If you want to build a web app with an authentication system. Passport its the way to go. It uses the concept of strategies to authenticate requests.&lt;br&gt;
Strategies can range from verifying username and password credentials, delegated authentication using OAuth (for example, via Facebook or Google), or federated authentication using OpenID.&lt;/p&gt;
&lt;h2&gt;
  
  
  B. CORS
&lt;/h2&gt;

&lt;p&gt;Cross-origin requests are made using the standard HTTP request methods. Most servers will allow GET requests, meaning they will allow resources from external origins to read their assets. HTTP request methods like PATCH, PUT, or DELETE, may be denied to prevent malicious behavior. For example, many servers would not allow a request to change their assets.&lt;/p&gt;
&lt;h2&gt;
  
  
  C. Body Parser
&lt;/h2&gt;

&lt;p&gt;Body Parser parses incoming request bodies in a middleware before your handlers, available under the &lt;code&gt;req.body&lt;/code&gt; property.&lt;/p&gt;
&lt;h2&gt;
  
  
  D. Helmet
&lt;/h2&gt;

&lt;p&gt;Helmet its a set of middleware, built to make your awesome app secure, against different vulnerabilities.&lt;/p&gt;

&lt;p&gt;And more, each of them with their unique scope, which is that to make your web application/api the best one.&lt;/p&gt;

&lt;p&gt;For more, check out the guys from freeCodeCamp and ExpressJS Documentation &lt;/p&gt;
&lt;h1&gt;
  
  
  2. ElectronJS
&lt;/h1&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--alw9m0Sq--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/0q3tqywo4ys8zhlg65z2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--alw9m0Sq--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/0q3tqywo4ys8zhlg65z2.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Do you think that building a UI executable application, it impossible for NodeJS? You are wrong my friend! Electron its the way to go!&lt;/p&gt;

&lt;p&gt;So let's pretend that you have an index.html file, with some information.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// index.js&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;app&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;BrowserWindow&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;electron&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nx"&gt;createWindow&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="c1"&gt;// Create the browser window.&lt;/span&gt;
  &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;win&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nx"&gt;BrowserWindow&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
    &lt;span class="na"&gt;width&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;800&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;height&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;600&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;webPreferences&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="na"&gt;nodeIntegration&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="p"&gt;})&lt;/span&gt;

  &lt;span class="c1"&gt;// and load the index.html of the app.&lt;/span&gt;
  &lt;span class="nx"&gt;win&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;loadFile&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;index.html&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nx"&gt;app&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;on&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;ready&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;createWindow&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Using the code above, you can build an executable application for any desktop operating system (linux, windows and macos).&lt;/p&gt;

&lt;p&gt;Electron comes with apis that allows you to integrate functions inside the html files.&lt;br&gt;
&lt;code&gt;ipcMain&lt;/code&gt; is a event emitter build to emit events from the html files and handle it inside the back-end. &lt;/p&gt;

&lt;p&gt;Electron.JS can be used with static html files or frameworks like Vue, React or Angular.&lt;/p&gt;
&lt;h1&gt;
  
  
  3. VueJS
&lt;/h1&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--UOXINLBn--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/cymnrpku0rrwc0rxwp4w.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--UOXINLBn--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/cymnrpku0rrwc0rxwp4w.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;VueJS is a JavaScript framework for building user interfaces and single-page applications. It was created by Evan You, and is maintained by him and the rest of the active core team members.&lt;/p&gt;
&lt;h2&gt;
  
  
  Virtual DOM
&lt;/h2&gt;

&lt;p&gt;VueJS makes the use of virtual DOM, which is also used by other frameworks such as React, Ember, etc. The changes are not made to the DOM, instead a replica of the DOM is created which is present in the form of JavaScript data structures. &lt;/p&gt;
&lt;h2&gt;
  
  
  Data Binding
&lt;/h2&gt;

&lt;p&gt;The data binding feature helps manipulate or assign values to HTML attributes, change the style, assign classes with the help of binding directive called v-bind available with VueJS.&lt;/p&gt;
&lt;h2&gt;
  
  
  Components
&lt;/h2&gt;

&lt;p&gt;Components are one of the important features of VueJS that helps create custom elements, which can be reused in HTML.&lt;/p&gt;
&lt;h2&gt;
  
  
  Event Handling
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;v-on&lt;/code&gt; is the attribute added to the DOM elements to listen to the events in VueJS.&lt;/p&gt;
&lt;h2&gt;
  
  
  Computed properties
&lt;/h2&gt;

&lt;p&gt;This is one of the important features of VueJS. It helps to listen to the changes made to the UI elements and performs the necessary calculations. There is no need of additional coding for this.&lt;/p&gt;
&lt;h2&gt;
  
  
  Lightweight
&lt;/h2&gt;

&lt;p&gt;VueJS is very lightweight framework, and also the performance is very fast.&lt;/p&gt;
&lt;h1&gt;
  
  
  4. TensorFlow
&lt;/h1&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--lV37gKtc--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/yi1r2vgj091t0z1zz1s7.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--lV37gKtc--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/yi1r2vgj091t0z1zz1s7.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Developed by Google, TensorFlow is a javascript library for deploying and training models using Machine Learning in the Browser or NodeJS.&lt;/p&gt;

&lt;p&gt;Find more &lt;a href="https://www.tensorflow.org/js?hl=ro"&gt;here&lt;/a&gt;!&lt;/p&gt;
&lt;h1&gt;
  
  
  5. Native VueJS
&lt;/h1&gt;

&lt;p&gt;Vue Native is based on VueJS and is a framework to build cross platform native mobile apps using JavaScript. &lt;br&gt;
Vue native core is designed to connect React and Vue, which help you run Vue in React. But for more about this beautiful framework you can find &lt;a href="https://vue-native.io/"&gt;here&lt;/a&gt;&lt;/p&gt;
&lt;h1&gt;
  
  
  6. Async, Await and promises
&lt;/h1&gt;

&lt;p&gt;I left the gold at the end. In the past, javascript had a big problem, you may heared about &lt;code&gt;callback hell&lt;/code&gt;, a callback hell is something like below:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;checkUser&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;username&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;password&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;callback&lt;/span&gt;&lt;span class="p"&gt;){&lt;/span&gt;
   &lt;span class="nx"&gt;dataBase&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;checkUser&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;username&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;password&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;error&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;userInfo&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
       &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;error&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
           &lt;span class="nx"&gt;callback&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;error&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
       &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="k"&gt;else&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
           &lt;span class="nx"&gt;dataBase&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;getRoles&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;username&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;error&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;roles&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
               &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;error&lt;/span&gt;&lt;span class="p"&gt;){&lt;/span&gt;
                   &lt;span class="nx"&gt;callback&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;error&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
               &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
                   &lt;span class="nx"&gt;dataBase&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;getAccess&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;username&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;error&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
                       &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;error&lt;/span&gt;&lt;span class="p"&gt;){&lt;/span&gt;
                           &lt;span class="nx"&gt;callback&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;error&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
                       &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="k"&gt;else&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
                           &lt;span class="nx"&gt;callback&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kc"&gt;null&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;userInfo&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;roles&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
                       &lt;span class="p"&gt;}&lt;/span&gt;
                   &lt;span class="p"&gt;})&lt;/span&gt;
               &lt;span class="p"&gt;}&lt;/span&gt;
           &lt;span class="p"&gt;})&lt;/span&gt;
       &lt;span class="p"&gt;}&lt;/span&gt;
   &lt;span class="p"&gt;})&lt;/span&gt;
&lt;span class="p"&gt;};&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Is it easy to read? I don't think so!&lt;br&gt;
To avoid it, you have to write it using async await and promises&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;checkUser&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;username&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;password&lt;/span&gt;&lt;span class="p"&gt;){&lt;/span&gt;
   &lt;span class="k"&gt;try&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
       &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;userInfo&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;dataBase&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;checkUser&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;username&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;password&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
       &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;rolesInfo&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;dataBase&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;getRoles&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;userInfo&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
       &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;logStatus&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;dataBase&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;getAccess&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;userInfo&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
       &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;userInfo&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
   &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="k"&gt;catch&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;e&lt;/span&gt;&lt;span class="p"&gt;){&lt;/span&gt;
       &lt;span class="c1"&gt;//handle errors as needed&lt;/span&gt;
   &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;};&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;How to convert a callback to a promise? That is simple&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;database&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="kd"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;err&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;err&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;throw&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nb"&gt;Error&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;err&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;converted to a promise looks like that&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="kd"&gt;get&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nb"&gt;Promise&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nx"&gt;resolve&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;reject&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="nx"&gt;database&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="kd"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;err&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;err&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="nx"&gt;reject&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;err&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
            &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="nx"&gt;resolve&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
        &lt;span class="p"&gt;});&lt;/span&gt;
    &lt;span class="p"&gt;});&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Is is easy to read now? I think so!&lt;/p&gt;

&lt;h1&gt;
  
  
  So just a small recap
&lt;/h1&gt;

&lt;p&gt;The JavaScript community its big, and beautiful. Each of these frameworks comes with their unique features, that makes JavaScript a language for almost every kind of operation. If you do not have any experience with it. You should try. I bet that you will love it.&lt;/p&gt;

&lt;p&gt;Have a nice and productive day guys!&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>node</category>
      <category>productivity</category>
      <category>todayilearned</category>
    </item>
    <item>
      <title>The chain - Just a simple way to integrate a blockchain</title>
      <dc:creator>Gabriel Leonte</dc:creator>
      <pubDate>Sat, 21 Dec 2019 19:45:41 +0000</pubDate>
      <link>https://dev.to/gabrielleonte/the-chain-just-a-simple-way-to-integrate-a-blockchain-ok7</link>
      <guid>https://dev.to/gabrielleonte/the-chain-just-a-simple-way-to-integrate-a-blockchain-ok7</guid>
      <description>&lt;p&gt;So, let's talk about The chain. The chain its a npm package made for anyone interested to build a Node.JS Blockchain App. &lt;/p&gt;

&lt;h1&gt;
  
  
  How it started?
&lt;/h1&gt;

&lt;p&gt;Some months ago, i've been looking for a blockchain package, something that can help me build a blockchain based social media.&lt;br&gt;
So i have been searching the hole npm for one, that can create a simple blockchain database in less then 5 minutes, which can create new block at a custom time interval, and also provide a simple API to make my life easier.&lt;/p&gt;
&lt;h1&gt;
  
  
  Why The Chain instead of a simple database
&lt;/h1&gt;

&lt;p&gt;The Chain its not only a sqlite3 database with some default table, The Chain its a package that comes with ways that must help the developer reduce the time to build his awesome blockchain application.&lt;/p&gt;
&lt;h1&gt;
  
  
  Features
&lt;/h1&gt;

&lt;ul&gt;
&lt;li&gt;Easy to integrate to existing apps&lt;/li&gt;
&lt;li&gt;A very customizable chain&lt;/li&gt;
&lt;li&gt;Custom block time&lt;/li&gt;
&lt;li&gt;Block verify function&lt;/li&gt;
&lt;li&gt;Local database&lt;/li&gt;
&lt;/ul&gt;
&lt;h1&gt;
  
  
  Incoming Features!
&lt;/h1&gt;

&lt;ul&gt;
&lt;li&gt;Node system - this will let you sync the chain between multiple nodes&lt;/li&gt;
&lt;li&gt;Multiple extract data features&lt;/li&gt;
&lt;li&gt;Block confirmation system&lt;/li&gt;
&lt;li&gt;SocketIO API&lt;/li&gt;
&lt;li&gt;Documentation&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;
  
  
  Installation
&lt;/h3&gt;

&lt;p&gt;The Chain requires &lt;a href="https://nodejs.org/" rel="noopener noreferrer"&gt;Node.js&lt;/a&gt; v10 (only tested) to run. &lt;/p&gt;

&lt;p&gt;Install The Chain...&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;npm &lt;span class="nb"&gt;install &lt;/span&gt;thechain &lt;span class="nt"&gt;--save&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A simple demo&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;Chain&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;thechain&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;blockchain&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Chain&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;path&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;port&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;blockTime&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// or new Chain() for a fast blockchain&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;block_one&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;blockchain&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getBlock&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;block_one&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// this will print the genesis block&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Default params:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;path&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;./chain/chain.db3&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;port&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;4444&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;blocktime&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt;  &lt;span class="mi"&gt;60000&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// 1 minute blocktime in ms&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h1&gt;
  
  
  Methods
&lt;/h1&gt;

&lt;h3&gt;
  
  
  Verify the Chain
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;blockchain&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;verifyChain&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt; &lt;span class="c1"&gt;// No return&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This method will be initially called to check every block, you can use it whenever you want, but warning, this method will stop your script until every block is checked.&lt;/p&gt;

&lt;h3&gt;
  
  
  Create new Block (WARNING! Better to set a block time and never use this method!)
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;blockchain&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;createNewBlock&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt; &lt;span class="c1"&gt;// No return&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This method will create a new block when it is called, the block data will be the data contained in the data object at the block time.&lt;/p&gt;

&lt;h3&gt;
  
  
  Data push
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nb"&gt;Object&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;test1&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;test2&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;span class="nx"&gt;blockchain&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;push&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;Object&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// No return&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This method will push data into the block, and the block will be generated with the pushed data.&lt;/p&gt;

&lt;h3&gt;
  
  
  Get last 100 blocks
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;last100blocks&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;blockchain&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getLast100&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;last100blocks&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This method will return the last 100 blocks.&lt;/p&gt;

&lt;h3&gt;
  
  
  Get x block
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;blockNumber&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// Block number id&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;block&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;blockchain&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getBlock&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;blockNumber&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;block&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// This will print the block data&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This method will return the block with x number.&lt;/p&gt;

&lt;h2&gt;
  
  
  Development
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://github.com/GabrielLeonte/Glaciary.JS/pulls" 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%2Fimg.shields.io%2Fbadge%2FPRs-welcome-brightgreen.svg%3Fstyle%3Dflat-square" alt="PRs Welcome"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Want to contribute? Great! Start by telling us your wishes!&lt;/p&gt;

&lt;h2&gt;
  
  
  License
&lt;/h2&gt;

&lt;p&gt;The chain is licensed as &lt;a href="https://github.com/GabrielLeonte/The-Chain/blob/master/LICENSE" rel="noopener noreferrer"&gt;MIT&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Free Blockchain Software, DAM Yeah!&lt;/strong&gt;&lt;/p&gt;

</description>
      <category>blockchain</category>
      <category>npm</category>
      <category>node</category>
      <category>javascript</category>
    </item>
    <item>
      <title>Backend Node.JS developer Portofolio</title>
      <dc:creator>Gabriel Leonte</dc:creator>
      <pubDate>Wed, 04 Sep 2019 11:04:42 +0000</pubDate>
      <link>https://dev.to/gabrielleonte/backend-node-js-developer-portofolio-1en5</link>
      <guid>https://dev.to/gabrielleonte/backend-node-js-developer-portofolio-1en5</guid>
      <description>&lt;p&gt;Hello dev.to community, i have been thinking about finding a job as Backend Node.JS developer, and here is my question, what should a backend portofolio have? Any ideas of "server-side" projects?&lt;/p&gt;

</description>
      <category>discuss</category>
    </item>
    <item>
      <title>Glaciary.JS - The best, secure, and fast way to build your next API
</title>
      <dc:creator>Gabriel Leonte</dc:creator>
      <pubDate>Mon, 02 Sep 2019 06:53:55 +0000</pubDate>
      <link>https://dev.to/gabrielleonte/glaciary-js-the-best-secure-and-fast-way-to-build-your-next-api-504f</link>
      <guid>https://dev.to/gabrielleonte/glaciary-js-the-best-secure-and-fast-way-to-build-your-next-api-504f</guid>
      <description>&lt;h1&gt;
  
  
  Glaciary.
&lt;/h1&gt;

&lt;blockquote&gt;
&lt;p&gt;The Rest API framework based on Express.JS and Socket.IO&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Get Started
&lt;/h2&gt;

&lt;p&gt;Make sure you have &lt;a href="https://www.npmjs.com/package/npx"&gt;npx&lt;/a&gt; installed (&lt;code&gt;npx&lt;/code&gt; is shipped by default since &lt;a href="https://www.npmjs.com/get-npm"&gt;npm&lt;/a&gt; &lt;code&gt;5.2.0&lt;/code&gt;)&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight shell"&gt;&lt;code&gt;npx create-glaciary-app &amp;lt;my-project&amp;gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Or starting with npm v6.1 you can do:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight shell"&gt;&lt;code&gt;npm init glaciary-app &amp;lt;my-project&amp;gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Or with &lt;a href="https://yarnpkg.com/en/"&gt;yarn&lt;/a&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight shell"&gt;&lt;code&gt;yarn create glaciary-app &amp;lt;my-project&amp;gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;h2&gt;
  
  
  Links
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;📖 Docs: &lt;a href="https://github.com/GabrielLeonte/glaciary-docs"&gt;Docs&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;🌍 Discord: &lt;a href="https://discord.gg/h3uKEt4"&gt;Join&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Features 🔥
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;A simple way to setup a new route or event&lt;/li&gt;
&lt;li&gt;Configurable with a config.glaciary.js file&lt;/li&gt;
&lt;li&gt;Configurable default HTTP route with defaults.glaciary.js&lt;/li&gt;
&lt;li&gt;Configurable default Socket.IO Event with defaults.glaciary.js&lt;/li&gt;
&lt;li&gt;Easy to setup SSL Certificate with defaults.glaciary.js (still testing)&lt;/li&gt;
&lt;li&gt;Simple Debug system&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Incoming Features 😏
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Plugins&lt;/li&gt;
&lt;li&gt;Global Store Array&lt;/li&gt;
&lt;li&gt;Local SQLITE3 database&lt;/li&gt;
&lt;/ul&gt;



&lt;blockquote&gt;
&lt;p&gt;If you want to contribute with any idea, you're welcome to share it with us 😄&lt;/p&gt;
&lt;/blockquote&gt;

</description>
      <category>javascript</category>
      <category>githunt</category>
      <category>node</category>
      <category>npm</category>
    </item>
  </channel>
</rss>
