<?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: Abhishek tiwari</title>
    <description>The latest articles on DEV Community by Abhishek tiwari (@abhishek-tiwari-dev).</description>
    <link>https://dev.to/abhishek-tiwari-dev</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.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4103856%2Fa803f0d8-86fe-41c6-bf73-3a8852832f7c.png</url>
      <title>DEV Community: Abhishek tiwari</title>
      <link>https://dev.to/abhishek-tiwari-dev</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/abhishek-tiwari-dev"/>
    <language>en</language>
    <item>
      <title>Your API Is Type-Safe Only When Postgres Agrees</title>
      <dc:creator>Abhishek tiwari</dc:creator>
      <pubDate>Wed, 23 Sep 2026 10:47:23 +0000</pubDate>
      <link>https://dev.to/abhishek-tiwari-dev/your-api-is-type-safe-only-when-postgres-agrees-1h5i</link>
      <guid>https://dev.to/abhishek-tiwari-dev/your-api-is-type-safe-only-when-postgres-agrees-1h5i</guid>
      <description>&lt;h1&gt;
  
  
  Type Safety Across the Stack: Make Postgres, Node.js, and React Agree
&lt;/h1&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;The false guarantee:&lt;/strong&gt; TypeScript interfaces describe intent, not runtime data.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Postgres as the first contract:&lt;/strong&gt; constraints, role checks, foreign keys, and migration tests.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;A typed query boundary:&lt;/strong&gt; map generated row types into narrow application DTOs without leaking table entities.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Node.js validation:&lt;/strong&gt; validate inputs once, serialize outputs, and standardize errors.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;React integration:&lt;/strong&gt; shared response types, a typed fetch wrapper, and explicit state models.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;CI enforcement:&lt;/strong&gt; type checking, migration validation, contract tests, and no-&lt;code&gt;any&lt;/code&gt; rules.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Code snippet ideas:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A &lt;code&gt;CHECK&lt;/code&gt; constraint for allowed roles&lt;/li&gt;
&lt;li&gt;A shared &lt;code&gt;UserDTO&lt;/code&gt; declared with &lt;code&gt;satisfies&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;A boundary validator returning &lt;code&gt;{ ok, data } | { ok, error }&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;A React query consuming the same DTO without &lt;code&gt;as User&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Finish with a migration checklist for one signup or authorization flow.&lt;/p&gt;

&lt;h1&gt;
  
  
  TypeScript #NodeJS #ReactJS #PostgreSQL #FullStackDevelopment
&lt;/h1&gt;

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