<?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: ahmad mohammadi</title>
    <description>The latest articles on DEV Community by ahmad mohammadi (@ahmad_mohammadi_4b72a8bda).</description>
    <link>https://dev.to/ahmad_mohammadi_4b72a8bda</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%2F2864165%2F4566ba77-19e8-4e8a-badc-b71d2608c205.jpg</url>
      <title>DEV Community: ahmad mohammadi</title>
      <link>https://dev.to/ahmad_mohammadi_4b72a8bda</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/ahmad_mohammadi_4b72a8bda"/>
    <language>en</language>
    <item>
      <title>Build Your Own Sadad Payment Gateway Integration in Node.js</title>
      <dc:creator>ahmad mohammadi</dc:creator>
      <pubDate>Fri, 11 Apr 2025 19:12:01 +0000</pubDate>
      <link>https://dev.to/ahmad_mohammadi_4b72a8bda/build-your-own-sadad-payment-gateway-integration-in-nodejs-4apg</link>
      <guid>https://dev.to/ahmad_mohammadi_4b72a8bda/build-your-own-sadad-payment-gateway-integration-in-nodejs-4apg</guid>
      <description>&lt;p&gt;Build Your Own Sadad Payment Gateway Integration in Node.js&lt;/p&gt;

&lt;p&gt;Hey Devs!&lt;/p&gt;

&lt;p&gt;I recently created an open-source package that simplifies working with the Sadad payment gateway for Node.js developers. If you’ve ever worked with Iranian payment providers, you know how tricky and undocumented some of them can be. So I decided to build this tool to make the process much cleaner and developer-friendly.&lt;/p&gt;

&lt;p&gt;What is sadad-gateway?&lt;/p&gt;

&lt;p&gt;It’s a lightweight library that helps you:&lt;br&gt;
    • Send payment requests to Sadad&lt;br&gt;
    • Verify transactions&lt;br&gt;
    • Handle errors and responses in a structured way&lt;/p&gt;

&lt;p&gt;All of this with an easy-to-use API and written in JavaScript.&lt;/p&gt;

&lt;p&gt;Why I Built It&lt;/p&gt;

&lt;p&gt;I wanted to understand how payment gateways work under the hood, and this was a perfect way to practice real-world integrations, learn more about secure transaction flows, and contribute something useful to the dev community in Iran.&lt;/p&gt;

&lt;p&gt;GitHub Repo&lt;/p&gt;

&lt;p&gt;You can check out the full code here:&lt;br&gt;
&lt;a href="https://github.com/ahmadmohammadi80/sadad-gateway" rel="noopener noreferrer"&gt;https://github.com/ahmadmohammadi80/sadad-gateway&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Stars, feedback, or contributions are super welcome!&lt;/p&gt;

&lt;p&gt;Coming Soon&lt;/p&gt;

&lt;p&gt;I’m planning to add:&lt;br&gt;
    • TypeScript support&lt;br&gt;
    • NestJS integration guide&lt;br&gt;
    • Examples and full documentation&lt;/p&gt;

&lt;p&gt;Let me know what you’d like to see next!&lt;/p&gt;

&lt;p&gt;Thanks for reading — and if you’re working with Sadad, this might save you a bunch of time&lt;/p&gt;

</description>
    </item>
    <item>
      <title>A Practical Guide to Becoming a Junior Nest JS Developer</title>
      <dc:creator>ahmad mohammadi</dc:creator>
      <pubDate>Sat, 15 Feb 2025 10:06:55 +0000</pubDate>
      <link>https://dev.to/ahmad_mohammadi_4b72a8bda/a-practical-guide-to-becoming-a-junior-nest-js-developer-5c4c</link>
      <guid>https://dev.to/ahmad_mohammadi_4b72a8bda/a-practical-guide-to-becoming-a-junior-nest-js-developer-5c4c</guid>
      <description>&lt;p&gt;A Practical Guide to Becoming a Junior NestJS Developer&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Introduction&lt;/strong&gt;&lt;br&gt;
NestJS has become one of the most popular Node.js frameworks, offering a scalable and maintainable architecture for building backend applications. If you're starting your journey as a junior NestJS developer, this guide will help you focus on key concepts, best practices, and hands-on projects to accelerate your learning.&lt;/p&gt;




&lt;h2&gt;
  
  
  1. Understanding Middleware and Guards
&lt;/h2&gt;

&lt;p&gt;Middleware and Guards are essential for handling authentication, logging, and request validation in NestJS.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Middleware:&lt;/strong&gt; Used for request transformation, logging, and authentication.

&lt;ul&gt;
&lt;li&gt;Example: Creating a logging middleware.&lt;/li&gt;
&lt;li&gt;Implementation: &lt;code&gt;app.use(loggerMiddleware);&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;strong&gt;Guards:&lt;/strong&gt; Used for authorization and route protection.

&lt;ul&gt;
&lt;li&gt;Example: &lt;code&gt;@UseGuards(AuthGuard('jwt'))&lt;/code&gt; for JWT-based authentication.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;h3&gt;
  
  
  Hands-on Practice:
&lt;/h3&gt;

&lt;p&gt;✅ Implement a logging middleware.&lt;br&gt;
✅ Create an AuthGuard for role-based access control (RBAC).&lt;/p&gt;




&lt;h2&gt;
  
  
  2. Using Pipes and Interceptors
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Pipes:&lt;/strong&gt; Transform and validate incoming requests.

&lt;ul&gt;
&lt;li&gt;Example: &lt;code&gt;@UsePipes(new ValidationPipe())&lt;/code&gt; to validate DTOs.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;strong&gt;Interceptors:&lt;/strong&gt; Modify responses, log execution time, or handle exceptions.

&lt;ul&gt;
&lt;li&gt;Example: Logging interceptor to measure request duration.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;h3&gt;
  
  
  Hands-on Practice:
&lt;/h3&gt;

&lt;p&gt;✅ Implement a custom validation pipe.&lt;br&gt;
✅ Create an interceptor for response modification.&lt;/p&gt;




&lt;h2&gt;
  
  
  3. Authentication and Authorization
&lt;/h2&gt;

&lt;p&gt;Handling user authentication securely is a core skill for any backend developer.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Use &lt;strong&gt;Passport.js&lt;/strong&gt; with JWT for authentication.&lt;/li&gt;
&lt;li&gt;Implement &lt;strong&gt;RBAC&lt;/strong&gt; for user role management.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Hands-on Practice:
&lt;/h3&gt;

&lt;p&gt;✅ Implement JWT-based authentication.&lt;br&gt;
✅ Add role-based access control.&lt;/p&gt;




&lt;h2&gt;
  
  
  4. Database Mastery with TypeORM or Prisma
&lt;/h2&gt;

&lt;p&gt;A good developer understands database design, migrations, and relations.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;TypeORM:&lt;/strong&gt; A great ORM for relational databases.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Prisma:&lt;/strong&gt; A modern ORM with a better developer experience.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Hands-on Practice:
&lt;/h3&gt;

&lt;p&gt;✅ Design a database schema for a multi-user blog.&lt;br&gt;
✅ Implement database migrations.&lt;/p&gt;




&lt;h2&gt;
  
  
  5. Error Handling &amp;amp; API Documentation
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Use &lt;code&gt;HttpExceptionFilter&lt;/code&gt; for custom error responses.&lt;/li&gt;
&lt;li&gt;Integrate &lt;strong&gt;Swagger&lt;/strong&gt; with &lt;code&gt;@nestjs/swagger&lt;/code&gt; to document your API.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Hands-on Practice:
&lt;/h3&gt;

&lt;p&gt;✅ Implement global error handling.&lt;br&gt;
✅ Add Swagger documentation to your API.&lt;/p&gt;




&lt;h2&gt;
  
  
  6. Writing Tests with Jest
&lt;/h2&gt;

&lt;p&gt;Testing ensures your application remains stable and scalable.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Unit Testing:&lt;/strong&gt; Test services and controllers.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;E2E Testing:&lt;/strong&gt; Simulate real user interactions.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Hands-on Practice:
&lt;/h3&gt;

&lt;p&gt;✅ Write unit tests for a simple CRUD API.&lt;br&gt;
✅ Implement E2E tests using &lt;code&gt;supertest&lt;/code&gt;.&lt;/p&gt;




&lt;h2&gt;
  
  
  Suggested Projects
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Multi-user blog API with authentication.&lt;/li&gt;
&lt;li&gt;E-commerce backend (users, products, orders).&lt;/li&gt;
&lt;li&gt;Admin panel with role-based access control.&lt;/li&gt;
&lt;/ol&gt;




&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;By mastering these concepts and completing hands-on projects, you'll build a strong foundation as a &lt;strong&gt;NestJS Junior Developer&lt;/strong&gt;. Keep practicing, contributing to open-source, and sharing your learnings!&lt;/p&gt;

&lt;p&gt;Are you already working on a NestJS project? Share your experience in the comments! 🚀&lt;/p&gt;

</description>
      <category>nestjs</category>
    </item>
  </channel>
</rss>
