<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Mohammed El Khaira on Medium]]></title>
        <description><![CDATA[Stories by Mohammed El Khaira on Medium]]></description>
        <link>https://medium.com/@mohammed_84576?source=rss-3a00fdb7bbed------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*rdFcbqEImHkl0uRl</url>
            <title>Stories by Mohammed El Khaira on Medium</title>
            <link>https://medium.com/@mohammed_84576?source=rss-3a00fdb7bbed------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 19 Nov 2026 08:48:46 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@mohammed_84576/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[1. Understand NestJS with ExpressJS]]></title>
            <link>https://medium.com/tales-of-libeo/1-understand-nestjs-with-expressjs-f0d646edd739?source=rss-3a00fdb7bbed------2</link>
            <guid isPermaLink="false">https://medium.com/p/f0d646edd739</guid>
            <category><![CDATA[expressjs]]></category>
            <category><![CDATA[backend]]></category>
            <category><![CDATA[nestjs]]></category>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[Mohammed El Khaira]]></dc:creator>
            <pubDate>Thu, 27 May 2021 15:13:06 GMT</pubDate>
            <atom:updated>2021-06-21T16:36:49.481Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="Nest looking at Express" src="https://cdn-images-1.medium.com/max/1024/1*gw5_XxwoFgbwWP0HevxAyg.jpeg" /></figure><h3><strong>Start basic Nest and Express apps</strong></h3><p><a href="https://github.com/mohelk/ExpressToNest-1">mohelk/ExpressToNest-1</a></p><p>Today I wanted to start sharing with you a series of articles focused on the NestJS framework. Before joining Libeo, I used to work with the ExpressJS framework. I’ve since then been introduced to NestJS which I have never heard of before. In order to understand the way this new framework works under the hood, I started working on a small app using NestJS alongside ExpressJS. This small project, presented over the course of multiple articles, will make use of Typescript, ESLint, Prettier, TypeORM, Apollo, Jest and even some React. I hope you will enjoy it and benefit from it as much as I will!</p><h3>Some context</h3><p>In order to start this article, I have to go through a better explanation of <a href="https://docs.nestjs.com/">NestJS</a>. It is a framework for building efficient and well-structured Node projects. Invented by Kamil Myśliwiec, it facilitates the development of scalable server-side applications. As a matter of fact, it makes use of the exact same ExpressJS framework we will be using in these articles.</p><p>Its main purpose is to answer a simple question: how can I structure my Node app ? By combining <a href="https://en.wikipedia.org/wiki/Object-oriented_programming">Object Oriented Programming</a>, <a href="https://fr.wikipedia.org/wiki/Functional_Programming">Functional Programming</a> and <a href="https://en.wikipedia.org/wiki/Functional_reactive_programming">Functional Reactive Programming</a>, NestJS is built to provide resourceful tools. It also supports TypeScript which, as a JS developer, I cannot refrain from using.</p><p>The first step of our journey is to build a basic NestJS app and understand its power by comparing it to a basic ExpressJS one</p><h3>Let’s dive in</h3><p><strong>Express app</strong></p><p>First of all, install <em>node</em> and <em>npm</em>(we recommend you to use <a href="https://github.com/nvm-sh/nvm">NVM</a>) then install <em>yarn</em>.</p><p>Create a new repository: mkdir express-app &amp;&amp; cd express-app.</p><p>Initialise the <em>package.json</em> file: yarn init -y</p><p>Then install the express package : yarn add express</p><p>Create a folder named <em>src</em> then an <em>index.js</em> file: mkdir src &amp;&amp; touch src/index.js.</p><p>Open the file and add the following JS code:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/d49886b049b545c4f4f2c5c4cbc52b16/href">https://medium.com/media/d49886b049b545c4f4f2c5c4cbc52b16/href</a></iframe><p>Now you can run your app with node index.js. But it’s better to define a start script to launch the app. Open <em>package.json</em> and add the following “scripts” object. Also, you will have to update the “main” property value by giving the path to your <em>index.js</em> file:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/3de73313397a7bb3fa17be935b547dab/href">https://medium.com/media/3de73313397a7bb3fa17be935b547dab/href</a></iframe><p>Finally, run the app with yarn start. Go to <a href="http://localhost:8080/">http://localhost:8080</a> and Tada! Your express app is running! 🥳🎊</p><p><strong>Nest app</strong></p><p>Install the Nest CLI with yarn: yarn global add @nestjs/cli</p><p>Then initialise your project with nest new nest-app. Choose yarn as your package manager.</p><p>With the Nest CLI, your project comes with a default structure, TypeScript, ESLint, Prettier, Jest and Git initialised. Also, it has a pretty neat modular structure:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/55c2f5e07bea87c57d4e066296c5450e/href">https://medium.com/media/55c2f5e07bea87c57d4e066296c5450e/href</a></iframe><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/08d61e878ded8138a9f56453a812b976/href">https://medium.com/media/08d61e878ded8138a9f56453a812b976/href</a></iframe><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/8b48ffb1c00c2d17b2c7f1d6d267ce4a/href">https://medium.com/media/8b48ffb1c00c2d17b2c7f1d6d267ce4a/href</a></iframe><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/30dc8d78653a2b3b38daa5c144351f11/href">https://medium.com/media/30dc8d78653a2b3b38daa5c144351f11/href</a></iframe><p>If you open <em>package.json</em>, you will see all the dependencies already installed and all the scripts available:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/bfb2e4577a96ac1b31510ad171552e13/href">https://medium.com/media/bfb2e4577a96ac1b31510ad171552e13/href</a></iframe><p>I recommend you to open the <em>main.ts</em> file and change the default app port to 9000. Then run your app with yarn start. Go to <a href="http://localhost:9000/">http://localhost:</a>9000 and Voila! Your nest app is running! 🤩</p><h3><strong>Conclusion</strong></h3><p>It’s already over? Don’t worry, we will explore how this Nest boilerplate works and how we can pimp the Express one to get a similar structure. Stay tuned!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f0d646edd739" width="1" height="1" alt=""><hr><p><a href="https://medium.com/tales-of-libeo/1-understand-nestjs-with-expressjs-f0d646edd739">1. Understand NestJS with ExpressJS</a> was originally published in <a href="https://medium.com/tales-of-libeo">Tales of Libeo</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>