<?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: Abdulsalam Sa'ad</title>
    <description>The latest articles on DEV Community by Abdulsalam Sa'ad (@munaray).</description>
    <link>https://dev.to/munaray</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%2F2172848%2Ff846493e-d9b9-4f22-9d23-1f6eb55e9436.jpeg</url>
      <title>DEV Community: Abdulsalam Sa'ad</title>
      <link>https://dev.to/munaray</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/munaray"/>
    <language>en</language>
    <item>
      <title>How Repeated Configuration Led Me to Build a Node.js CLI</title>
      <dc:creator>Abdulsalam Sa'ad</dc:creator>
      <pubDate>Sun, 06 Oct 2024 11:13:09 +0000</pubDate>
      <link>https://dev.to/munaray/how-repeated-configuration-led-me-to-build-a-nodejs-cli-28eo</link>
      <guid>https://dev.to/munaray/how-repeated-configuration-led-me-to-build-a-nodejs-cli-28eo</guid>
      <description>&lt;p&gt;If you're a Node.js developer, you've probably noticed one common pain point: repeated project configuration. It’s always the same setup — TypeScript, database connections, Swagger docs, and more. &lt;/p&gt;

&lt;p&gt;As a developer who loves to streamline my workflow, I realized that instead of repeating this configuration every single time, it would make sense to create a CLI to automate the process. Thus, Create Node App CLI was born — a CLI that scaffolds a Node.js project with optional configurations for frameworks, databases, ORMs, TypeScript support, and Swagger docs.  &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The Problem: Repetition in Project Setup&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Recently, I started using TypeScript to build my Node.js APIs, and I kept running into the same issue: every time I started a new project, I had to spend valuable time setting up the same configuration files. &lt;/p&gt;

&lt;p&gt;Every new project meant going through the process of: &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Setting up TypeScript. &lt;/li&gt;
&lt;li&gt;Integrating a database (MongoDB, PostgreSQL, or MySQL). &lt;/li&gt;
&lt;li&gt;Choosing and configuring an ORM like Mongoose or Prisma. &lt;/li&gt;
&lt;li&gt;Configuring Swagger for API documentation. &lt;/li&gt;
&lt;li&gt;Handling environment variables. &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This was getting repetitive and frustrating. It was taking time away from actually building the core features of my applications. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The Solution: A CLI to Automate the Setup&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;I thought, “What if I could create a tool that automates all of this?” That’s how Create Node App CLI came to life. &lt;/p&gt;

&lt;p&gt;This CLI allows developers to scaffold a new Node.js project with: &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Your choice of framework: Express, Fastify, or Nest. &lt;/li&gt;
&lt;li&gt;Your choice of database: MongoDB, PostgreSQL, or MySQL. &lt;/li&gt;
&lt;li&gt;Integration with popular ORMs like Mongoose or Prisma. &lt;/li&gt;
&lt;li&gt;Support for TypeScript or JavaScript. &lt;/li&gt;
&lt;li&gt;Automatic setup of Swagger documentation for your APIs. &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;With a single command, developers can create a new project, select their preferences, and have all the necessary configurations in place, including folder structure, linting, and environment variables. &lt;/p&gt;

&lt;p&gt;*&lt;em&gt;Features of Create Node App CLI *&lt;/em&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Framework Options: Choose between Express, Fastify, or Nest based on your project’s needs. &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Database Support: Seamless integration with databases like MongoDB, PostgreSQL, or MySQL — complete with the option to choose ORMs like Mongoose, Prisma, or DrizzleORM. &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;TypeScript or JavaScript: You get the option to scaffold your project with either TypeScript or JavaScript, saving time on setting up the necessary configurations.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Swagger Documentation: Automatically generates Swagger documentation configuration folders and file for your APIs, so you can focus on building on it rather than manually setting it up. &lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;How to Use It &lt;/p&gt;

&lt;p&gt;Install via npx:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npx create-node-app-cli@latest new 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Once you run the command, the CLI will prompt you to choose your framework, database, ORM, and whether to use TypeScript or JavaScript. &lt;/p&gt;

&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npx create-node-app-cli@latest new my-api 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This command will set up a fully functional Node.js project, configured with your chosen options. &lt;/p&gt;

&lt;p&gt;Let’s Build Together! Contributions are Welcome &lt;/p&gt;

&lt;p&gt;This project is open source, and I believe that it can grow with the help of the developer community. There’s still so much we can add-new features-more framework support-database integrations, and more. So, I’m inviting you to contribute. &lt;/p&gt;

&lt;p&gt;You can contribute by: &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Submitting pull requests with new features or bug fixes. &lt;/li&gt;
&lt;li&gt;Opening issues for suggestions and improvements. &lt;/li&gt;
&lt;li&gt;Sharing feedback on how to make it better! &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;🔗 GitHub Repository: &lt;a href="https://github.com/munaray/create-node-app-cli" rel="noopener noreferrer"&gt;Create Node App CLI on GitHub&lt;/a&gt;&lt;br&gt;
I look forward to building this out with the community. Let’s streamline Node.js project creation for everyone! 💻 &lt;/p&gt;

&lt;p&gt;Conclusion &lt;/p&gt;

&lt;p&gt;The journey of building this CLI has been about solving my own pain points, but now I want to share this solution with the broader developer community. I hope you find this tool helpful, and I’m excited to see what the community contributes to it. &lt;/p&gt;

&lt;p&gt;🔗 npm: &lt;a href="https://www.npmjs.com/package/create-node-app-cli" rel="noopener noreferrer"&gt;Create Node App CLI on npm&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;🔗 GitHub: &lt;a href="https://github.com/munaray/create-node-app-cli" rel="noopener noreferrer"&gt;Create Node App CLI on GitHub&lt;/a&gt; &lt;/p&gt;

</description>
      <category>node</category>
      <category>typescript</category>
      <category>opensource</category>
      <category>cli</category>
    </item>
  </channel>
</rss>
