<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Nodejs on Ravindra Devrani</title><link>https://ravindradevrani.com/tags/nodejs/</link><description>Recent content in Nodejs on Ravindra Devrani</description><generator>Hugo</generator><language>en-us</language><lastBuildDate>Sun, 30 Nov 2025 13:02:07 +0530</lastBuildDate><atom:link href="https://ravindradevrani.com/tags/nodejs/index.xml" rel="self" type="application/rss+xml"/><item><title>Setting Up Node Js With Typescript</title><link>https://ravindradevrani.com/posts/setting-up-node-js-with-typescript/</link><pubDate>Sun, 30 Nov 2025 13:02:07 +0530</pubDate><guid>https://ravindradevrani.com/posts/setting-up-node-js-with-typescript/</guid><description>&lt;!-- raw HTML omitted -->
&lt;p>(image credit: &lt;a href="https://gemini.google.com/">Gemini&lt;/a>)&lt;/p>
&lt;p>We are going to create folders and install packages in this step. I don&amp;rsquo;t have much to say for this tutorial. I have tried to explain necessary stuff through comments. In my opinion code is self-explanatory. So, let&amp;rsquo;s execute these commands in a sequence.&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-bash" data-lang="bash">&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e"># create a directory&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>mkdir backend
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e"># change directory&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>cd backend
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e"># create the `src` directory inside the `backend`.&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>mkdir src
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e"># create file&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>touch src/index.ts 
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e"># initialize node js project. &lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e"># Please stay inside the `backend` directory. &lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>npm init -y 
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e"># install these packages&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>npm install express cors
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e"># install the dev dependencies&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e"># these packages won&amp;#39;t be shipped to your production bundle&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>npm install -D typescript tsx @types/node @types/express @types/cors
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e"># generate tsconfig.json file&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>npx tsc --init
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>Folder structure should look like this.&lt;/p></description></item><item><title>Node Js: Jwt Authentication and refresh token</title><link>https://ravindradevrani.com/posts/node-js-jwt-authentication/</link><pubDate>Fri, 04 Jul 2025 00:00:00 +0530</pubDate><guid>https://ravindradevrani.com/posts/node-js-jwt-authentication/</guid><description>&lt;!-- raw HTML omitted -->
&lt;p>Please visit this &lt;a href="https://ravindradevrani.com/posts/node-js-crud-with-sql-server/">post&lt;/a> first, where I have made this project from scratch and wrote CRUD APIs.&lt;/p>
&lt;h2 id="source-code">Source code&lt;/h2>
&lt;ul>
&lt;li>Backend and specific only to this tutorial: &lt;a href="https://github.com/rd003/ng-node-fullstack/pull/new/jwt-refresh">https://github.com/rd003/ng-node-fullstack/pull/new/jwt-refresh&lt;/a>&lt;/li>
&lt;li>Complete project with angular : &lt;a href="https://github.com/rd003/ng-node-fullstack">https://github.com/rd003/ng-node-fullstack&lt;/a>&lt;/li>
&lt;/ul>
&lt;h2 id="json-web-token-jwt-and-why-it-is-needed">JSON web token (JWT) and why it is needed&lt;/h2>
&lt;p>REST Apis are session less. You can not maintain the authentication session for the whole application. For that purpose, &lt;code>JSON web token (JWT)&lt;/code> comes in play. How it works&lt;/p></description></item><item><title>Build a Node.js REST APIs with Express, Sequelize &amp; SQL Server (2025 Guide)</title><link>https://ravindradevrani.com/posts/node-js-crud-with-sql-server/</link><pubDate>Thu, 03 Jul 2025 19:17:23 +0530</pubDate><guid>https://ravindradevrani.com/posts/node-js-crud-with-sql-server/</guid><description>&lt;!-- raw HTML omitted -->
&lt;p>In this tutorial, you’ll learn how to build a simple &lt;strong>CRUD (Create, Read, Update, Delete) REST API&lt;/strong> using &lt;strong>Node.js&lt;/strong>, &lt;strong>Express.js&lt;/strong>, &lt;strong>Sequelize&lt;/strong>, and &lt;strong>SQL Server&lt;/strong>. I have tried to make it a less verbose. It is more like a technical documentation to create the rest apis in this tech stack. However, I have tried to explain all the essential things. This is ideal if you&amp;rsquo;re looking to integrate a SQL Server database with a Node.js backend using Sequelize as the ORM. We are using sql server in this tutorial but you can easily replace it with other sql databases.&lt;/p></description></item></channel></rss>