<?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: Houss</title>
    <description>The latest articles on DEV Community by Houss (@houssjd).</description>
    <link>https://dev.to/houssjd</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%2F4216091%2F0b498523-37a7-4fa2-817d-c59eeff92951.png</url>
      <title>DEV Community: Houss</title>
      <link>https://dev.to/houssjd</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/houssjd"/>
    <language>en</language>
    <item>
      <title>Building a shared baby with Next.js and NestJS</title>
      <dc:creator>Houss</dc:creator>
      <pubDate>Thu, 29 Oct 2026 21:38:43 +0000</pubDate>
      <link>https://dev.to/houssjd/building-a-shared-baby-with-nextjs-and-nestjs-4jdb</link>
      <guid>https://dev.to/houssjd/building-a-shared-baby-with-nextjs-and-nestjs-4jdb</guid>
      <description>&lt;p&gt;I built Grow The Baby, a small web experiment with one baby shared by everyone. Visitors can pay €1 to add or remove one day of his age. He moves through different life stages, and the story ends at 100 years. There are two contribution leaderboards and a shared name that visitors can buy the right to change.&lt;/p&gt;

&lt;p&gt;The interesting engineering problem was keeping a collective game consistent while payments and visitors arrive independently.&lt;/p&gt;

&lt;p&gt;I kept the application in two parts: a Next.js frontend and a NestJS API, with MySQL and TypeORM. One database record holds the baby's age, name and current naming price. The browser displays that state; it doesn't decide whether a paid action succeeded. The character uses SVG and CSS animations rather than a game engine.&lt;/p&gt;

&lt;p&gt;For payments, the API first stores a pending purchase and creates a Stripe Checkout session. Returning to the success URL does not change the game. The change happens only when the API receives a signed checkout completion event with a paid status. It also checks the session ID, amount, currency and payment mode against the stored purchase.&lt;/p&gt;

&lt;p&gt;Retries need their own handling. Checkout creation uses an idempotency key. The webhook locks the purchase record inside a database transaction and checks whether it has already been completed. Updating the game and recording completion happen together, so a repeated event doesn't add the same days twice. The shared game record is locked during updates too.&lt;/p&gt;

&lt;p&gt;After a committed change, the API sends the updated state through Server-Sent Events. This fits the current single-process deployment: visitors receive updates without polling, and there is no separate message broker.&lt;/p&gt;

&lt;p&gt;The site is live at &lt;a href="https://growthebaby.com" rel="noopener noreferrer"&gt;https://growthebaby.com&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;I'd appreciate feedback on one specific UX question: before opening the contribution form, is it clear that your action changes the same baby for every visitor?&lt;/p&gt;

</description>
      <category>showdev</category>
      <category>webdev</category>
    </item>
  </channel>
</rss>
