<?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: bzddbz</title>
    <description>The latest articles on DEV Community by bzddbz (@bzddbz).</description>
    <link>https://dev.to/bzddbz</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%2F3559382%2F7f04ee1d-ecf5-4cab-acbb-cd766e674135.png</url>
      <title>DEV Community: bzddbz</title>
      <link>https://dev.to/bzddbz</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/bzddbz"/>
    <language>en</language>
    <item>
      <title>My fun christmas project for this year</title>
      <dc:creator>bzddbz</dc:creator>
      <pubDate>Fri, 28 Nov 2025 20:37:12 +0000</pubDate>
      <link>https://dev.to/bzddbz/my-fun-christmas-project-for-this-year-3j03</link>
      <guid>https://dev.to/bzddbz/my-fun-christmas-project-for-this-year-3j03</guid>
      <description>&lt;h2&gt;
  
  
  North Pole Library – Technical Overview
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://northpolelibrary.eu" rel="noopener noreferrer"&gt;https://northpolelibrary.eu&lt;/a&gt; &lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;1. Executive Summary&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;North Pole Library is a modern, AI-powered web application that allows users to create personalized Christmas stories for children. The platform leverages a sophisticated stack of cloud services, generative AI models, and automation workflows to deliver a seamless "text-to-storybook" experience. Users provide basic details (child's name, age, theme), complete a secure payment, and receive a fully illustrated, narrated, and interactive digital storybook within minutes.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;2. Architecture &amp;amp; Technology Stack&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;The system is built on a Serverless Architecture, utilizing a decoupled frontend and an event-driven backend orchestrated by n8n.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Frontend Application&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Core Framework:&lt;/strong&gt; &lt;br&gt;
Built with React (Vite) and TypeScript, ensuring type safety and high performance.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;UI/UX:&lt;/strong&gt;&lt;br&gt;
Tailwind CSS is used for a responsive, mobile-first design system.&lt;br&gt;
Framer Motion powers complex animations, including the "magical" snow effects, page transitions, and the interactive FlipBook component that simulates reading a physical book.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;State Management&lt;/strong&gt;: React Context API handles global application state, such as multi-language support (English/Hungarian) and user session data.&lt;br&gt;
Hosting: The frontend is optimized for edge deployment (e.g., Vercel).&lt;br&gt;
Backend &amp;amp; Database (Supabase)&lt;/p&gt;

&lt;p&gt;Supabase serves as the backend-as-a-service (BaaS) layer, providing:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;PostgreSQL Database&lt;/strong&gt;: The stories table acts as the central source of truth, storing:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;User inputs (Child's name, age, theme).&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Order status (pending_payment, processing, completed).&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The structured JSON content of the generated story.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Object Storage&lt;/strong&gt;: &lt;br&gt;
A dedicated story-assets bucket stores the generated media assets (images and MP3 audio files) for long-term persistence and fast CDN delivery.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Realtime/Polling&lt;/strong&gt;: &lt;br&gt;
The frontend polls the database status to provide real-time feedback to the user in the "Waiting Room" while the AI generation is in progress.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. Core Workflows &amp;amp; Automation&lt;/strong&gt;&lt;br&gt;
The heart of the application is an event-driven automation pipeline managed by n8n. This workflow orchestrates the complex interaction between payments, AI generation, and database updates.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;A. Payment &amp;amp; Initiation Flow&lt;/em&gt;&lt;br&gt;
User Input: The user submits the story details via the &lt;br&gt;
CreateStoryFlow&lt;br&gt;
 component.&lt;br&gt;
Draft Creation: A record is created in Supabase with a pending_payment status.&lt;br&gt;
Stripe Integration: The user is redirected to a Stripe Checkout session. The Story ID is passed as a client_reference_id to ensure the payment is inextricably linked to the specific story request.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;B. The "Magic" Generation Pipeline (n8n)&lt;/em&gt;&lt;br&gt;
Upon successful payment, Stripe triggers a webhook that starts the n8n workflow:&lt;/p&gt;

&lt;p&gt;Data Retrieval: The workflow fetches the pending story details from Supabase using the ID from the payment event.&lt;br&gt;
AI Text Generation (LLM):&lt;br&gt;
The system prompts a Large Language Model (e.g., Google Gemini or OpenAI) to write a multi-page creative story based on the child's age, name, and chosen theme.&lt;br&gt;
The output is structured as a JSON object containing text for each page and prompts for illustrations.&lt;/p&gt;

&lt;p&gt;AI Image Generation:&lt;br&gt;
The workflow iterates through the page prompts and calls an AI image generation service (e.g., Pollinations.ai) to create consistent, style-matched illustrations for every page.&lt;br&gt;
Text-to-Speech (TTS) Generation:&lt;br&gt;
Simultaneously, the text for each page is sent to a TTS engine (e.g., OpenAI Audio API) to generate high-quality voice narration.&lt;/p&gt;

&lt;p&gt;Asset Management:&lt;br&gt;
All generated images and audio files are uploaded to Supabase Storage.&lt;br&gt;
Public URLs for these assets are generated and injected back into the story's JSON structure.&lt;/p&gt;

&lt;p&gt;Finalization:&lt;br&gt;
The fully assembled story object is updated in the Supabase database.&lt;br&gt;
The status is set to completed.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;C. Delivery&lt;/em&gt;&lt;br&gt;
Email Notification: The n8n workflow sends a localized HTML email (English or Hungarian) to the user, containing a direct link to their personalized story.&lt;br&gt;
Frontend Update: The user's waiting screen detects the completed status and automatically opens the interactive FlipBook.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4. Key Features Summary&lt;/strong&gt;&lt;br&gt;
Full Automation: Zero manual intervention required from payment to delivery.&lt;br&gt;
Multi-Modal AI: Combines text, image, and audio generation into a cohesive product.&lt;br&gt;
Localization: Built-in support for multiple languages in both the UI and the generated content.&lt;/p&gt;

&lt;p&gt;Scalability: The use of serverless functions (Supabase) and async workflows (n8n) allows the system to handle high traffic volumes during peak holiday seasons without infrastructure management.&lt;/p&gt;

&lt;p&gt;Demo:&lt;br&gt;
&lt;a href="https://www.youtube.com/watch?v=NDbKKT3fqOI" rel="noopener noreferrer"&gt;https://www.youtube.com/watch?v=NDbKKT3fqOI&lt;/a&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>sideprojects</category>
      <category>automation</category>
      <category>webdev</category>
    </item>
  </channel>
</rss>
