<?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>Forem: Saad Naeem</title>
    <description>The latest articles on Forem by Saad Naeem (@saadnaeem).</description>
    <link>https://forem.com/saadnaeem</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%2F1273332%2Fa9ceb42e-3d9e-4978-8143-ec943f369ca9.jpg</url>
      <title>Forem: Saad Naeem</title>
      <link>https://forem.com/saadnaeem</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/saadnaeem"/>
    <language>en</language>
    <item>
      <title>Something Changed in AI, And It’s Not the Models</title>
      <dc:creator>Saad Naeem</dc:creator>
      <pubDate>Mon, 12 Jan 2026 19:39:46 +0000</pubDate>
      <link>https://forem.com/saadnaeem/something-changed-in-ai-and-its-not-the-models-39kk</link>
      <guid>https://forem.com/saadnaeem/something-changed-in-ai-and-its-not-the-models-39kk</guid>
      <description>&lt;p&gt;Artificial Intelligence Isn't a Feature – It's Becoming Infrastructure&lt;/p&gt;

&lt;p&gt;As developers, we have noticed how AI has become very active recently.&lt;/p&gt;

&lt;p&gt;Initially, it was quite thrilling.&lt;br&gt;
“And then came a point when it&lt;/p&gt;

&lt;p&gt;Now, it’s beginning to feel. inevitable.&lt;/p&gt;

&lt;p&gt;A common issue facing the team described in this case and those of others I interact with:&lt;/p&gt;

&lt;p&gt;“We know AI can help, but we don’t know where it actually fits.”&lt;br&gt;
AI, or Artificial Intelligence, refers to software&lt;/p&gt;

&lt;p&gt;We could discuss that honestly.&lt;/p&gt;

&lt;p&gt;The Real Pain Pain Clinics Are Facing&lt;/p&gt;

&lt;p&gt;Most developers won’t have a problem creating things.&lt;/p&gt;

&lt;p&gt;They have difficulty constructing the right thing.&lt;/p&gt;

&lt;p&gt;Common issues I observe in teams:&lt;/p&gt;

&lt;p&gt;"Q&amp;amp;A" chatbots | Can’t act | Cite example | Do&lt;/p&gt;

&lt;p&gt;Automation scripts which fail the moment logic increases&lt;/p&gt;

&lt;p&gt;Artificial intelligence capabilities were considered as functions, rather than as integrated systems. Additionally,&lt;/p&gt;

&lt;p&gt;Ownership is still unclear when the “AI part goes live”&lt;/p&gt;

&lt;p&gt;The consequence?&lt;/p&gt;

&lt;p&gt;The AI is there in the product, but it doesn’t add much value to the business.&lt;/p&gt;

&lt;p&gt;“Just Add AI” Usually Fails: Why It’s&lt;/p&gt;

&lt;p&gt;AI is often added in that way:&lt;/p&gt;

&lt;p&gt;“Let’s add a chatbot”&lt;/p&gt;

&lt;p&gt;“Let's automate responses to support.”&lt;/p&gt;

&lt;p&gt;“Let's use GPT here”&lt;/p&gt;

&lt;p&gt;"This works for demos."&lt;br&gt;
This works for demos.&lt;br&gt;
It fails in production.&lt;/p&gt;

&lt;p&gt;Why?&lt;/p&gt;

&lt;p&gt;Because businesses don’t need AI responses&lt;br&gt;
They need AI responsibility&lt;/p&gt;

&lt;p&gt;Who handles the conversation?&lt;br&gt;
Who decides the next step?&lt;br&gt;
Who connects AI to CRM, calls, tickets, workflows?&lt;/p&gt;

&lt;p&gt;That’s where most implementations stop.&lt;/p&gt;

&lt;p&gt;The Shift: From AI Tools to AI Agents&lt;/p&gt;

&lt;p&gt;What’s changing now is how AI is used.&lt;/p&gt;

&lt;p&gt;Instead of:&lt;/p&gt;

&lt;p&gt;One chatbot&lt;/p&gt;

&lt;p&gt;One script&lt;/p&gt;

&lt;p&gt;One endpoint&lt;/p&gt;

&lt;p&gt;Teams are moving toward AI agents:&lt;/p&gt;

&lt;p&gt;Agents that can chat, call, update systems&lt;/p&gt;

&lt;p&gt;Agents that follow rules, not just prompts&lt;/p&gt;

&lt;p&gt;Agents that act like digital team members&lt;/p&gt;

&lt;p&gt;This is where AI starts becoming infrastructure, not a feature.&lt;/p&gt;

&lt;p&gt;What Developers Should Focus On&lt;/p&gt;

&lt;p&gt;If you’re building or planning AI features, ask these questions:&lt;/p&gt;

&lt;p&gt;Can this AI take actions, or only respond?&lt;/p&gt;

&lt;p&gt;Can it work 24/7 without supervision?&lt;/p&gt;

&lt;p&gt;Is it connected to real systems (CRM, DB, APIs)?&lt;/p&gt;

&lt;p&gt;Can the logic evolve without rewriting everything?&lt;/p&gt;

&lt;p&gt;If the answer is “no” to most of these, the AI will likely stay a demo.&lt;/p&gt;

&lt;p&gt;A Practical Observation&lt;/p&gt;

&lt;p&gt;In several projects I’ve seen (especially MVPs and SaaS products), teams succeed when they:&lt;/p&gt;

&lt;p&gt;Treat AI as a system, not a widget&lt;/p&gt;

&lt;p&gt;Design flows before prompts&lt;/p&gt;

&lt;p&gt;Think in terms of agents, not chat windows&lt;/p&gt;

&lt;p&gt;Some companies working deeply in this space (for example, teams &lt;a href="https://stripe.com" rel="noopener noreferrer"&gt;Stripe &lt;/a&gt;, &lt;a href="https://vortician.com" rel="noopener noreferrer"&gt;vortician&lt;/a&gt;, &lt;a href="https://notion.com" rel="noopener noreferrer"&gt;Notion&lt;/a&gt;&lt;br&gt;
) focus more on AI behavior and integration than on UI or hype — and that’s usually where long-term value comes from.&lt;/p&gt;

&lt;p&gt;Not because of tools, but because of architecture decisions.&lt;/p&gt;

&lt;p&gt;Final Thought&lt;/p&gt;

&lt;p&gt;AI isn’t replacing developers.&lt;br&gt;
But developers who understand where AI fits will replace those who don’t.&lt;/p&gt;

&lt;p&gt;If you treat AI as:&lt;/p&gt;

&lt;p&gt;a feature → it stays small&lt;/p&gt;

&lt;p&gt;a system → it scales with your product&lt;/p&gt;

&lt;p&gt;And that mindset shift is already happening.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Connect MongoDB database with Next JS App(the simplest way)</title>
      <dc:creator>Saad Naeem</dc:creator>
      <pubDate>Wed, 03 Jul 2024 14:10:24 +0000</pubDate>
      <link>https://forem.com/saadnaeem/connect-mongodb-database-with-next-js-appthe-simplest-way-3km9</link>
      <guid>https://forem.com/saadnaeem/connect-mongodb-database-with-next-js-appthe-simplest-way-3km9</guid>
      <description>&lt;p&gt;In Next.js, especially when deploying on serverless environments or edge networks, database connections are established on every request. &lt;/p&gt;

&lt;p&gt;This is due to the nature of serverless functions, which do not maintain state between requests and can be spun up or down as needed. Here are some key points to consider:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Serverless Functions:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Next.js uses serverless functions for API routes and server-side rendering (SSR). &lt;br&gt;
Each invocation of a serverless function is stateless and isolated, meaning it doesn't maintain a persistent connection to a database. &lt;/p&gt;

&lt;p&gt;Therefore, a new database connection must be established for each request.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import mongoose from "mongoose";

// Object to track connection state
type ConnectionObject = {
    isConnected?: number;
};

// Single connection object to be used across requests
const connection: ConnectionObject = {};

// Function to connect to the database
async function dbConnect(): Promise&amp;lt;void&amp;gt; {
    // Check if already connected to avoid redundant connections
    if (connection.isConnected) {
        console.log("Already Connected");
        return;
    }

    try {
        // Establish a new connection
        const db = await mongoose.connect(process.env.MONGO_URI || "", {
            // Use appropriate options here based on your setup
        });

        // Track the connection state
        connection.isConnected = db.connections[0].readyState;

        console.log("DB is connected");
    } catch (error) {
        console.log("DB connection error:", error);
        process.exit(1); // Exit the process if unable to connect
    }
}

export default dbConnect;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Thank You Me Latter&lt;/p&gt;

</description>
      <category>mongodbwithnext</category>
      <category>mongodbnext</category>
      <category>nextjs</category>
      <category>mongodb</category>
    </item>
    <item>
      <title>Difference Between ORM and ODM</title>
      <dc:creator>Saad Naeem</dc:creator>
      <pubDate>Wed, 12 Jun 2024 14:27:41 +0000</pubDate>
      <link>https://forem.com/saadnaeem/difference-between-orm-and-odm-1a9h</link>
      <guid>https://forem.com/saadnaeem/difference-between-orm-and-odm-1a9h</guid>
      <description>&lt;p&gt;Hi, Today we will discuss shortly about ORM and ODM tools and we will clear our all confusions of ORM And ODM.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;So let's start today's short topic:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;ORM:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;ORM ( Object relational mapping) is a tool that is commonly used for SQL databases (MYSQL, PostgreSQL).&lt;/li&gt;
&lt;li&gt;These tools are used to map the relational database tables into programming language objects.&lt;/li&gt;
&lt;li&gt;Examples: Prisma, TypeORM, Sequelize.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;ODM:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;ODM tool is commonly used for NoSQL Document Database ( MongoDB ).&lt;/li&gt;
&lt;li&gt;These tools are used to map the document (JSON Like format ) to programming languages objects.&lt;/li&gt;
&lt;li&gt;Examples: Mongoose (for MongoDB).&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>orm</category>
      <category>odm</category>
      <category>database</category>
      <category>saadnaeem</category>
    </item>
    <item>
      <title>Exploring TypeScript Decorators: A Deep Dive into Metadata and Annotations</title>
      <dc:creator>Saad Naeem</dc:creator>
      <pubDate>Thu, 09 May 2024 10:59:42 +0000</pubDate>
      <link>https://forem.com/saadnaeem/exploring-typescript-decorators-a-deep-dive-into-metadata-and-annotations-15m8</link>
      <guid>https://forem.com/saadnaeem/exploring-typescript-decorators-a-deep-dive-into-metadata-and-annotations-15m8</guid>
      <description>&lt;p&gt;TypeScript decorators are a powerful feature that allows developers to add metadata and behavior to classes, methods, properties, and parameters. In this post, we'll take a deep dive into decorators, exploring their syntax, usage, and the concept of metadata and annotations in TypeScript.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Understanding TypeScript Decorator&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Decorators are special expressions that evaluate to a function, which is executed at runtime with information about the decorated declaration. They are prefixed with the @ symbol and can be attached to classes, methods, accessors, properties, or parameters.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;function myDecorator(target: any, propertyKey: string): void {
  // Decorator logic
}

class MyClass {
  @myDecorator
  myMethod() {
    // Method implementation
  }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  &lt;strong&gt;Types of Decorators&lt;/strong&gt;
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Class Decorators: Applied to classes, allowing you to modify the class constructor or add metadata to the class.&lt;/li&gt;
&lt;li&gt;Method Decorators: Applied to methods, enabling you to modify their behavior or add metadata to them.&lt;/li&gt;
&lt;li&gt;Property Decorators: Applied to properties, allowing you to add metadata to class properties.&lt;/li&gt;
&lt;li&gt;Parameter Decorators: Applied to method parameters, providing metadata about the arguments of methods.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Working with Metadata and Annotations&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;One of the most powerful aspects of decorators is their ability to work with metadata and annotations. Metadata is additional information that describes the structure of your code, such as types, interfaces, and classes. Annotations are markers added to code elements to provide additional information.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const MY_METADATA_KEY = Symbol("myMetadataKey");

function myDecorator(target: any, propertyKey: string) {
  Reflect.defineMetadata(MY_METADATA_KEY, "myValue", target, propertyKey);
}

class MyClass {
  @myDecorator
  myMethod() {
    // Method implementation
  }
}

const metadataValue = Reflect.getMetadata(MY_METADATA_KEY, MyClass.prototype, "myMethod");
console.log(metadataValue); // Output: "myValue"

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  &lt;strong&gt;Real-World Use Cases&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;1.&lt;strong&gt;Dependency Injection:&lt;/strong&gt; Using decorators to mark classes or properties as injectable for dependency injection frameworks.&lt;br&gt;
2.&lt;strong&gt;Validation:&lt;/strong&gt; Adding validation rules to methods or properties using decorators.&lt;br&gt;
3.&lt;strong&gt;Logging:&lt;/strong&gt; Automatically logging method calls or property accesses with decorators.&lt;/p&gt;

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

&lt;p&gt;TypeScript decorators provide a powerful mechanism for adding metadata and behavior to your code. By understanding their syntax and usage, you can leverage decorators to write more expressive, maintainable, and flexible code. Experiment with decorators in your projects to unlock their full potential!&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>typescript</category>
      <category>webdev</category>
      <category>programming</category>
    </item>
  </channel>
</rss>
