<?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: Joshua Olajide</title>
    <description>The latest articles on DEV Community by Joshua Olajide (@joshtom).</description>
    <link>https://dev.to/joshtom</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%2F215808%2Fc85a144a-96f8-4250-ba00-ebc4eef9788c.jpg</url>
      <title>DEV Community: Joshua Olajide</title>
      <link>https://dev.to/joshtom</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/joshtom"/>
    <language>en</language>
    <item>
      <title>Understanding Pointers in GO</title>
      <dc:creator>Joshua Olajide</dc:creator>
      <pubDate>Fri, 09 Jan 2026 14:52:42 +0000</pubDate>
      <link>https://dev.to/joshtom/understanding-pointers-in-go-14fe</link>
      <guid>https://dev.to/joshtom/understanding-pointers-in-go-14fe</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;Pointers are one of GO's most elegant features. Understanding them is the difference between writing code that just works and writing code that is efficient and also predictable.&lt;/p&gt;

&lt;p&gt;In this article, we’ll demystify pointers using simple mental models and a real-world project example.&lt;/p&gt;

&lt;h2&gt;
  
  
  How it works
&lt;/h2&gt;

&lt;p&gt;According to the official &lt;a href="https://go.dev/tour/moretypes/1" rel="noopener noreferrer"&gt;Go Documentation&lt;/a&gt;, a &lt;strong&gt;pointer holds the memory address of a value.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;To visualize this, imagine you have a house:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;The Value:&lt;/strong&gt; This is the physical house itself.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The Pointer:&lt;/strong&gt; This is the &lt;strong&gt;address&lt;/strong&gt; of the house written on a sticky note.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you give someone the sticky note (the pointer), they can go to your house and paint the front door red. If you don't give them the address, you are essentially sending them a &lt;strong&gt;photocopy&lt;/strong&gt; (a copy) of a picture of your house. They can paint that photocopy all they want, but your actual house stays exactly the same.&lt;/p&gt;

&lt;h2&gt;
  
  
  The &lt;code&gt;&amp;amp;&lt;/code&gt; and &lt;code&gt;*&lt;/code&gt; operators
&lt;/h2&gt;

&lt;p&gt;Go uses two primary operators to handle pointers. They may look confusing at first, but they have very specific functions&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt; &lt;strong&gt;&lt;code&gt;&amp;amp;&lt;/code&gt; (Address-of):&lt;/strong&gt; This operator finds where a variable is sitting in memory.&lt;/li&gt;
&lt;li&gt; &lt;strong&gt;&lt;code&gt;*&lt;/code&gt; (Dereference):&lt;/strong&gt; This operator lets you follow the address to see (or change) the actual value inside.
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight go"&gt;&lt;code&gt;&lt;span class="k"&gt;var&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="c"&gt;// The type *int means p is a pointer to an integer&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight go"&gt;&lt;code&gt;&lt;span class="k"&gt;package&lt;/span&gt; &lt;span class="n"&gt;main&lt;/span&gt;

&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="s"&gt;"fmt"&lt;/span&gt;

&lt;span class="k"&gt;func&lt;/span&gt; &lt;span class="n"&gt;main&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;name&lt;/span&gt; &lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="s"&gt;"Alice"&lt;/span&gt;

    &lt;span class="c"&gt;// &amp;amp; gets the memory address&lt;/span&gt;
    &lt;span class="n"&gt;pointer&lt;/span&gt; &lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt;
    &lt;span class="n"&gt;fmt&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Println&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Address:"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;pointer&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;   &lt;span class="c"&gt;// Output: 0xc000014070&lt;/span&gt;

    &lt;span class="c"&gt;// * accesses the value at that address&lt;/span&gt;
    &lt;span class="n"&gt;fmt&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Println&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Value:"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;pointer&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;    &lt;span class="c"&gt;// Output: Alice&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Copying vs. Pointing
&lt;/h2&gt;

&lt;p&gt;Why does this matter? It comes down to how Go handles data in functions.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Pass-by-Value (Copying)
When you pass a variable to a function in Go, it creates a copy by default. Changes inside the function stay inside the function.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight go"&gt;&lt;code&gt;&lt;span class="k"&gt;func&lt;/span&gt; &lt;span class="n"&gt;changeName&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="kt"&gt;string&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"Bob"&lt;/span&gt; &lt;span class="c"&gt;// This only updates the copy!&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="c"&gt;// Result: original 'name' remains "Alice"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Pass-by-Pointer (Pointing)
When you pass a pointer, the function modifies the data at the source.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight go"&gt;&lt;code&gt;&lt;span class="k"&gt;func&lt;/span&gt; &lt;span class="n"&gt;changeName&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="kt"&gt;string&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"Bob"&lt;/span&gt; &lt;span class="c"&gt;// This follows the address and changes the original&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="c"&gt;// Result: original 'name' becomes "Bob"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Real World Scenario: The Food Ordering System
&lt;/h2&gt;

&lt;p&gt;In a real system, you don't want to keep creating copies of a user's order every time they add an item that would be slow and lead to data bugs. You want one source of truth.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight go"&gt;&lt;code&gt;&lt;span class="k"&gt;package&lt;/span&gt; &lt;span class="n"&gt;main&lt;/span&gt;

&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="s"&gt;"fmt"&lt;/span&gt;

&lt;span class="k"&gt;type&lt;/span&gt; &lt;span class="n"&gt;Order&lt;/span&gt; &lt;span class="k"&gt;struct&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;CustomerName&lt;/span&gt; &lt;span class="kt"&gt;string&lt;/span&gt;
    &lt;span class="n"&gt;Items&lt;/span&gt;        &lt;span class="p"&gt;[]&lt;/span&gt;&lt;span class="kt"&gt;string&lt;/span&gt;
    &lt;span class="n"&gt;TotalPrice&lt;/span&gt;   &lt;span class="kt"&gt;float64&lt;/span&gt;
    &lt;span class="n"&gt;IsDiscounted&lt;/span&gt; &lt;span class="kt"&gt;bool&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="c"&gt;// We use *Order to ensure we are updating the actual order&lt;/span&gt;
&lt;span class="k"&gt;func&lt;/span&gt; &lt;span class="n"&gt;AddItem&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;order&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;Order&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;item&lt;/span&gt; &lt;span class="kt"&gt;string&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;price&lt;/span&gt; &lt;span class="kt"&gt;float64&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;order&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Items&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;append&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;order&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Items&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;item&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;order&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;TotalPrice&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="n"&gt;price&lt;/span&gt;
    &lt;span class="n"&gt;fmt&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Printf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Added %s ($%.2f)&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;item&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;price&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;func&lt;/span&gt; &lt;span class="n"&gt;ApplyDiscount&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;order&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;Order&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;percent&lt;/span&gt; &lt;span class="kt"&gt;float64&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;order&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;IsDiscounted&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="n"&gt;fmt&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Println&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Discount already applied!"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="n"&gt;discount&lt;/span&gt; &lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="n"&gt;order&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;TotalPrice&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;percent&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="m"&gt;100&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;order&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;TotalPrice&lt;/span&gt; &lt;span class="o"&gt;-=&lt;/span&gt; &lt;span class="n"&gt;discount&lt;/span&gt;
    &lt;span class="n"&gt;order&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;IsDiscounted&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="no"&gt;true&lt;/span&gt;
    &lt;span class="n"&gt;fmt&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Printf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"%.0f%% discount applied!&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;percent&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;func&lt;/span&gt; &lt;span class="n"&gt;main&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;myOrder&lt;/span&gt; &lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="n"&gt;Order&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;CustomerName&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="s"&gt;"John"&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;

    &lt;span class="c"&gt;// Pass the address of myOrder using &amp;amp;&lt;/span&gt;
    &lt;span class="n"&gt;AddItem&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;myOrder&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"Burger"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="m"&gt;8.99&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;AddItem&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;myOrder&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"Fries"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="m"&gt;3.49&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;ApplyDiscount&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;myOrder&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="m"&gt;10&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="n"&gt;fmt&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Printf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Final Total for %s: $%.2f&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;myOrder&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;CustomerName&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;myOrder&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;TotalPrice&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Key Takeaways
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Pointers (Memory Addresses) point to where data lives, not the data itself.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Pointers are great for large structs (like our Order) because you aren't copying the whole object every time you call a function.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Use &lt;code&gt;&amp;amp;&lt;/code&gt; to create a pointer and &lt;code&gt;*&lt;/code&gt; to read/edit the value it points to.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;In Go, the zero value of a pointer is &lt;code&gt;nil&lt;/code&gt;. Always ensure a pointer isn't nil before dereferencing it to avoid crashes.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;PS: If your struct is small (like a single int), just pass the value. Use pointers when you need to modify the data or when the data is large enough that copying it would consume unnecessary memory.&lt;/p&gt;

</description>
      <category>go</category>
      <category>webdev</category>
      <category>programming</category>
    </item>
    <item>
      <title>Optimizing technical documentations for LLMs</title>
      <dc:creator>Joshua Olajide</dc:creator>
      <pubDate>Fri, 29 Aug 2025 22:18:02 +0000</pubDate>
      <link>https://dev.to/joshtom/optimizing-technical-documentations-for-llms-4bcd</link>
      <guid>https://dev.to/joshtom/optimizing-technical-documentations-for-llms-4bcd</guid>
      <description>&lt;p&gt;LLMs (Large Language Models) are already a part of many developers’ daily workflows, from writing and debugging code to exploring new libraries. The challenge is that these models have a knowledge cut-off; their training data only extends up to a certain point in time. This means they are often unaware of the latest tools, framework updates, breaking api changes etc. A framework released this year or a critical api update from last month might not exist for the model at all. You ask for a solution, and it confidently suggests code from a deprecated version, or worse, tells you the library does not exist. &lt;/p&gt;

&lt;p&gt;The natural workaround will be to bring in your own documentation into the conversation. Developers often paste chunks of &lt;code&gt;README&lt;/code&gt; files, &lt;code&gt;api docs&lt;/code&gt;, or &lt;code&gt;github&lt;/code&gt; issues into an llm chatbot and often times the problem is these sources aren’t always structured for LLMs. You end up copying boilerplate, irrelevant metadata, or text that doesn’t translate well into the model’s reasoning.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;As LLMs become increasingly important for information retrieval and knowledge assistance, ensuring your documentation is LLM-friendly can significantly improve how these models understand and represent your products or services&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;This is where the idea of optimizing documentation for LLMs comes in. Instead of relying on outdated training data, you can feed models the exact context they need. &lt;/p&gt;

&lt;p&gt;In this article, we’ll look at practical tools and approaches that make technical documentation more LLM-friendly, and how you can use them to cut down on hallucinations and get more accurate results.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why documentation needs to be LLM friendly
&lt;/h2&gt;

&lt;p&gt;When developers ask an LLM for help, the model pulls from the its training data. If your framework, library, or API documentation isn’t part of that data or if it’s written in a way that’s ambiguous the model will try to “fill the gaps” which often results in hallucinations, outdated code samples, or even missing context.&lt;/p&gt;

&lt;p&gt;The main issue is that traditional documentation is written for humans. It assumes that the reader can cross check references, scan changelogs, and adapt examples to newer versions. LLMs don’t do this. They rely on explicit patterns in the text. If those patterns are vague or inconsistent, the LLM struggles to provide accurate answers.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;LLM-optimized documentation ensures that AI systems like ChatGPT, Gemini, Claude, Cursor, and Copilot can retrieve and provide accurate, contextual responses about your product or API.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  Some of the ways an llm friendly documentation can benefit developers:
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Improved reliability of ai-assisted coding&lt;/strong&gt;: When your docs are structured with predictable patterns (such as consistent headings, code annotations, and explicit parameter descriptions), LLMs are more likely to surface correct results.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Faster onboarding for new developers&lt;/strong&gt;: Even if they aren’t using AI directly, new contributors benefit from the same clarity and structure.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Think of it this way; a human reader can skim through three paragraphs to find the right function signature. An LLM however, does not skim, it looks for exact matches. If the function signature is hidden in a sentence like &lt;code&gt;you might also use init() for setup purposes&lt;/code&gt;, the model may miss it entirely. But if the function is presented in a dedicated code block with clear arguments and return values, making the documentation equally accessible and actionable for both humans and LLMs.&lt;/p&gt;

&lt;h2&gt;
  
  
  Practical techniques for llm friendly documentation
&lt;/h2&gt;

&lt;p&gt;Creating documentation that is both developer friendly and llm consumable requires a balance between precision and readability.&lt;/p&gt;

&lt;p&gt;Below are some of the practical techniques to ensure your docs serve humans first, while remaining optimized for AI&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. Use clear and consistent headings&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Break content into small and well labelled sections.&lt;/li&gt;
&lt;li&gt;Use a hierarchy (&lt;code&gt;##&lt;/code&gt;,&lt;code&gt;###&lt;/code&gt;) to reflect structure&lt;/li&gt;
&lt;li&gt;Avoid vague titles and be more explicit. For example&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Replace&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Advanced stuff
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;With&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Configuring OAuth 2.0 Authentication
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;2. Write concise, jargon-free content&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;LLMs (and humans) parse concise, imperative phrasing more effectively.&lt;/p&gt;

&lt;p&gt;Replace&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;This function can maybe be used to fetch something like data
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;With&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Use fetchData() to retrieve JSON from an endpoint
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;3. Pair every explanations with practical examples&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Examples basically provide grounding for both the reader and the model. A technical documentation should always show a minimal &lt;strong&gt;working snippet&lt;/strong&gt; alongside any concept&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// Vague example&lt;/span&gt;
&lt;span class="nf"&gt;fetchData&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;

&lt;span class="c1"&gt;// Minimal but working example&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;fetchData&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;library&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;main&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;data&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;fetchData&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;/users&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// -&amp;gt; [{ id: 1, name: "Josh" }]&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="nf"&gt;main&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;4. Avoid ambiguity and hidden context&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Define acronyms when first introduced (e.g &lt;code&gt;LLM (Large Language Model)&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;State defaults explicitly (e.g &lt;code&gt;The timeout defaults to 30s if not set&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;Avoid the use of &lt;code&gt;it&lt;/code&gt; or &lt;code&gt;this&lt;/code&gt; without clear references&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;5. Keep content current and accurate&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Nobody likes outdated docs. Regular updates mean LLMs won’t give people wrong information about your latest features and updates.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;6. Standardize formatting for APIs&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://svelte.dev/docs/llms" rel="noopener noreferrer"&gt;Svelte's llm guidelines&lt;/a&gt; demonstrates how effective llm friendly documentation can be by publishing its api references in a plain text (&lt;code&gt;llm.txt&lt;/code&gt;), highly structured format. Each function or component is described consistently with a clear signature, a concise explanation, its parameters, return type, and an example. By stripping away visual styling and navigational noise, the documentation becomes both scannable for humans and rich for machines.&lt;/p&gt;

&lt;p&gt;This allows LLMs to reliably extract meaning, map queries to the correct methods, and minimize hallucinations. For example, when a developer asks about &lt;code&gt;getUser&lt;/code&gt;, the model can point directly to its definition, parameters, and usage instead of inferring or fabricating details.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="err"&gt;###&lt;/span&gt; &lt;span class="s2"&gt;`getUser(id: string): Promise&amp;lt;User&amp;gt;`&lt;/span&gt;

&lt;span class="nx"&gt;Retrieves&lt;/span&gt; &lt;span class="nx"&gt;a&lt;/span&gt; &lt;span class="nx"&gt;user&lt;/span&gt; &lt;span class="nx"&gt;by&lt;/span&gt; &lt;span class="nx"&gt;their&lt;/span&gt; &lt;span class="nx"&gt;unique&lt;/span&gt; &lt;span class="s2"&gt;`id`&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;

&lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="o"&gt;**&lt;/span&gt;&lt;span class="nx"&gt;Parameters&lt;/span&gt;&lt;span class="o"&gt;**&lt;/span&gt;
  &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="s2"&gt;`id`&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;string&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt; &lt;span class="nx"&gt;The&lt;/span&gt; &lt;span class="nx"&gt;user&lt;/span&gt;&lt;span class="err"&gt;’&lt;/span&gt;&lt;span class="nx"&gt;s&lt;/span&gt; &lt;span class="nx"&gt;unique&lt;/span&gt; &lt;span class="nx"&gt;identifier&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;
&lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="o"&gt;**&lt;/span&gt;&lt;span class="nx"&gt;Returns&lt;/span&gt;&lt;span class="o"&gt;**&lt;/span&gt;
  &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="s2"&gt;`Promise&amp;lt;User&amp;gt;`&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;A&lt;/span&gt; &lt;span class="nx"&gt;promise&lt;/span&gt; &lt;span class="nx"&gt;resolving&lt;/span&gt; &lt;span class="nx"&gt;to&lt;/span&gt; &lt;span class="nx"&gt;the&lt;/span&gt; &lt;span class="nx"&gt;user&lt;/span&gt; &lt;span class="nx"&gt;object&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="nx"&gt;found&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;
&lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="o"&gt;**&lt;/span&gt;&lt;span class="nx"&gt;Example&lt;/span&gt;&lt;span class="o"&gt;**&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;user&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;getUser&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;123&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;user&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;name&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Tools and approaches developers can use
&lt;/h2&gt;

&lt;p&gt;Even with well structured docs, developers often need ways to make them more usable inside LLMs. As mentioned earlier; copying and pasting &lt;code&gt;README&lt;/code&gt;s or API references is one option, but it usually brings along noise such as badges, changelog snippets, or irrelevant metadata. Fortunately, there are tools that help clean up, transform, and deliver documentation in formats that LLMs can reason about more effectively.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Gitingest&lt;/strong&gt;: &lt;a href="https://gitingest.com/" rel="noopener noreferrer"&gt;Gitingest&lt;/a&gt; according to the docs mentioned that it can &lt;code&gt;Turn any Git repository into a simple text digest of its codebase. This is useful for feeding a codebase into any LLM&lt;/code&gt;. Gitingest can take a Github repository and convert it into plain text that's easier to feed into an LLM. Instead of manually pulling out individual files or copying messy markdown, you can point Gitingest to a repo and get a linear, text-first version of the code and documentation. This is especially useful when working with fast paced open source libraries where official docs may lag behind the latest commits.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Doc specific exports&lt;/strong&gt;: Some libraries already publish documentations optimized for LLMs. &lt;a href="https://docs.expo.dev/" rel="noopener noreferrer"&gt;Expo docs&lt;/a&gt;, for example provides an &lt;a href="https://docs.expo.dev/llms/" rel="noopener noreferrer"&gt;LLM-friendly export of their docs&lt;/a&gt;. Instead of navigating styled web pages or API explorers, you can download a single &lt;code&gt;llm.txt&lt;/code&gt; file that is structured, consistent and ready to be shared with any model. This ensures that the information you load into an LLM is accurate and up to date.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Custom preprocessing&lt;/strong&gt;: For projects without ready made LLM exports, you can preprocess docs yourself by stripping HTML, flattening headings, and removing non essential sections (like badges or marketing blurbs) makes the input cleaner. Even simple scripts that extract code examples, parameter tables, and sectioned markdown can drastically improve how a model interprets your documentation.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Embedding and retrieval pipelines&lt;/strong&gt;: For larger codebases or libraries, consider using a Retrieval Augmented Generation (&lt;code&gt;RAG&lt;/code&gt;) setup. By embedding your documentation and querying it on demand, you avoid token limits and keep responses scoped. Tools like &lt;a href="https://www.langchain.com/" rel="noopener noreferrer"&gt;LangChain&lt;/a&gt; or &lt;a href="https://www.llamaindex.ai/" rel="noopener noreferrer"&gt;LlamaIndex&lt;/a&gt; make it easier to wire documentation into chat workflows so the model only pulls what’s relevant to the query.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Best practices checklist
&lt;/h2&gt;

&lt;p&gt;To make your documentation LLM-friendly, focus on hierarchy, clarity, and structure. Below are some practical guidelines you can apply&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Provide an llms.txt file&lt;/strong&gt;: &lt;a href="https://llmstxt.org/" rel="noopener noreferrer"&gt;llms.txt&lt;/a&gt; is a proposed standard for making web content available in text-based formats that are easier for LLMs to process. llms docs page should be accessible by appending &lt;code&gt;/llms.txt&lt;/code&gt; to the root URL of your docs site. The llms.txt file serves as an index for your documentation site, providing a comprehensive list of all available markdown-formatted pages. With this file, you make it easier for LLMs to efficiently discover and process your documentation content&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Use concise, clear language&lt;/strong&gt;: Use clear phrasing, avoid jargon, and define acronyms when they first appear&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Add descriptions when linking&lt;/strong&gt;: When linking to resources, include brief, information descriptions&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Test your docs with LLMs&lt;/strong&gt;: Run a tool that expands your &lt;code&gt;llms.txt&lt;/code&gt; file into an LLM context file and test a number of language models to see if they can answer questions about your content&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Example
&lt;/h3&gt;

&lt;p&gt;Here's an example of llms.txt, in this case a cut down version of the file used for the FastHTML project (&lt;a href="https://www.fastht.ml/docs/llms.txt" rel="noopener noreferrer"&gt;Full version here&lt;/a&gt;)&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight markdown"&gt;&lt;code&gt;&lt;span class="gh"&gt;# FastHTML&lt;/span&gt;
&lt;span class="gt"&gt;
&amp;gt; FastHTML is a python library which brings together Starlette, Uvicorn, HTMX, and fastcore's `FT` "FastTags" into a library for creating server-rendered hypermedia applications.&lt;/span&gt;

Important notes:
&lt;span class="p"&gt;
-&lt;/span&gt; Although parts of its API are inspired by FastAPI, it is &lt;span class="ge"&gt;*not*&lt;/span&gt; compatible with FastAPI syntax and is not targeted at creating API services
&lt;span class="p"&gt;-&lt;/span&gt; FastHTML is compatible with JS-native web components and any vanilla JS library, but not with React, Vue, or Svelte.

&lt;span class="gu"&gt;## Docs&lt;/span&gt;
&lt;span class="p"&gt;
-&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nv"&gt;FastHTML quick start&lt;/span&gt;&lt;span class="p"&gt;](&lt;/span&gt;&lt;span class="sx"&gt;https://fastht.ml/docs/tutorials/quickstart_for_web_devs.html.md&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;: A brief overview of many FastHTML features
&lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nv"&gt;HTMX reference&lt;/span&gt;&lt;span class="p"&gt;](&lt;/span&gt;&lt;span class="sx"&gt;https://github.com/bigskysoftware/htmx/blob/master/www/content/reference.md&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;: Brief description of all HTMX attributes, CSS classes, headers, events, extensions, js lib methods, and config options

&lt;span class="gu"&gt;## Examples&lt;/span&gt;
&lt;span class="p"&gt;
-&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nv"&gt;Todo list application&lt;/span&gt;&lt;span class="p"&gt;](&lt;/span&gt;&lt;span class="sx"&gt;https://github.com/AnswerDotAI/fasthtml/blob/main/examples/adv_app.py&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;: Detailed walk-thru of a complete CRUD app in FastHTML showing idiomatic use of FastHTML and HTMX patterns.

&lt;span class="gu"&gt;## Optional&lt;/span&gt;
&lt;span class="p"&gt;
-&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nv"&gt;Starlette full documentation&lt;/span&gt;&lt;span class="p"&gt;](&lt;/span&gt;&lt;span class="sx"&gt;https://gist.githubusercontent.com/jph00/809e4a4808d4510be0e3dc9565e9cbd3/raw/9b717589ca44cedc8aaf00b2b8cacef922964c0f/starlette-sml.md&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;: A subset of the Starlette documentation useful for FastHTML development. 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  In conclusion
&lt;/h2&gt;

&lt;p&gt;It is now evident that LLMs has become an integral part of how users discover, consume, and interact with technical contents, hence, optimizing your documentation for them is no longer optional but essential. &lt;/p&gt;

&lt;p&gt;A few years ago, writing docs was primarily about making content accessible to humans. It is no longer the case today, it's now about writing the docs for two audiences at once; Human readers and AI systems that increasingly act as intermediaries.&lt;/p&gt;

&lt;p&gt;By adopting practices like concise, structured explanations and LLM-friendly writing and implementing standards such as &lt;code&gt;llm.txt&lt;/code&gt; and &lt;code&gt;llm-full.txt&lt;/code&gt;, you not only future proof your documentation but also make it easier for AI systems to deliver accurate answers based on your content&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Humans get clearer, more accessible documentation.&lt;/li&gt;
&lt;li&gt;LLMs can amplify your docs, driving visibility, trust, and adoption of your product.&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;Basically, LLM-ready docs = better user experience for everyone&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;So, as you write or revise your next piece of documentation, keep this principle in mind to write for humans and optimize for machines :)&lt;/p&gt;

</description>
      <category>llm</category>
      <category>documentation</category>
    </item>
    <item>
      <title>Meta prompt; Why your prompt alone may be limiting your LLM</title>
      <dc:creator>Joshua Olajide</dc:creator>
      <pubDate>Thu, 24 Jul 2025 13:10:36 +0000</pubDate>
      <link>https://dev.to/joshtom/meta-prompt-why-your-prompt-alone-may-be-limiting-your-llm-4co5</link>
      <guid>https://dev.to/joshtom/meta-prompt-why-your-prompt-alone-may-be-limiting-your-llm-4co5</guid>
      <description>&lt;p&gt;There's a good chance you are not getting the best out of your LLM (Large Language Model) not because the model isn't powerful enough, but because your prompt isn't. &lt;/p&gt;

&lt;p&gt;Maybe you are too quick to ask a question before structuring your thought or it could be that you are not giving your LLM enough context. In my early days of writing prompts, I found myself doing something interestingly odd which is giving my rough prompt to another LLM just to see how it would rewrite or improve it and most times the results are often better, more structured and often closer to what I actually needed.&lt;/p&gt;

&lt;p&gt;At the time, I didn’t have a name for this process. It just felt like I was &lt;code&gt;refining&lt;/code&gt; a prompt through another prompt. But few weeks ago, I learned the actual term which is called &lt;code&gt;meta prompting&lt;/code&gt;. That's when it all started making sense.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;That’s when it all clicked :)&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;This post is for people like me who have dabbled in prompt engineering, maybe even practiced meta prompting without realizing it. And now, you want to do it more intentionally, to shape how your LLM think before it answers and getting the best of it.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is meta prompting?
&lt;/h2&gt;

&lt;p&gt;According to the &lt;a href="https://arxiv.org/pdf/2401.12954" rel="noopener noreferrer"&gt;white paper&lt;/a&gt; where it originated from, meta prompting is described as an effective scaffolding technique which is a way to organize and manage how a language model approaches a task, especially when the task involves multiple steps, contexts, perspectives, or modes of thinking.&lt;/p&gt;

&lt;p&gt;But let’s break it down.&lt;/p&gt;

&lt;p&gt;Meta prompting is what happens when you stop treating a language model like a tool that needs to be told what to do and start treating it like a system that needs to decide how to do something well.&lt;/p&gt;

&lt;p&gt;Think back to the early wave of prompt engineering where everyone was obsessed with the &lt;code&gt;expert roleplay&lt;/code&gt; trick&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;You are a senior software engineer. Given the following request…
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;I'm still quite obsessed with it though...&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Then came a brilliant shift. What if, instead of telling the model what role to play, we asked the model to decide the best role for the task? What if we asked the model to design the optimal prompt for itself? Amidst the numerous "what if's"... That’s where meta prompting was born.&lt;/p&gt;

&lt;p&gt;It’s a mindset shift: from giving commands to creating frameworks. For example, instead of writing a direct prompt like:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Write a landing page headline for a new SaaS product...
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A simple meta prompt would go as thus&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Design a prompt that would help generate a compelling landing page headline for a new SaaS product. Think through what details the model would need, what kind of tone would work best, and what process it should follow
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;With that one change, the model isn’t just a coder anymore it becomes a prompt engineer, a strategist, and sometimes even a teacher.&lt;/p&gt;

&lt;p&gt;Meta prompting opens the door to collaborative prompting where you and the LLM think together about what the best next step is, rather than rushing to the final output.&lt;/p&gt;

&lt;h2&gt;
  
  
  From prompts to systems
&lt;/h2&gt;

&lt;p&gt;Prompting at first glance feels straightforward. You ask a question or give an instruction, and the model gives you a response. But over time especially when the questions become layered or the tasks becomes more difficult, something becomes clear... simple or not well structured prompts often fall short.&lt;/p&gt;

&lt;p&gt;You begin to notice that your outputs lack consistency. Or they sound close but not quite right. You tweak the wording, try again and again, chasing a result that feels just out of reach. Then you realize that maybe the problem is not with the word but the way the model is being asked to think.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;That’s when prompting stops being a task and starts to feel like design.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The shift happens when you stop seeing the LLM as a tool you command, and start treating it as a system you can guide. Instead of telling it what to do, you begin to shape how it reasons. You lay out a structure; break the task into steps, evaluate different options, choose based on a goal, and reflect on what it just produced.&lt;/p&gt;

&lt;p&gt;The word Meta prompting is not a fancy technique, it is a mindset. It is where you move from issuing requests to building processes. You start to treat your prompt like a blueprint, one that defines roles, sets expectations, and provides space for the model to explore, self-correct and even enhance the result.&lt;/p&gt;

&lt;p&gt;It is no longer about getting a response. It is about helping the model arrive at better outcomes just because you designed a better path for it to walk through.&lt;/p&gt;

&lt;h2&gt;
  
  
  The conditions that lead to better outputs
&lt;/h2&gt;

&lt;p&gt;You may get tired of writing prompts at some point and start wondering if your prompt could actually be better, this is where you begin to ask your self &lt;code&gt;How can I phrase this to get a clearer or more accurate response?&lt;/code&gt; Then maybe, instead of rewriting it yourself, you ask the model to improve it for you. &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Meta prompting isn’t about the output. It’s about shaping the conditions that lead to better outputs&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The moment this becomes real is when your prompt is almost right but just not enough to get you the kind of output you want. You definitely know that the model can do more, the steps are there, the style is close. But something is missing which is structure, depth and clarity. And instead of refactoring your prompt manually, you can ask the model to help fix the way you are asking.&lt;/p&gt;

&lt;p&gt;I saw a brilliant &lt;a href="https://x.com/AlfaizAliX/status/1944082612836085920" rel="noopener noreferrer"&gt;X post&lt;/a&gt; on meta prompt that captures this perfectly. Instead of writing a new prompt from scratch, it tells the model to act like an expert prompt engineer, understand the user's query, and return a well crafted version that’s clear, specific, and context-aware. In this case, the model is not just generating content but rather optimizing instructions.&lt;/p&gt;

&lt;p&gt;Meta prompting also shines when you know the outcome you want but don’t know how to phrase it. You describe your intent, hand it over, and ask the model to design the path to get there. You stop guessing, and let the system co design with you.&lt;/p&gt;

&lt;h2&gt;
  
  
  The art of meta prompting
&lt;/h2&gt;

&lt;p&gt;Most direct prompts such as &lt;code&gt;Summarize this article&lt;/code&gt; will not give a desirable result. &lt;/p&gt;

&lt;p&gt;The art of meta prompt is switching the LLM into a reflective mode. For example&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;How would a world-class research summarize this article to a beginner
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;is a subtle shift, but it changes everything. In this case, you are no longer treating the LLM as a tool that only executes instructions but as a collaborator who thinks through the task with you.&lt;/p&gt;

&lt;p&gt;The art of meta prompting starts when you stop optimizing your prompt for the answer and start optimizing for the thinking that leads to that answer.&lt;/p&gt;

&lt;p&gt;One of the easiest way to get there is giving the model a role. Not just &lt;code&gt;You are an expert...&lt;/code&gt; but something more deeper such as &lt;code&gt;A prompt designer&lt;/code&gt; &lt;code&gt;A decision architect&lt;/code&gt; &lt;code&gt;A senior software engineer with many years of experience&lt;/code&gt;. You use that role not to make it sound smart, but to push it to reason more deliberately.&lt;/p&gt;

&lt;p&gt;I saw another interesting &lt;a href="https://x.com/tibo_maker/status/1944690925290021350" rel="noopener noreferrer"&gt;X post&lt;/a&gt; on meta prompt that nails it. Instead of asking the model to answer a query, the user gives it a mission instead &lt;code&gt;Craft the best possible prompt to answer this user's goal&lt;/code&gt; And then it laters in context, quality guidelines, and evaluation standards (clarity, specificity, accuracy, reasoning etc). The model is asked to think like someone who optimizes thought itself and that request alone changes the kind of prompt it produces.&lt;/p&gt;

&lt;p&gt;These are what makes meta prompting an art, there's no rigid formula; You are designing systems of thought, not just strings of text.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;You can ask the model to critique it's own response then&lt;br&gt;
Pass the response back to the model and ask &lt;code&gt;How could this be made better?&lt;/code&gt;&lt;br&gt;
You can break tasks into multiple sections, each with a different instructions or goal&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The real art starts with one simple question&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;What kind of prompt would actually unlock the best in this model?
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Some practical patterns and prompt
&lt;/h2&gt;

&lt;p&gt;A good meta prompt doesn't always start with the perfect words, it usually starts with an intention. For example &lt;code&gt;I want the model to think before it answers&lt;/code&gt; or &lt;code&gt;I want the model to reflect on different options before it chooses&lt;/code&gt;, From there you design the structure that encourages that behaviour.&lt;/p&gt;

&lt;p&gt;One approach is to begin with &lt;code&gt;role&lt;/code&gt;. But instead of the usual &lt;code&gt;You are an expert...&lt;/code&gt;, you can frame the role around the process you want. An example is&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;You are a prompt engineer tasked with crafting the clearest, most effective prompt to solve a user’s goal. Think through the goal, evaluate possible prompts, then output only the final optimized prompt.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Note that the above doesn't stop at the goal. It adds instructions that drive the model to reason, evaluate and refine before giving an output&lt;/p&gt;

&lt;p&gt;Another pattern is &lt;code&gt;feedback loops&lt;/code&gt;&lt;br&gt;
This is where you ask the model to generate a response, then immediately critique it&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Critique the above response based on clarity, accuracy, and depth. Suggest exactly how it could be improved.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then ask it to rewrite based on that feedback. You’re building a self review system and all of it happens within one interaction. You can also split intent and execution&lt;/p&gt;

&lt;p&gt;First, prompt the model with:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;What steps should be taken to solve this problem thoroughly?
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then once it lists them follow with:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Now complete the task by following the steps above, one at a time
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In each of these cases, you are not necessarily prompting the model to do, but you are prompting it to think through doing. That’s the distinction.&lt;/p&gt;

&lt;p&gt;One final example; If you're designing content or strategy, you can layer multiple lenses. First, ask the model to generate raw ideas then, prompt it to assess those ideas based on specific goals (e.g clarity, impact, originality). Finally, ask it to improve or combine the strongest ones. Each pass adds depth, not noise. And each layer is a prompt in itself. The best part is that they are not advanced tricks but they are reusable patterns. And once you internalize them, you stop writing one off prompts and start creating systems you can rely on, no matter the task.&lt;/p&gt;

&lt;h2&gt;
  
  
  In conclusion
&lt;/h2&gt;

&lt;p&gt;At the surface, prompting feels like giving instructions to a very smart machine. You say something, it replies. But as your expectations grow, you start to realize that the quality of the response depends less on how clever your question is, and more on how well you’ve structured the model’s thinking.&lt;/p&gt;

&lt;p&gt;Meta prompting is the shift from speaking to a model to designing how it reasons. It’s not a hack or a trick. It’s a mindset. You start to treat the language model not as a genie that grants wishes, but as a system that can be guided, corrected, and improved (if you give it the right path).&lt;/p&gt;

&lt;p&gt;This approach is especially powerful for those building tools, interfaces, or workflows around AI. You’re not just prompting for fun. You need reliability, structure, repeatability. Meta prompting gives you the scaffolding to build that.&lt;/p&gt;

&lt;p&gt;Whether you're asking it to review its own work, define its own goals, simulate expertise, or reflect before it answers, you are no longer just writing prompts. You are building systems of thought.&lt;/p&gt;

&lt;p&gt;And the more you do it, the more natural it becomes, you stop thinking in one shot instructions and start thinking in flows / patterns. You then realize that your job isn’t to control the model, but to co design how it reasons.&lt;/p&gt;

&lt;p&gt;That’s where the real power lies. Not in what the model knows, but in how you shape the way it thinks&lt;/p&gt;

&lt;h2&gt;
  
  
  More prompt example
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://gist.github.com/pyros-projects/c77402249b5b45f0a501998870766ae9" rel="noopener noreferrer"&gt;Example 1&lt;/a&gt;&lt;br&gt;
&lt;a href="https://gist.github.com/pyros-projects/f6430df8ac6f1ac37e5cfb6a8302edcf" rel="noopener noreferrer"&gt;Example 2&lt;/a&gt;&lt;br&gt;
&lt;a href="https://x.com/alex_prompter/status/1947373326562955721" rel="noopener noreferrer"&gt;Example 3&lt;/a&gt;&lt;br&gt;
&lt;a href="https://x.com/tunahorse21/status/1882493266933006503" rel="noopener noreferrer"&gt;Example 4&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Further reading
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://www.prompthub.us/blog/a-complete-guide-to-meta-prompting" rel="noopener noreferrer"&gt;A complete guide to meta prompting&lt;/a&gt;&lt;br&gt;
&lt;a href="https://www.promptingguide.ai/techniques/cot" rel="noopener noreferrer"&gt;Chain of thought prompting&lt;/a&gt;&lt;br&gt;
&lt;a href="https://cursor.com/blog/prompt-design" rel="noopener noreferrer"&gt;Prompt Design&lt;/a&gt;&lt;br&gt;
&lt;a href="https://www.kaggle.com/whitepaper-prompt-engineering" rel="noopener noreferrer"&gt;Prompt Engineering masterclass by Google&lt;/a&gt;&lt;/p&gt;

</description>
      <category>promptengineering</category>
      <category>llm</category>
      <category>ai</category>
    </item>
    <item>
      <title>When AI steals the joy of creating</title>
      <dc:creator>Joshua Olajide</dc:creator>
      <pubDate>Wed, 04 Jun 2025 12:07:29 +0000</pubDate>
      <link>https://dev.to/joshtom/when-ai-steals-the-joy-of-creating-3aj2</link>
      <guid>https://dev.to/joshtom/when-ai-steals-the-joy-of-creating-3aj2</guid>
      <description>&lt;p&gt;There's a satisfaction that comes with creating that is so hard to explain, Ofcourse it's different for everyone; Is it the excitement that comes with chasing an idea or the exploration and eventually shaping it into something real. It is not just about the finished product, it's the late-night rabbit holes, the unexpected research that comes along the way, the small "aha" moments that make you want to keep showing up&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;But sometimes, without warning, that joy disappears!&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Ever been in a situation where you feel overly excited about a new idea, then out of excitement you decided to share the idea with a friend and they weren't as excited about it as you were? Or only for them to nod nicely and say "Niceeeee"&lt;/p&gt;

&lt;p&gt;Or in a similar situation where they are as excited but they gave you a detailed analysis of your idea, analyze it, build on it, reframe it... and somehow, in the process of seeing your idea laid out clearly, you lose the spark. The energy / excitement vanishes. Suddenly the idea feels finished; though you haven't even done anything on it yet.&lt;/p&gt;

&lt;p&gt;Then you move on...&lt;br&gt;
Then it happens again...&lt;br&gt;
Until eventually, you are left wondering; why don't I feel like creating anymore?&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;The "friend" in this story? that's AI&lt;br&gt;
The "you" that's me&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;I didn't see it coming at first. But the more I used AI to help shape my thoughts, the more I noticed a quiet tradeoff happening: clarity in exchange for creativity, Speed in exchange for spark, Convenience... at the cost of fulfilment.&lt;/p&gt;

&lt;h2&gt;
  
  
  The joy of the process
&lt;/h2&gt;

&lt;p&gt;A few years ago, if you wanted to write about something technical, let's say an article on Golang; your first most likely stop would be the official documentation. From there, you'd dive into Google, hunting down blog posts, tutorials, white papers, articles, youtube videos and forum discussions to be able to gather a broad range of perspectives. &lt;/p&gt;

&lt;p&gt;But you didn't just copy and paste. Instead, you absorbed all this information, piece by piece, until you fully have a better understanding about the topic. Along the way, you'd come across terms and concepts that you are not familiar with which then forced you to pause and dig deeper. You might even take some time off to experiment, research, and make sense of it all.&lt;/p&gt;

&lt;p&gt;Only after this deliberate (sometimes slow) process can you piece together your findings into a coherent article that reflects your understanding. Writing a technical piece wasn't just about sharing facts; it was proof that you have developed a grounded knowledge of the subject. And with that understanding came confidence.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;The confidence that you weren't just repeating information, but truly owned the topic&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  When AI skips the process
&lt;/h2&gt;

&lt;p&gt;Fast forward to present where AI is now fully in the picture; Powerful, efficient, and also impressively fast. It has helped unblocked writers from creative ruts lol, speed up research, complete projects in record time and deliver answers without the usual deep dive down the rabbit hole lol.&lt;/p&gt;

&lt;p&gt;But where is the joy!? No doubt that AI excels at removing friction, it however, often takes with it something far more valuable.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;The messy middle&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The messy middle as I love to call it is like the chaotic, uncertain space or finding the right "click" between idea and execution is where much of human creativity lives. It's where we struggle, discover, and evolve our thoughts into something richer. AI can obviously shortcut that process, sometimes even to the point where we like we are like spectators to our own ideas.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;All it takes is one prompt&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;All it takes is one prompt, and it spits out polished answers before you've even had a chance to think things through. Yes! It's fast but how about the result? Content that might read well on the surface, but often lacks human touch, soul, no real connection to the audience, no &lt;code&gt;hard-earned&lt;/code&gt; insights, just a pile of buzz words strung together by patten recognition.&lt;/p&gt;

&lt;p&gt;When the process disappears, so does the sense of ownership. And without ownership, what are we truly creating?&lt;/p&gt;

&lt;h2&gt;
  
  
  You are not alone
&lt;/h2&gt;

&lt;p&gt;The struggle is real, The excitement that fades out cannot be over emphasized and you are not the only one feeling it. That rush of excitement when a new idea hits? It's powerful. But just as quickly, it can vanish the moment AI turns your spark into a neatly packaged paragraph. You thought you were about to write something, but now it feels like it's already written, and somehow... not by you.&lt;/p&gt;

&lt;p&gt;It's not that you didn't get what you asked for, in fact, you got it instantly. But the thrill? The curiosity? The messy exploration that made you feel in it may be gone with a single prompt. You are then left with staring at a finished answer, yet feeling creatively empty.&lt;/p&gt;

&lt;p&gt;If you have felt this, you are not alone. Many creators are experiencing the same disconnect; a silent kind of burnout that doesn't come from working too hard, but from skipping the part that made the work meaningful in the first place.&lt;/p&gt;

&lt;h2&gt;
  
  
  Reclaiming the joy of writing
&lt;/h2&gt;

&lt;p&gt;That constant feeling of &lt;code&gt;not being enough&lt;/code&gt; is not a flaw, it's however a signal. It's a sign that you still care. That you are still full of ideas worth exploring. If anything, it means the spark is still alive.&lt;/p&gt;

&lt;p&gt;AI doesn't have to be the &lt;code&gt;thief of your creativity&lt;/code&gt;. It can be your creative partner, a co-pilot, not a ghostwriter.&lt;/p&gt;

&lt;p&gt;Instead of outsourcing your ideas to a machine, start with your own messy, human draft then embrace the rawness, the imperfection, the questions. Invite AI to collaborate but not to take over but to sharpen, reshape, and challenge your thinking.&lt;/p&gt;

&lt;p&gt;Use it to unblock yourself, explore alternatives, find patterns, or expand a thought; not to replace the joy of the process.&lt;/p&gt;

&lt;p&gt;Here is an example prompt you can try: &lt;code&gt;Act as a co-editor. Let's brainstorm on this idea together&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;You can even add reference links, articles, docs etc for extra context. That way, it becomes collaborative effort; your idea, your voice, enhanced by the tools you choose to work with&lt;/p&gt;

&lt;p&gt;Because at the end of the day, writing is not just about hitting the 'publish' button. It's about making something that feels true to you.&lt;/p&gt;

&lt;h2&gt;
  
  
  A letter to self
&lt;/h2&gt;

&lt;p&gt;AI isn't the enemy, However, it can quietly overshadow your voice only if you let it. &lt;/p&gt;

&lt;p&gt;So take back the pen. Let the ideas breathe in its raw unfinished form, let the process be messy, curious and human.&lt;/p&gt;

&lt;p&gt;And most importantly, let yourself feel proud -- not just of what you create, but how you create it.&lt;/p&gt;

&lt;p&gt;You are still the writer. AI is just the assistant!&lt;/p&gt;

</description>
      <category>ai</category>
      <category>contentwriting</category>
    </item>
    <item>
      <title>Build a REST API with Prisma, Node JS and Typescript.</title>
      <dc:creator>Joshua Olajide</dc:creator>
      <pubDate>Sat, 11 Mar 2023 03:30:01 +0000</pubDate>
      <link>https://dev.to/joshtom/build-a-rest-api-with-prisma-node-js-and-typescript-36o</link>
      <guid>https://dev.to/joshtom/build-a-rest-api-with-prisma-node-js-and-typescript-36o</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;The process of learning a new technology can often feel tedious, especially in the initial stages when you have yet to see it in action.&lt;/p&gt;

&lt;p&gt;This article will guide you through the process of integrating these amazing technologies and demonstrate how to build a small application using them.&lt;/p&gt;

&lt;p&gt;During the course of this article, we will develop a blog application that showcases how CRUD operations work in practice, with fundamental functions including:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Creating new posts&lt;/li&gt;
&lt;li&gt;Retrieving all posts or a specific post&lt;/li&gt;
&lt;li&gt;Modifying post content&lt;/li&gt;
&lt;li&gt;And ultimately, removing a post&lt;/li&gt;
&lt;li&gt;An additional feature we will implement is the inclusion of a like count for each post.&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;CRUD means CREATE, READ, UPDATE and DELETE&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;If you are interested in checking out the code, Check out the github repository &lt;a href="https://github.com/joshtom/Node-Prisma-Typescript-Blog-Api" rel="noopener noreferrer"&gt;here&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Prerequisite
&lt;/h2&gt;

&lt;p&gt;Before you proceed, it's important to be acquainted with the following set of tools:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Node.js and Express.js&lt;/li&gt;
&lt;li&gt;TypeScript&lt;/li&gt;
&lt;li&gt;Prisma&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you require a brief overview of Prisma, my blog post &lt;a href="https://dev.to/joshtom/what-the-heck-is-prisma-26kg"&gt;here&lt;/a&gt; can be a helpful resource.&lt;/p&gt;

&lt;h2&gt;
  
  
  Let's Get Started 🚀
&lt;/h2&gt;

&lt;p&gt;Open up your terminal then create and navigate to your folder directory using the below command&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;mkdir prisma-typescript-blog &amp;amp;&amp;amp; cd prisma-typescript-blog
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Next, Initialize the project using yarn&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;yarn init -y
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then, Install the Dependencies&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;yarn add -D @types/express @types/node prisma ts-node-dev typescript 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;yarn add express @prisma/client
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Finally, set up Prisma with the &lt;code&gt;init&lt;/code&gt; command of the Prisma CLI:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npx prisma init --datasource-provider sqlite 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This creates a new prisma directory with your Prisma schema file and configures Sqlite as your database.&lt;/p&gt;

&lt;h2&gt;
  
  
  Set up Prisma Schema
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;prisma/prisma.schema&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;datasource&lt;/span&gt; &lt;span class="nx"&gt;db&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;provider&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;sqlite&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
  &lt;span class="nx"&gt;url&lt;/span&gt;      &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;env&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;DATABASE_URL&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nx"&gt;generator&lt;/span&gt; &lt;span class="nx"&gt;client&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;provider&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;prisma-client-js&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nx"&gt;model&lt;/span&gt; &lt;span class="nx"&gt;Post&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;id&lt;/span&gt;         &lt;span class="nx"&gt;Int&lt;/span&gt;      &lt;span class="p"&gt;@&lt;/span&gt;&lt;span class="nd"&gt;id&lt;/span&gt; &lt;span class="p"&gt;@&lt;/span&gt;&lt;span class="nd"&gt;default&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;autoincrement&lt;/span&gt;&lt;span class="p"&gt;())&lt;/span&gt;
  &lt;span class="nx"&gt;title&lt;/span&gt;      &lt;span class="nb"&gt;String&lt;/span&gt;
  &lt;span class="nx"&gt;content&lt;/span&gt;    &lt;span class="nb"&gt;String&lt;/span&gt;
  &lt;span class="nx"&gt;likesCount&lt;/span&gt; &lt;span class="nx"&gt;Int&lt;/span&gt;      &lt;span class="p"&gt;@&lt;/span&gt;&lt;span class="nd"&gt;default&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="nx"&gt;createdAt&lt;/span&gt;  &lt;span class="nx"&gt;DateTime&lt;/span&gt; &lt;span class="p"&gt;@&lt;/span&gt;&lt;span class="nd"&gt;default&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;now&lt;/span&gt;&lt;span class="p"&gt;())&lt;/span&gt;
  &lt;span class="nx"&gt;updatedAt&lt;/span&gt;  &lt;span class="nx"&gt;DateTime&lt;/span&gt; &lt;span class="p"&gt;@&lt;/span&gt;&lt;span class="nd"&gt;updatedAt&lt;/span&gt;

  &lt;span class="c1"&gt;// Relations&lt;/span&gt;
  &lt;span class="nx"&gt;comments&lt;/span&gt; &lt;span class="nx"&gt;Comment&lt;/span&gt;&lt;span class="p"&gt;[]&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nx"&gt;model&lt;/span&gt; &lt;span class="nx"&gt;Comment&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;id&lt;/span&gt;        &lt;span class="nx"&gt;Int&lt;/span&gt;      &lt;span class="p"&gt;@&lt;/span&gt;&lt;span class="nd"&gt;id&lt;/span&gt; &lt;span class="p"&gt;@&lt;/span&gt;&lt;span class="nd"&gt;default&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;autoincrement&lt;/span&gt;&lt;span class="p"&gt;())&lt;/span&gt;
  &lt;span class="nx"&gt;content&lt;/span&gt;   &lt;span class="nb"&gt;String&lt;/span&gt;
  &lt;span class="nx"&gt;createdAt&lt;/span&gt; &lt;span class="nx"&gt;DateTime&lt;/span&gt; &lt;span class="p"&gt;@&lt;/span&gt;&lt;span class="nd"&gt;default&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;now&lt;/span&gt;&lt;span class="p"&gt;())&lt;/span&gt;
  &lt;span class="nx"&gt;updatedAt&lt;/span&gt; &lt;span class="nx"&gt;DateTime&lt;/span&gt; &lt;span class="p"&gt;@&lt;/span&gt;&lt;span class="nd"&gt;updatedAt&lt;/span&gt;

  &lt;span class="c1"&gt;// Relations&lt;/span&gt;
  &lt;span class="nx"&gt;post&lt;/span&gt;   &lt;span class="nx"&gt;Post&lt;/span&gt; &lt;span class="p"&gt;@&lt;/span&gt;&lt;span class="nd"&gt;relation&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;fields&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;postId&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="nx"&gt;references&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;id&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;
  &lt;span class="nx"&gt;postId&lt;/span&gt; &lt;span class="nx"&gt;Int&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

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

&lt;/div&gt;



&lt;p&gt;In the above schema we define our Blog Models which includes &lt;code&gt;Post&lt;/code&gt; and &lt;code&gt;Comment&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;post&lt;/span&gt;   &lt;span class="nx"&gt;Post&lt;/span&gt; &lt;span class="p"&gt;@&lt;/span&gt;&lt;span class="nd"&gt;relation&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;fields&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;postId&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="nx"&gt;references&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;id&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This line of code means that there's a one-to-many relationship between the &lt;code&gt;Post&lt;/code&gt; and &lt;code&gt;Comment&lt;/code&gt; models. One post can have many comments, and each comment is associated with only one post. The &lt;code&gt;postId&lt;/code&gt; field in the &lt;code&gt;Comment&lt;/code&gt; model is used to reference the &lt;code&gt;id&lt;/code&gt; field in the &lt;code&gt;Post&lt;/code&gt; model.&lt;/p&gt;

&lt;p&gt;Once you are done with this, Update your &lt;code&gt;package.json&lt;/code&gt; to look like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"name"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"prisma-typescript-blog"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"version"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"1.0.0"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"main"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"index.js"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"license"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"MIT"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"scripts"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"start"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"ts-node-dev --respawn --transpile-only --exit-child src/server.ts"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"db:migrate"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"npx prisma migrate dev --name user-entity --create-only &amp;amp;&amp;amp; npx prisma generate"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"db:push"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"npx prisma db push"&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"compilerOptions"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"target"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"es5"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"module"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"commonjs"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"lib"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="s2"&gt;"es6"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="s2"&gt;"dom"&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"devDependencies"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"@types/express"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"^4.17.17"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"prisma"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"^4.11.0"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"ts-node-dev"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"^2.0.0"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"typescript"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"^4.9.5"&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"dependencies"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"@prisma/client"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"^4.11.0"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"dotenv"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"^16.0.3"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"express"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"^4.18.2"&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;

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

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;start&lt;/code&gt; Starts the Node Js Server&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;db:migrate&lt;/code&gt; - Generate the migration file and Prisma Client&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;db:push&lt;/code&gt; - Pushes the Prisma schema to the database&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Migration
&lt;/h2&gt;

&lt;p&gt;At this point, you have a Prisma model but no database yet. Open your terminal and run the following command to create the SQLite database and the “posts” table represented by the model.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;yarn db:migrate
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After running the command, the Prisma CLI will analyze your schema and generate a migration file in the &lt;code&gt;prisma/migrations&lt;/code&gt; directory.&lt;/p&gt;

&lt;p&gt;Push the Prisma schema to the database:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;yarn db:push
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After synching the SQLite database with the Prisma schema, run &lt;code&gt;npx prisma studio&lt;/code&gt; to open the Prisma GUI tool in the browser. Prisma studio allows you to view and mutate the data stored in the database.&lt;/p&gt;

&lt;p&gt;By now, Your browser should automatically open a new tab and you will see something like this:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fit83grd0a61h7uhob5e7.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fit83grd0a61h7uhob5e7.png" alt="Prisma Studio Example" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Project Structure 🚧
&lt;/h2&gt;

&lt;p&gt;Edit your project structure to look like below&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;`prisma` -|
          `schema.prisma`
`src` -|
     `controllers`
          -| 
           `post.controller.ts`
     `routes`
          -|
           `post.route.ts`
     `server.ts`
.env
`tsconfig.json`
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;.env&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;DATABASE_URL&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;file:./dev.db&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Replace whatever is in your &lt;code&gt;.env&lt;/code&gt; file with the above snippet&lt;/p&gt;

&lt;h2&gt;
  
  
  Let's move on to the fun part 💃
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;server.ts&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;express&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;Request&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;Response&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;express&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;PrismaClient&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;@prisma/client&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;PostRouter&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;./routes/blog.route&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;prisma&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;PrismaClient&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;app&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;express&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;port&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;8080&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;main&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;app&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;use&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;express&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;json&lt;/span&gt;&lt;span class="p"&gt;());&lt;/span&gt;

  &lt;span class="c1"&gt;// Register API routes&lt;/span&gt;
  &lt;span class="nx"&gt;app&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;use&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;/api/v1/post&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;PostRouter&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

  &lt;span class="c1"&gt;// Catch unregistered routes&lt;/span&gt;
  &lt;span class="nx"&gt;app&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;all&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;*&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;req&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;Request&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;Response&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;status&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;404&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;json&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="na"&gt;error&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;`Route &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;req&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;originalUrl&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt; not found`&lt;/span&gt; &lt;span class="p"&gt;});&lt;/span&gt;
  &lt;span class="p"&gt;});&lt;/span&gt;

  &lt;span class="nx"&gt;app&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;listen&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;port&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;`Server is listening on port &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;port&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="p"&gt;});&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nf"&gt;main&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
  &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;then&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;async &lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;prisma&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;$connect&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
  &lt;span class="p"&gt;})&lt;/span&gt;
  &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="k"&gt;catch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;async &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;e&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;error&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;e&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;prisma&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;$disconnect&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
    &lt;span class="nx"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;exit&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="p"&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Quite a lot is going on here, so let me explain&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;prisma = new PrismaClient()&lt;/code&gt; - Creates a new instance of the Prisma client&lt;/li&gt;
&lt;li&gt;The &lt;code&gt;express.json()&lt;/code&gt; Registers middleware to parse incoming request bodies as JSON.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;app.use("/api/v1/post", PostRouter);&lt;/code&gt; Registers API routes using the PostRouter module.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;app.all("*",...&lt;/code&gt; Defines a catch-all route to handle unregistered routes and return a 404 error response.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;When the &lt;code&gt;main()&lt;/code&gt; function is called, it starts the Express server and connects to the database using the Prisma client. If there are any errors, it logs the error to the console and disconnects from the database.&lt;/p&gt;

&lt;p&gt;The code serves as a starting point for building an API server with Node.js, Express.js, and Prisma ORM. It demonstrates how to handle API routes, connect to a database, and start a server that listens for incoming requests.&lt;/p&gt;

&lt;h2&gt;
  
  
  Routes
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;routes/post.route.ts&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;express&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;express&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;PostController&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;../controllers/post.controller&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;router&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;express&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Router&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;

&lt;span class="nx"&gt;router&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;post&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;/create&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;PostController&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;createBlogPost&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="nx"&gt;router&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;post&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;/createPostAndComments&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;PostController&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;createPostAndComments&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="nx"&gt;router&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;/getall&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;PostController&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;getBlogPosts&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="nx"&gt;router&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;/get/:id&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;PostController&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;getBlogPost&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="nx"&gt;router&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;put&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;/update/:id&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;PostController&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;updateBlogPost&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="nx"&gt;router&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="k"&gt;delete&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;/delete/:id&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;PostController&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;deleteBlogPost&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="nx"&gt;router&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="k"&gt;delete&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;/deleteall&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;PostController&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;deleteAllBlogPosts&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="nx"&gt;router&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;post&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;/like&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;PostController&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;likeBlogPost&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="nx"&gt;router&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

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

&lt;/div&gt;



&lt;p&gt;These routes are pretty straight forward except for the &lt;code&gt;/createPostAndComments&lt;/code&gt; route. Each route handles a specific HTTP method (POST, GET, PUT, or DELETE). The routes are mapped to methods defined in the &lt;code&gt;PostController&lt;/code&gt; controller, which handles the logic for each of these routes. &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;The &lt;code&gt;/:id&lt;/code&gt; portion of these routes is a parameter that represents a dynamic value that can be passed in the URL. The &lt;code&gt;id&lt;/code&gt; parameter is a placeholder for a specific value, such as a unique identifier for a blog post.&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;createPostAndComments&lt;/code&gt; will help us demonstrate a one to many relationship as it was defined in the Schema earlier.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;In the &lt;code&gt;Post&lt;/code&gt; Prisma model, there is a one-to-many relationship between &lt;code&gt;Post&lt;/code&gt; and &lt;code&gt;Comment&lt;/code&gt;, where one &lt;code&gt;Post&lt;/code&gt; can have many &lt;code&gt;Comments&lt;/code&gt;, but each &lt;code&gt;Comment&lt;/code&gt; can only belong to one &lt;code&gt;Post&lt;/code&gt;. This relationship is modeled in the Prisma schema using the &lt;code&gt;comments&lt;/code&gt; field in the &lt;code&gt;Post&lt;/code&gt; model:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;model&lt;/span&gt; &lt;span class="nx"&gt;Post&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;id&lt;/span&gt;         &lt;span class="nx"&gt;Int&lt;/span&gt;      &lt;span class="p"&gt;@&lt;/span&gt;&lt;span class="nd"&gt;id&lt;/span&gt; &lt;span class="p"&gt;@&lt;/span&gt;&lt;span class="nd"&gt;default&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;autoincrement&lt;/span&gt;&lt;span class="p"&gt;())&lt;/span&gt;
  &lt;span class="nx"&gt;title&lt;/span&gt;      &lt;span class="nb"&gt;String&lt;/span&gt;
  &lt;span class="nx"&gt;content&lt;/span&gt;    &lt;span class="nb"&gt;String&lt;/span&gt;
  &lt;span class="nx"&gt;likesCount&lt;/span&gt; &lt;span class="nx"&gt;Int&lt;/span&gt;      &lt;span class="p"&gt;@&lt;/span&gt;&lt;span class="nd"&gt;default&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="nx"&gt;createdAt&lt;/span&gt;  &lt;span class="nx"&gt;DateTime&lt;/span&gt; &lt;span class="p"&gt;@&lt;/span&gt;&lt;span class="nd"&gt;default&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;now&lt;/span&gt;&lt;span class="p"&gt;())&lt;/span&gt;
  &lt;span class="nx"&gt;updatedAt&lt;/span&gt;  &lt;span class="nx"&gt;DateTime&lt;/span&gt; &lt;span class="p"&gt;@&lt;/span&gt;&lt;span class="nd"&gt;updatedAt&lt;/span&gt;

  &lt;span class="c1"&gt;// Relations&lt;/span&gt;
  &lt;span class="nx"&gt;comments&lt;/span&gt; &lt;span class="nx"&gt;Comment&lt;/span&gt;&lt;span class="p"&gt;[]&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;As you can see, the &lt;code&gt;comments&lt;/code&gt; field is an array of &lt;code&gt;Comment&lt;/code&gt; objects, which represents the one-to-many relationship.&lt;/p&gt;

&lt;h2&gt;
  
  
  Controllers
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;controllers/post.controller.ts&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;Request&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;Response&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;express&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;prisma&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;../server&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;createBlogPost&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;async &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;req&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;Request&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;Response&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;try&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;title&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;content&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;req&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;body&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;newBlogPost&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;prisma&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;post&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;create&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
      &lt;span class="na"&gt;data&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="nx"&gt;title&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="nx"&gt;content&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="p"&gt;},&lt;/span&gt;
    &lt;span class="p"&gt;});&lt;/span&gt;
    &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;status&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;200&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;json&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;newBlogPost&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;catch &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;e&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;status&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;500&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;json&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="na"&gt;error&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;e&lt;/span&gt; &lt;span class="p"&gt;});&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;};&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;createPostAndComments&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;async &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;req&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;Request&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;Response&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;try&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;title&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;content&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;comments&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;req&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;body&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;newBlogPost&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;prisma&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;post&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;create&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
      &lt;span class="na"&gt;data&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="nx"&gt;title&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="nx"&gt;content&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="na"&gt;comments&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
          &lt;span class="na"&gt;create&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;comments&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="p"&gt;},&lt;/span&gt;
      &lt;span class="p"&gt;},&lt;/span&gt;
      &lt;span class="na"&gt;include&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="na"&gt;comments&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="c1"&gt;// Include the comments in the response&lt;/span&gt;
      &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="p"&gt;});&lt;/span&gt;
    &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;status&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;200&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;json&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;newBlogPost&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;catch &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;e&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;status&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;500&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;json&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="na"&gt;error&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;e&lt;/span&gt; &lt;span class="p"&gt;});&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;};&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;getBlogPosts&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;async &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;req&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;Request&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;Response&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;try&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;blogPosts&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;prisma&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;post&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;findMany&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
    &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;status&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;200&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;json&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;blogPosts&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;catch &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;e&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;status&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;500&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;json&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="na"&gt;error&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;e&lt;/span&gt; &lt;span class="p"&gt;});&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;};&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;getBlogPost&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;async &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;req&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;Request&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;Response&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;try&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;id&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;req&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;params&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;blogPost&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;prisma&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;post&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;findUnique&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
      &lt;span class="na"&gt;where&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="na"&gt;id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nc"&gt;Number&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;id&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
      &lt;span class="p"&gt;},&lt;/span&gt;
    &lt;span class="p"&gt;});&lt;/span&gt;
    &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;status&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;200&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;json&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;blogPost&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;catch &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;e&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;status&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;500&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;json&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="na"&gt;error&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;e&lt;/span&gt; &lt;span class="p"&gt;});&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;};&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;updateBlogPost&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;async &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;req&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;Request&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;Response&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;try&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;title&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;content&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;req&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;body&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;updatedBlogPost&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;prisma&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;post&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;update&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
      &lt;span class="na"&gt;where&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="na"&gt;id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nc"&gt;Number&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;id&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
      &lt;span class="p"&gt;},&lt;/span&gt;
      &lt;span class="na"&gt;data&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="nx"&gt;title&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="nx"&gt;content&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="p"&gt;},&lt;/span&gt;
    &lt;span class="p"&gt;});&lt;/span&gt;
    &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;status&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;200&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;json&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;updatedBlogPost&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;catch &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;e&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;status&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;500&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;json&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="na"&gt;error&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;e&lt;/span&gt; &lt;span class="p"&gt;});&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;};&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;deleteBlogPost&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;async &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;req&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;Request&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;Response&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;try&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;id&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;req&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;body&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;deletedBlogPost&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;prisma&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;post&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="k"&gt;delete&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
      &lt;span class="na"&gt;where&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="na"&gt;id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nc"&gt;Number&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;id&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
      &lt;span class="p"&gt;},&lt;/span&gt;
    &lt;span class="p"&gt;});&lt;/span&gt;
    &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;status&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;200&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;json&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;deletedBlogPost&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;catch &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;e&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;status&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;500&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;json&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="na"&gt;error&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;e&lt;/span&gt; &lt;span class="p"&gt;});&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;};&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;deleteAllBlogPosts&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;async &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;req&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;Request&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;Response&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;try&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;deletedBlogPosts&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;prisma&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;post&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;deleteMany&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
    &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;status&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;200&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;json&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;deletedBlogPosts&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;catch &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;e&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;status&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;500&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;json&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="na"&gt;error&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;e&lt;/span&gt; &lt;span class="p"&gt;});&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;};&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;likeBlogPost&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;async &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;req&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;Request&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;Response&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;try&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;id&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;req&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;body&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;likedBlogPost&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;prisma&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;post&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;update&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
      &lt;span class="na"&gt;where&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="na"&gt;id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nc"&gt;Number&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;id&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
      &lt;span class="p"&gt;},&lt;/span&gt;
      &lt;span class="na"&gt;data&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="na"&gt;likesCount&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
          &lt;span class="na"&gt;increment&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="p"&gt;},&lt;/span&gt;
      &lt;span class="p"&gt;},&lt;/span&gt;
    &lt;span class="p"&gt;});&lt;/span&gt;
    &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;status&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;200&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;json&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;likedBlogPost&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;catch &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;e&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;status&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;500&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;json&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="na"&gt;error&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;e&lt;/span&gt; &lt;span class="p"&gt;});&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;};&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;createBlogPost&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nx"&gt;createPostAndComments&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nx"&gt;getBlogPosts&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nx"&gt;getBlogPost&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nx"&gt;updateBlogPost&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nx"&gt;deleteBlogPost&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nx"&gt;deleteAllBlogPosts&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nx"&gt;likeBlogPost&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;};&lt;/span&gt;


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

&lt;/div&gt;



&lt;p&gt;This controller is quite bulky, so I will go ahead and explain each method one after the other.&lt;/p&gt;

&lt;p&gt;Our methods are listed as follows&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;createBlogPost&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;createPostAndComments&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;getBlogPosts&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;getBlogPost&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;updateBlogPost&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;deleteBlogPost&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;deleteAllBlogPosts&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;likeBlogPost&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;code&gt;createBlogPost&lt;/code&gt;&lt;br&gt;
This is a pretty simple method that accepts the &lt;code&gt;title&lt;/code&gt; and &lt;code&gt;content&lt;/code&gt;. It first destructures the title and content values from the &lt;code&gt;req.body&lt;/code&gt; object, which is the request payload.&lt;/p&gt;

&lt;p&gt;Also, it uses the &lt;code&gt;create()&lt;/code&gt; method to create a new blog post in the database. This method returns a Promise, which is why the await keyword is used to wait for the operation to complete before continuing execution.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;When a request is made to the &lt;code&gt;http://localhost:8080/api/v1/post/create&lt;/code&gt; endpoint with the credentials included in the request body, the &lt;code&gt;createBlogPost&lt;/code&gt; handler will be evoked to create a new blog post.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ff1md2s6vf3rje38fs5lq.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ff1md2s6vf3rje38fs5lq.png" alt="Blog post postman demo" width="800" height="487"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Postman is my preferred tool for testing all the endpoints, but feel free to use whichever testing tool you prefer.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;code&gt;createPostAndComments&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;The createPostAndComments method expects the request body to include a &lt;code&gt;title&lt;/code&gt;, &lt;code&gt;content&lt;/code&gt;, and an array of &lt;code&gt;comments&lt;/code&gt;. The method then creates the new Post object using the create() method provided by Prisma, and includes the &lt;code&gt;comments&lt;/code&gt; in the data object as well.&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;Comment&lt;/code&gt; object will include the &lt;code&gt;content&lt;/code&gt; field, as the &lt;code&gt;postId&lt;/code&gt; field will be automatically set by Prisma when the &lt;code&gt;Comment&lt;/code&gt; is associated with the new &lt;code&gt;Post&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Finally, the &lt;code&gt;include&lt;/code&gt; parameter is used to include the &lt;code&gt;comments&lt;/code&gt; for the newly created &lt;code&gt;Post&lt;/code&gt; in the response.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Here is how the payload and response looks like&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmavozmdwcfuh5jxoutys.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmavozmdwcfuh5jxoutys.png" alt="Example Body" width="800" height="362"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftk6i2o2iaklzdlg11bpw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftk6i2o2iaklzdlg11bpw.png" alt="Example Response" width="800" height="547"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;updateBlogPost&lt;/code&gt;&lt;br&gt;
This method first extracts the &lt;code&gt;id&lt;/code&gt;, &lt;code&gt;title&lt;/code&gt;, and &lt;code&gt;content&lt;/code&gt; properties from the request body using object destructuring.&lt;/p&gt;

&lt;p&gt;It then uses Prisma to update the blog post with the specified &lt;code&gt;id&lt;/code&gt;. The &lt;code&gt;update()&lt;/code&gt; method is called on the &lt;code&gt;post&lt;/code&gt; model, passing in an object that specifies the &lt;code&gt;where&lt;/code&gt; and &lt;code&gt;data&lt;/code&gt; clauses. The &lt;code&gt;where&lt;/code&gt; clause specifies the unique identifier for the blog post to be updated, while the &lt;code&gt;data&lt;/code&gt; clause specifies the new values for the &lt;code&gt;title&lt;/code&gt; and &lt;code&gt;content&lt;/code&gt; properties.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;likeBlogPost&lt;/code&gt;&lt;br&gt;
This method first extracts the &lt;code&gt;id&lt;/code&gt; property from the request body. This &lt;code&gt;id&lt;/code&gt; represents the unique identifier of the blog post to be liked.&lt;/p&gt;

&lt;p&gt;It then uses Prisma &lt;code&gt;prisma.post.update()&lt;/code&gt; to update the specified blog post. The &lt;code&gt;update()&lt;/code&gt; method is called on the &lt;code&gt;post&lt;/code&gt; model, passing in an object that specifies the &lt;code&gt;where&lt;/code&gt; and &lt;code&gt;data&lt;/code&gt; clauses. The &lt;code&gt;where&lt;/code&gt; clause specifies the unique identifier for the blog post to be updated, while the data clause &lt;code&gt;increments&lt;/code&gt; the &lt;code&gt;likesCount&lt;/code&gt; property by &lt;code&gt;1&lt;/code&gt; using the increment keyword&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Here is it in action&lt;/em&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;When a request is made to the &lt;code&gt;http://localhost:8080/api/v1/post/like&lt;/code&gt; endpoint passing &lt;code&gt;id&lt;/code&gt; as body, It then invokes the &lt;code&gt;createBlogPost&lt;/code&gt; handler and &lt;code&gt;likesCount&lt;/code&gt; will be incremented&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9anwpw3l7m0k6ci2eeud.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9anwpw3l7m0k6ci2eeud.png" alt="Like Image" width="800" height="487"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;All other methods are quite similar to what has been covered so I won't be going over them&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;After all these steps, Be sure your server is still running if not run &lt;code&gt;yarn start&lt;/code&gt; to get it up and running.&lt;/p&gt;

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

&lt;p&gt;This article demonstrates how to apply your knowledge of this amazing tools by creating a blog API using Node, Typescript, and Prisma. Additionally, the tutorial covers the process of connecting the API with a SQLite database.&lt;/p&gt;

&lt;p&gt;Congratulations on reaching the end of this article! If you found it helpful, please consider giving it a thumbs up and leaving your comments below.&lt;/p&gt;

&lt;p&gt;See you in the next 😉🚀&lt;/p&gt;

</description>
      <category>node</category>
      <category>typescript</category>
      <category>prisma</category>
    </item>
  </channel>
</rss>
