<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Thomas Collardeau on Medium]]></title>
        <description><![CDATA[Stories by Thomas Collardeau on Medium]]></description>
        <link>https://medium.com/@collardeau?source=rss-ac1c764a559e------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*zRTFfpy6zf7oru4Q.jpeg</url>
            <title>Stories by Thomas Collardeau on Medium</title>
            <link>https://medium.com/@collardeau?source=rss-ac1c764a559e------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 18 Nov 2026 12:46:52 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@collardeau/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Building Leverage: How AI Changed the Economics of My Side Projects]]></title>
            <link>https://medium.com/@collardeau/building-leverage-how-ai-changed-the-economics-of-my-side-projects-24b4c656349c?source=rss-ac1c764a559e------2</link>
            <guid isPermaLink="false">https://medium.com/p/24b4c656349c</guid>
            <category><![CDATA[productivity]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[side-project]]></category>
            <category><![CDATA[ai]]></category>
            <dc:creator><![CDATA[Thomas Collardeau]]></dc:creator>
            <pubDate>Fri, 30 Jan 2026 15:09:20 GMT</pubDate>
            <atom:updated>2026-01-30T15:09:20.369Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LLu8MFrhTW-CKOCCgWq30g.png" /><figcaption>From burnout to leverage, with AI in the loop.</figcaption></figure><p>There is a specific feeling every developer knows: <strong>the weight of sunk cost</strong>.</p><p>You look at a feature you built — maybe a clunky navigation bar or a complex layout — and you know it’s wrong. It should be deleted. But you remember the friction of getting there: the late nights, the “getting lost in the code,” the struggle to keep hold of your original vision. So you leave it. You let <strong>sunk cost dictate the product</strong> because, in the <strong>old economics of development</strong>, fixing it felt too tedious and time-consuming when all you wanted was to reach a first version.</p><p>For years, this was the defining friction of my side projects. I’d build something, become emotionally and practically invested in the work already done, and then stop iterating.</p><p>This week, I launched <strong>DailyKiosk</strong>, a curated news dashboard for expats and nomads. But the real story isn’t just the app — it’s the workflow behind it. Using <strong>Antigravity</strong> (an AI-native IDE) and <strong>Gemini</strong>, I found myself working in a different economic reality: one where I could build and revise “production-grade” pieces <strong>without burning out</strong>.</p><h3>The Humbling Comparison</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PGY1lZC-6VPJAOSqp7iwCg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Nwlz7TvXVIsgMgWELmCsUQ.png" /><figcaption>NewsCycle (earlier project) vs. DailyKiosk (current build). Same goal, very different execution.</figcaption></figure><p>The earlier version of this idea — <strong>NewsCycle</strong> — is honestly humbling to look at now. It wasn’t useless. It worked for my purpose (finding English‑language news wherever I traveled). But it was heavy, page-like, and awkward. The UI looks almost comically plain — stacked blocks and default-looking controls — because <strong>most of the effort went into the plumbing</strong>, not the polish: turning a big JSON directory into navigable pages, building the filter/sort logic, and managing all the messy state that appears the moment you try to make “browse global news” feel even slightly interactive.</p><p>Behind the scenes, it was even messier. I remember losing hours dabbling in early Astro — learning a new framework, navigating configuration and routing — for benefits that weren’t even visible to the end user.</p><p>The painful truth is that it probably cost me days of effort just to land there. And once I got there, I could feel the trap: because ripping things out would be too costly, I’d get locked into the first model that “worked.” That’s how side projects stall. Refinement doesn’t fail because you don’t care — it fails because it arrives <strong>when your patience is already depleted</strong>.</p><h3>The Death of the “Saga”</h3><p>In the past, building a polished interface meant embarking on a long, grinding solo marathon. With DailyKiosk, I experienced the opposite.</p><p>The most telling example is the navigation. I initially built a sidebar with explicit continent buttons (Europe, Asia, etc.). I tested it and realized it was clutter. It added cognitive load without adding value.</p><p>Pre-AI, those buttons would have stayed. The filter logic was already nested in state management, and ripping it out would have turned into a <strong>“saga”</strong>: hours of unpicking code I’d just written, risking regressions along the way.</p><p>This time, I didn’t have to bargain with myself. I typed a prompt into Antigravity: <strong>“Remove the continent sections and replace them with a reactive search bar that filters countries instantly.”</strong></p><p>Minutes later it was done. One prompt, check the work, verify UI behavior, and move on.</p><p>Most of the effort shifted away from hand-writing logic and toward <strong>reviewing, testing, and tuning the experience</strong>: does it feel right, is it fast, do the edge cases hold, does the UI behave the way a human expects? The decision stayed clean because I wasn’t attached to the code — I was attached to the outcome.</p><p>DailyKiosk feels like a solid side project precisely because it reflects decisions I couldn’t afford to fully express before. The filters are a good example: dynamic show/hide logic, reactive counts, an interface that feels <strong>“alive.”</strong> Previously I would have skipped those details because they were too tedious to implement and maintain. Now the tool matches my taste because <strong>the gap between taste and execution is smaller</strong>.</p><h3>The “Vanilla” Paradox (And the Hard Stuff)</h3><p>Here’s the irony: powerful AI collaborators didn’t push me toward heavy frameworks like Next.js or React. They pushed me backward, toward the simplicity of <strong>Vanilla JS</strong>.</p><p>Because the AI has such a strong grasp of fundamentals, without getting tangled in the shifting versions of React or Svelte, I could afford to build a small, custom “micro-framework” tailored exactly to what DailyKiosk needed. That let me implement a hybrid routing architecture that normally nudges people into heavier stacks:</p><ul><li><strong>Static Site Generation (SSG):</strong> a custom build script pre-renders static HTML for every country (e.g. /italy/), injecting per-page &lt;title&gt; and &lt;meta&gt; tags for SEO and link previews.</li><li><strong>Client-side navigation (SPA feel):</strong> once loaded, the site behaves like a snappy SPA, using the <strong>History API</strong> so navigation and filtering feel instant without full reloads.</li></ul><p>In the past, this kind of dual-mode architecture — static for bots, dynamic for humans — would have been a project in itself. I would have either reached for a heavier framework or accepted weaker SEO. This time, I could describe the architecture I wanted, and the AI wrote the glue code.</p><h3>Closing the Gap Between Taste and Execution</h3><p>This project helped me articulate something important: AI doesn’t make my judgment irrelevant. <strong>It makes it central.</strong></p><p>When implementation is the bottleneck, your product gets defined by what you can build <strong>before fatigue, complexity, and context loss take over.</strong> When implementation becomes cheap, the job becomes deciding <strong>what matters</strong>, <strong>what to cut</strong>, what metaphor the product is built around, and <strong>when it’s good enough to ship</strong>.</p><p>This workflow also isn’t passive generation. I still do “deep clean” passes: stripping dead code, normalizing styles, auditing state logic, and re-testing the edges. AI is powerful for building — but it’s just as valuable for what I loosely call <strong>“vibe maintenance”</strong>: the cleanup work that keeps fast iteration from turning into technical debt. (If there’s interest, I’ll write a follow-up on that.)</p><h3>Building Leverage</h3><p>I built DailyKiosk in about <strong>six to eight focused sessions</strong> spread over a month. No twelve-hour days — and crucially, no “losing the thread,” that familiar trap where one technical hurdle triggers a chain reaction of syntax fixes and CSS weirdness until you forget what you wanted to build in the first place.</p><p>That’s what I mean by <strong>building leverage</strong>. I’m not just building tools. I’m building the ability to move through time with <strong>less forgetfulness</strong>, <strong>less rework</strong>, and <strong>less self-induced chaos</strong>.</p><p>I don’t want to romanticize it. Momentum fades. Motivation is fickle. But I can’t ignore what’s changed: I’m working in a medium where decisions stay reversible long enough to become correct — and where shipping <strong>elegant</strong> side projects doesn’t break the rhythm of <strong>my</strong> life.</p><p><em>You can check out the project here: </em><a href="https://dailykiosk.news/"><strong><em>https://dailykiosk.news</em></strong></a><em> — a simple, fast, privacy-focused way to browse English-language and local news across 70+ countries.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=24b4c656349c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Building My Digital Twin: The Making of a Portfolio Chatbot]]></title>
            <link>https://medium.com/@collardeau/building-my-digital-twin-the-making-of-a-portfolio-chatbot-3e7378993ea7?source=rss-ac1c764a559e------2</link>
            <guid isPermaLink="false">https://medium.com/p/3e7378993ea7</guid>
            <category><![CDATA[llm]]></category>
            <category><![CDATA[chatbots]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[langchain]]></category>
            <dc:creator><![CDATA[Thomas Collardeau]]></dc:creator>
            <pubDate>Tue, 08 Jul 2025 12:10:23 GMT</pubDate>
            <atom:updated>2025-07-08T12:10:23.842Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VaaBXU3fkGb3CUsUcGukgg.png" /><figcaption>The Digital Twin, visualized — where code and context become conversation.</figcaption></figure><p>A portfolio is a snapshot in time. It shows <em>what</em> you’ve built, but it struggles to convey the <em>why</em> — the strategic decisions, the technical trade-offs, and the lessons learned along the way. I wanted to create a more dynamic, living portfolio, one that could tell its own story.</p><p>My solution was to build a “Digital Twin”: a conversational AI trained on my own curated knowledge base (auto-generated from my ProBrain workflow, more on that in a later post). The goal was to create a professional, public-facing version of myself that could articulate my experience, allowing anyone — a recruiter, a potential collaborator, or a curious developer — to simply _ask_ about my work and projects.</p><p>As I built it, I discovered an unexpected but powerful side effect: it became the ultimate interview preparation tool. Querying the bot forces me to practice my own project narratives, ensuring they align with the documented source of truth and instantly highlighting any gaps in my storytelling.</p><p>This post is a technical walkthrough of how I built the Portfolio Chatbot, aimed at any developer or aspiring AI engineer looking for practical ideas on building and deploying a sophisticated RAG application. You can chat with the final version here: <a href="https://tonton.dev/chat">tonton.dev/chat</a>.</p><h4>Step 1: The Foundational Stack and a Local Prototype</h4><p>Every project starts with a foundation. My goal was to create a chatbot that could answer questions based on a collection of my personal markdown notes and project summaries. This is a classic use case for <strong>Retrieval-Augmented Generation (RAG)</strong>.</p><p>The initial plan was to build a simple, local-first prototype to validate the core idea. The stack was straightforward:</p><ul><li><strong>Backend:</strong> Python with FastAPI to create the API.</li><li><strong>AI Orchestration:</strong> LangChain to structure the RAG pipeline.</li><li><strong>Vector Store:</strong> ChromaDB, running in-memory as an embedded database.</li></ul><p>The workflow was simple: load my markdown files, split them into chunks, create vector embeddings, and store them in Chroma. This setup was fantastic for rapid prototyping. Within a short time (with the help of an AI coding assistant), I had a working script that could answer basic questions from my terminal.</p><p><strong>Step 2: The First Hurdle and a Key Insight for Quality</strong></p><p>The prototype worked, but as I tested it with more complex questions, I ran into the classic RAG dilemma. The prevailing wisdom is to split documents into small, specific chunks. This is because large blocks of text create “noisy” or “averaged” vectors that are poor for precise semantic search; smaller chunks, by contrast, capture a more concentrated and accurate semantic meaning, which is ideal for the <em>retrieval</em> step.</p><p>However, this approach creates a new problem for the <em>generation</em> step. While the retriever could now find the perfect, specific chunks, the LLM was only fed that isolated snippet. The result? The bot’s answers felt fragmented, factually correct but lacking the narrative cohesion needed to tell a full story.</p><p><strong>The Problem:</strong> Standard RAG splits documents into small, isolated chunks. When I asked, “What is your experience with Python?”, the retriever might pull several relevant chunks from different projects. However, because these chunks are isolated from their original narrative, the LLM receives a set of disconnected facts, making it difficult to synthesize a cohesive story. The answers were snippets, not stories.</p><p><strong>The Solution:</strong> To create a true storyteller, the LLM needed the full story. I redesigned the RAG chain to use LangChain’s `ParentDocumentRetriever`. This was the first major “aha!” moment of the project. It works with a clever, two-step logic:</p><ol><li>First, it performs a search over small, specific child chunks to find the most relevant information with high precision.</li><li>Then, instead of returning those small chunks, it retrieves the <strong>entire parent document</strong> they belong to.</li></ol><p>This change was transformative. By providing the full document as context, the LLM could now synthesize comprehensive, nuanced answers that captured the complete narrative of a project. This moved the application from a simple Q&amp;A bot to a genuinely conversational agent.</p><p>This approach is made practical by the massive context windows of modern models like Google’s Gemini 2.5 family. With the ability to handle up to a million tokens, the focus can shift from token-pinching to providing the highest quality, most complete context possible to elicit the best possible answer.</p><h4>Step 3: From Prototype to Production-Ready Architecture</h4><p>With the core logic vastly improved, it was time to deploy. I chose Railway as my hosting platform, and this is where the realities of a production environment exposed the limitations of my prototype’s architecture.</p><p><strong>The Problem:</strong> The embedded ChromaDB, so convenient for local development, loaded the entire knowledge base (although quite modest) into the application’s memory. On Railway, this resulted in high, persistent RAM usage. This wasn’t just a cost issue; it was a sign of an inefficient and tightly-coupled design.</p><p><strong>The Architectural Solution: </strong>I needed to refactor the application to be more robust and scalable, following a pattern common in professional software development.</p><ol><li><strong>Decouple Data Ingestion:</strong> I split the logic into two parts. The main `chatbot.py` script would now be a stateless API that simply handles user queries. A new, separate `ingest.py` script was created to handle the one-time task of processing my markdown files and loading them into the vector database. This separation of concerns is critical for a maintainable system.</li><li><strong>Move to a Managed Vector Store: </strong>I replaced the in-memory ChromaDB with <strong>Zilliz Cloud</strong>. As a managed, cloud-native vector database, it exists independently of my application. This instantly solved the memory problem, as my app now only needs to make a lightweight connection to Zilliz, not hold the entire database itself. Zilliz’s generous free tier made it the perfect choice for a portfolio project.</li></ol><p>This pivot from an all-in-one script to a decoupled, multi-component system was the most important step in turning a prototype into a professional-grade application.</p><h4>The Final Technical Blueprint</h4><p>After several iterations and refinements, the final architecture represents a modern, robust stack for building and deploying conversational AI:</p><ul><li><strong>Orchestration:</strong> <strong>LangChain</strong> is the backbone, structuring the history-aware retrieval and question-answering chains.</li><li><strong>Vector Store:</strong> <strong>Zilliz Cloud</strong> serves as the scalable, managed database for the knowledge base.</li><li><strong>Deployment:</strong> <strong>Railway</strong> hosts the stateless FastAPI application, providing a seamless Git-based deployment workflow.</li><li><strong>Observability</strong>: <strong>LangSmith</strong> was absolutely crucial. It gave me the visibility to diagnose the initial RAG issues, inspect the exact context being passed to the LLM, and truly understand my chain’s behavior.</li><li><strong>LLM:</strong> <strong>Gemini 2.5 Flash</strong> provides the reasoning power, accessed via OpenRouter for flexibility.</li></ul><h4>Conclusion</h4><p>Building this Digital Twin was a journey through the entire lifecycle of an AI application — from a local proof-of-concept to a deployed, architecturally sound product. The process reinforced three key lessons:</p><ol><li><strong>Context is King</strong>: For high-quality, narrative answers in a RAG system, providing full context via strategies like the `ParentDocumentRetriever` is far superior to using isolated chunks.</li><li><strong>A Prototype’s Architecture Must Evolve for Production:</strong> Decoupling the data ingestion pipeline and moving to a managed service wasn’t just a fix for high memory usage; it was a necessary architectural evolution for a scalable and maintainable system.</li><li><strong>You Can’t Fix What You Can’t See:</strong> Observability tools like LangSmith aren’t a luxury; they are essential for debugging the complex, often opaque behavior of LLM chains.</li></ol><p>This project was more than just a technical exercise; it was an exploration into how we can present our professional selves in more dynamic and engaging ways. I invite you to go have a conversation with my digital twin at <a href="https://tonton.dev/chat">https://tonton.dev/chat</a> and test it out for yourself.</p><p>Building this was a rewarding experience, and I’d love to hear your thoughts on it. Feel free to reach out with questions or comments. You can also find me on <a href="https://www.linkedin.com/in/collardeau"><strong>LinkedIn</strong></a>, <a href="https://github.com/collardeau"><strong>GitHub</strong></a>, and <a href="https://x.com/collardeau"><strong>X</strong></a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3e7378993ea7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How I Directed an AI to Animate a Classic: The Making of ‘The Shipwreck’]]></title>
            <link>https://medium.com/@collardeau/how-i-directed-an-ai-to-animate-a-classic-the-making-of-the-shipwreck-739792945ffd?source=rss-ac1c764a559e------2</link>
            <guid isPermaLink="false">https://medium.com/p/739792945ffd</guid>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[prompt-engineering]]></category>
            <category><![CDATA[storytelling]]></category>
            <category><![CDATA[generative-ai-tools]]></category>
            <dc:creator><![CDATA[Thomas Collardeau]]></dc:creator>
            <pubDate>Thu, 19 Jun 2025 13:59:52 GMT</pubDate>
            <atom:updated>2025-06-19T13:59:52.993Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*g2COIHhJG1BlrKksrMUH6g.png" /><figcaption>The director’s vision, executed by an AI hand.</figcaption></figure><p>The idea was simple: create an “illustrated listening experience” for classic literature. I wanted to pair unabridged narration with a continuous stream of visuals that included key excerpts from the text itself. The format had to be more immersive than a static audiobook but more focused on the original words than a full film adaptation. My first project: the opening chapter of Jonathan Swift’s <em>Gulliver’s Travels</em>.</p><p>What began as a straightforward production, however, quickly became a fascinating exercise in creative direction. The core challenge wasn’t just generating images, but ensuring a cohesive narrative across dozens of them. I had to become a director, and the generative model needed a system to guide its performance. This is the story of how I built that system to create “The Shipwreck,” the pilot episode of my HenceStories series.</p><h3>The Challenge: From Inconsistent Images to a Cohesive Vision</h3><p>My initial tests with stateless AI image generators were promising but flawed. A character’s appearance would shift from one scene to the next, or the AI would invent a coastline on the horizon, even when the narrative explicitly placed the ship in the middle of the open ocean. The AI had no memory, no sense of narrative continuity.</p><p>To overcome this, I realized I needed to move beyond one-off prompts and build a production pipeline. I had to design a system that would provide the AI with consistent, evolving context, much like a film director provides a script and shot list to their crew.</p><p><strong>Building the “Digital Director”: An n8n Production Pipeline</strong></p><p>I used the automation platform <strong>n8n</strong> to build a two-stage LLM chain that would act as my production department. This system transforms raw novel text into precise, context-aware instructions for the image generator.</p><p><strong>Stage 1: The “Digital Director” LLM</strong></p><p>The first LLM’s job is to act as a director. It processes a passage of the novel and breaks it down into a structured shot list. To ensure consistency, it generates and then references a `master_blueprint` — a JSON object containing canonical descriptions for all recurring characters and elements</p><p>Here’s a look at the `master_blueprint` for the shipwreck scene of <em>Gulliver’s Travels</em>:</p><p>```json<br>{<br> “master_blueprint”: {<br> “english_surgeon”: {<br> “name”: “Lemuel Gulliver”,<br> “description”: “A man in his late 30s… wears the attire of an English surgeon of the period: a knee-length, dark wool frock coat, a simple linen waistcoat… His hair is his own, tied back in a simple queue.”<br> },<br> “merchant_ship”: {<br> “name”: “The Antelope”,<br> “description”: “A three-masted, square-rigged English merchant ship… Its hull is tarred black below the waterline and natural wood above…”<br> }<br> }<br>}<br>```</p><p>The Digital Director takes this blueprint, analyzes the text, and outputs a detailed JSON object for each individual shot. This becomes the definitive plan for the image generator.</p><p>```json<br>{<br> “shot_number”: 1,<br> “relevant_entities”: [ “merchant_ship”, “english_surgeon”, “english_sailors” ],<br> “narration_text”: “We set sail from Bristol, May 4, 1699, and our voyage was at first very prosperous.”,<br> “on_screen_text”: “Our voyage was at first very prosperous.”,<br> “creative_direction”: “A wide, scenic view of the merchant ship sailing on a calm, sunlit sea. Gulliver stands on the quarterdeck looking towards the horizon with a hopeful expression…”,<br> “environment_update”: {<br> “location”: “English Channel”,<br> “weather”: “Clear skies, calm sea, bright sunlight”,<br> “atmosphere”: “Hopeful and prosperous”<br> }<br>}<br>```</p><p><strong>Stage 2: The “Prompt Assembler” LLM</strong></p><p>The second LLM takes this structured `shot` object and synthesizes it into the final, ready-to-use prompt for the image generator — in this case, OpenAI’s `gpt-image-1` (which I access via Sora). It intelligently combines the relevant `master_blueprint` descriptions with the specific `creative_direction` for that scene.</p><p>A key part of the vision was leveraging this model’s particular strength: rendering text directly and reliably within the illustrations. The `on_screen_text` from the shot plan is seamlessly embedded into the final image, creating the unique “illustrated listening” aesthetic I was aiming for.</p><h3>The Art of the Prompt: Lessons from the Cutting Room Floor</h3><p>With a solid draft assembled by the pipeline, I moved into final polish. This phase evolved into a shot-by-shot refinement where I learned some crucial lessons in AI direction.</p><p>The iterative process led me to formalize a few core directorial principles:</p><p>1. <strong>Describe, Don’t Name:</strong> Consistently describing a character’s physical attributes (“a lean, dark-haired surgeon”) instead of using their name (“Gulliver”) prevents the AI from defaulting to its pre-conceived imagery — for instance, incorrectly adding Lilliputians to a scene on the ship simply because it associates them so strongly with the famous name.<br>2. <strong>Avoid Loaded Keywords:</strong> Using a term like “shipwrecked man” was cueing the AI to incorrectly add a phantom ship in the background of scenes where it was no longer narratively present. The new rule: don’t use words for things that aren’t meant to be visually present.<br>3. <strong>Don’t Describe the Invisible:</strong> My automated “Prompt Assembler” pulls character details from the `master_blueprint`, but I quickly learned it needed to be context-aware. For a scene where the character is swimming, having the assembler include his full outfit description would confuse the AI, often resulting in an unnatural full-body shot. The system had to be taught to only include details relevant to the frame.</p><h3>Bringing the Story to Life with Audio</h3><p>With the visuals planned, the final piece was the narration. I used <strong>MiniMax</strong> to generate the voice-over, feeding it the unabridged `narration_text` for each shot from my plan. Its ability to produce clean, well-paced narration was crucial for completing the “listening” component of the experience.</p><h3>Conclusion: Directing the Machine</h3><p>This project was a profound lesson in the new creative paradigm. At this stage of the technology’s evolution, creating compelling and consistent work with AI requires more than just a clever prompt. It demands that we build systems — a director’s playbook, like the `master_blueprint` — to enforce consistency and guide the output. By designing a structured process and learning to direct the tools with precision, we can move from simple, one-off image generation to genuine, automated storytelling.</p><p>You can watch the final pilot episode, “The Shipwreck,” at:</p><p><a href="https://www.youtube.com/watch?v=EHCwgQaHJOw">https://www.youtube.com/watch?v=EHCwgQaHJOw</a></p><p>What do you think of this approach to AI-driven storytelling? I’m curious to hear your thoughts on this process and the potential for directing AI in creative work. I’d love to read your feedback in the comments.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=739792945ffd" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[From Framework Frustration to HTML Success: Rebuilding My Portfolio with AI and a ‘Back-to-Basics’…]]></title>
            <link>https://medium.com/@collardeau/from-framework-frustration-to-html-success-rebuilding-my-portfolio-with-ai-and-a-back-to-basics-44b510fae5e3?source=rss-ac1c764a559e------2</link>
            <guid isPermaLink="false">https://medium.com/p/44b510fae5e3</guid>
            <category><![CDATA[html5-development]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[vibe-coding]]></category>
            <category><![CDATA[ai]]></category>
            <dc:creator><![CDATA[Thomas Collardeau]]></dc:creator>
            <pubDate>Sun, 08 Jun 2025 12:54:39 GMT</pubDate>
            <atom:updated>2025-06-08T12:54:39.174Z</atom:updated>
            <content:encoded><![CDATA[<h3>From Framework Frustration to HTML Success: Rebuilding My Portfolio with AI and a ‘Back-to-Basics’ Vibe</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tb6SVFyiAzoYEUP0YlO1bw.png" /><figcaption>What if the most modern tool helps us return to the simplest principles?</figcaption></figure><h3>The Itch to Modernize: When Your Portfolio Feels Like a Relic</h3><p>Every so often, that digital calling card — our personal portfolio website — starts to feel less like a showcase and more like a dusty relic. Mine had certainly reached that point. Built years ago with Svelte 3, it wasn’t just the projects that felt dated; the underlying technology was becoming a significant impediment.</p><p>To even get the old site running locally required a specific, ancient version of Node.js (v10, to be precise). Newer Node versions would throw a cascade of node-gyp errors or framework-specific compiler issues. Even when I managed to coax it to life with Node v10 – itself long past its End-of-Life on platforms like Netlify where the site was hosted – I&#39;d encounter bizarre local server errors. The prospect of updating content was met with a growing apprehension, not about the fix itself, but about wrestling the outdated development environment. This highlighted a critical lesson: the complex ecosystems around some frameworks, however beneficial initially, can become significant long-term maintenance burdens.</p><h3>A Radical Rethink: Trading Build Steps for Simplicity</h3><p>My initial thought wasn’t to completely abandon modern JavaScript practices, but rather to drastically simplify the tooling. The core challenge was the heavy reliance on intricate build steps and the architectural overhead of Svelte for a site that was, in essence, mostly static. For a personal portfolio, did I really need that level of complexity that requires upkeep? What if I could achieve the same clean look and feel, but with just HTML, CSS, and a minimal sprinkle of JavaScript, thereby sidestepping the complex build environment altogether? And, more intriguingly, what if an AI could help me get there efficiently?</p><h3>Meet Cline: My AI Coding Sidekick</h3><p>This is where “Cline” came into the picture. Cline is a VS Code extension I’ve been using, which I’ve configured to leverage powerful Large Language Models. For this project, I set it up with my Anthropic API key to use the Claude 4 Sonnet model. My goal was to see how an AI could act not just as a code generator, but as a true collaborator in the development process, especially for this “back-to-basics” approach.</p><h3>“Vibe Coding”: The AI-Assisted Rebuild in Action</h3><p>Armed with screenshots of my old site and its existing data.js file, I tasked Cline with laying down the initial HTML and CSS structure. The results were immediately promising. Cline largely nailed the look and feel of the old site in one shot, using just plain HTML and CSS.</p><p>The collaboration didn’t stop there. This became an iterative process, akin to what some in the industry call “vibe coding” — where you guide the AI towards the desired outcome with higher-level instructions.</p><ul><li>Need a reusable header and footer to avoid redundancy? Cline effortlessly drafted a layout-component.js using standard Web Components. It&#39;s remarkable how adept modern LLMs are at generating these self-contained, reusable pieces of UI without needing any framework-specific syntax.</li><li>CSS getting a bit repetitive? Cline assisted in implementing global CSS custom properties, significantly cleaning things up, and making it easier to change the design later.</li><li>Needed to ensure new content sections integrated visually? Cline helped refine the CSS styling with instructions like “reduce the amount of whitespace.”</li></ul><p>It was less about dictating precise lines of code and more about defining the intent and letting the AI handle much of the boilerplate and structural implementation.</p><h3>Under the Hood: Key Decisions for a Leaner Site</h3><p>Beyond AI assistance, several core decisions helped streamline the site:</p><ul><li><strong>Hardcoded Content, AI-Assisted:</strong> One of the most significant simplifications was moving away from dynamically loading project details or blog posts via JavaScript. Instead, I opted to embed the data directly into the HTML pages. Migrating this data from the old JS structures into the new HTML was a breeze using Cline/Claude 4; a few well-crafted prompts and the AI handled the transformation. For a site of this modest scale, this approach is more straightforward, undeniably better for SEO, and even allowed me to remove the main script.js file entirely.</li><li><strong>Minimal JavaScript:</strong> With content embedded, JavaScript’s role was reduced to “sprinkles” for minor interactive elements within the HTML and the layout component itself, such as creating a slideshow.</li><li><strong>Focused Content Update:</strong> While the technical rebuild was the main story, the content itself was, of course, updated to accurately reflect my current skills and recent AI and automation projects. The new, simpler structure made these edits far less daunting.</li></ul><h3>Effortless Deployment &amp; Tangible Benefits</h3><p>The shift to a static site had an immediate payoff during deployment. I logged into Netlify, updated the linked repository to the new one, cleared the “Build command” field (as no build step was needed), and confirmed the “Publish directory.” The new site was live in moments.</p><p>The benefits are clear and compelling:</p><ul><li><strong>True Maintainability:</strong> Updates are now trivial. Editing HTML directly (often with a quick AI assist for bigger changes, continuing the “vibe coding” approach) is a breeze, and I no longer have to worry about firing up a specific Node version or navigating a tangled mess of npm dependencies just to make a change.</li><li><strong>Simplicity &amp; Clarity:</strong> The codebase is lean and easy to understand. No complex build processes or framework-specific knowledge required to jump back in.</li><li><strong>Performance:</strong> Static sites are inherently fast.</li></ul><h3>Final Thoughts: The Power of Simplicity and AI Collaboration</h3><p>This project has been a fascinating exploration. If an AI is increasingly capable of generating and refactoring code directly, it begs the question: for a surprising range of web projects, especially those where a static or near-static output is desirable, why entangle ourselves in complex tools and frameworks primarily designed to make <em>human</em> coding easier or more scalable? If the AI can handle the “code complexity” and produce clean, fundamental HTML, CSS, and JS, then perhaps the simplicity of that underlying code matters more than the sophistication of the tools used to generate it. The “developer experience” shifts from wrangling frameworks to effectively prompting and guiding an AI that can use the best tools to minimize maintenance and optimize user experience.</p><p>There’s a real power and elegance in going back to the fundamentals, especially when augmented by AI collaborators. The result is a portfolio that is a genuine pleasure to maintain — a truly modern foundation built on time-tested principles.</p><p>Curious to see the result of this “back-to-basics,” AI-assisted approach? You can check out the live portfolio:</p><p><a href="https://tonton.dev/">tonton.dev</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=44b510fae5e3" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Building BiasDetector: My Journey into AI Text Analysis with n8n and LLMs]]></title>
            <link>https://medium.com/@collardeau/building-biasdetector-my-journey-into-ai-text-analysis-with-n8n-and-llms-fbc311b8534c?source=rss-ac1c764a559e------2</link>
            <guid isPermaLink="false">https://medium.com/p/fbc311b8534c</guid>
            <category><![CDATA[llm]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[automation]]></category>
            <category><![CDATA[n8n]]></category>
            <category><![CDATA[text-analysis]]></category>
            <dc:creator><![CDATA[Thomas Collardeau]]></dc:creator>
            <pubDate>Tue, 27 May 2025 10:08:50 GMT</pubDate>
            <atom:updated>2025-05-27T10:08:50.085Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cb8NBamrcVVjN8MHI5qTxw.png" /><figcaption>Tech meets text: AI analyzes bias in the written word.</figcaption></figure><p>The way text frames information can profoundly shape our understanding of events and ideas. As AI and Large Language Models (LLMs) become more prevalent, exploring how these tools can help us identify and understand linguistic nuances presents a fascinating challenge. This curiosity, combined with a passion for automation, led me to create <strong>BiasDetector</strong> — a project focused on using AI to analyze text for potential bias. This post shares the journey, technical approach, and lessons learned while building this tool using n8n and LLMs.</p><h3>The Core Challenge: Focusing AI on Language, Not Just Entities</h3><p>My interest in this area stemmed from exploring how LLMs could move beyond simple text generation or summarization to tackle more subtle analytical tasks. Early on, a key challenge emerged: LLMs possess vast knowledge from their training data. When analyzing text mentioning specific politicians or organizations, their pre-existing associations with these entities can inadvertently influence or distract from assessing linguistic bias.</p><p>This challenge led to BiasDetector’s central architectural decision: a multi-stage LLM chain designed to isolate and analyze linguistic patterns. The core concept involves a sequential process:</p><ol><li><strong>Redactor LLM</strong>: “Neutralizes” the text by identifying specific entities — people, organizations, locations — and replacing them with generic placeholders. For example, “John Smith visited London” becomes “[PERSON_1] visited [CITY_1]”. This helps focus subsequent analysis while standardizing varied entity references for more consistent outcomes.</li><li><strong>Bias Analyzer LLM</strong>: Scrutinizes the anonymized text. Freed from specific entity knowledge, it can better focus on the language itself — phrasing, sentiment, and structure — to identify and analyze bias patterns.</li><li><strong>Descrambler LLM</strong>: Takes the placeholder-based analysis and original entity mappings (the “legend”) to intelligently reconstruct a fully human-readable report.</li></ol><p>This chained approach enables more targeted and reliable analysis of how text frames its subject matter, providing greater consistency in outputs.</p><h3>Orchestrating with n8n: From Web Form to Emailed Report</h3><p>n8n served as the engine for this entire operation, providing the perfect platform to connect sequential LLM calls and manage data flow.</p><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/0*vQLuGwjUy9W3zCtN.png" /><figcaption><em>The BiasDetector n8n workflow: chaining LLMs for nuanced text analysis.</em></figcaption></figure><h3>User Input via JotForm</h3><p>For the public demo, I created a simple JotForm (try it here: <a href="https://form.jotform.com/251364670893061">https://form.jotform.com/251364670893061</a>). Users can paste text (up to 4,000 characters for the demo) and provide an email address. I focused on clear instructions and mandatory fields to ensure a smooth user experience.</p><h3>The n8n Workflow in Action</h3><p>The workflow follows a clean sequence:</p><ol><li><strong>Form Submission</strong>: JotForm submission triggers the n8n workflow</li><li><strong>Redaction</strong>: Text goes to the Redactor LLM node, which returns anonymized text and a “legend” mapping placeholders back to original terms</li><li><strong>Analysis</strong>: Anonymized text passes to the Bias Analysis LLM node, prompted to identify bias patterns and output structured, four-part analysis in JSON format using placeholders</li><li><strong>Descrambling</strong>: The Bias Analyzer output and legend go to the Descrambler LLM node, which weaves original entity names back into the analysis</li><li><strong>Email Delivery</strong>: n8n’s data transformation assembles all components into an HTML email sent via Gmail</li></ol><p>n8n’s visual interface, robust LLM integration nodes, and data handling features made managing this sequence and iterating on the logic incredibly efficient.</p><h3>What BiasDetector Delivers</h3><p>Users receive a detailed email report offering a multi-faceted look at their submitted text:</p><ul><li><strong>Original text</strong></li><li><strong>Clear explanation</strong> of the anonymization step (showing anonymized text snippet and sample legend)</li><li><strong>Comprehensive four-part bias analysis</strong> with original terms restored:</li><li>Bias Analysis Summary</li><li>Full Bias Report</li><li>Potential Impact of Bias</li><li>Alternative Framing Strategies</li></ul><p>This report helps users understand not just how language can convey bias, but how to discern the likely intended impact or persuasive goal of a piece of text. For example, it might highlight not just overtly critical language toward a person, but reveal patterns like consistently associating an organization with negative outcomes — even subtly — that collectively work to frame that organization unfavorably. By analyzing these linguistic patterns in isolation from our existing knowledge about the entities involved, BiasDetector can help users recognize when an article might be attempting to shift public opinion, build support for a particular viewpoint, or prime readers to view certain actors favorably or unfavorably. This makes it easier to identify the underlying persuasive intent that might not be immediately obvious when reading the text normally.</p><h3>Lessons from the Redactor: Iterating Towards Intelligent Anonymization</h3><p>A significant part of this journey involved iteratively refining the Redactor LLM’s prompt — the instructions guiding its anonymization task. This wasn’t simple find-and-replace; it was an exercise in guiding an LLM to understand nuanced requirements.</p><p>Early on, I grappled with optimal redaction levels. Too little redaction leaves the Bias Analyzer potentially influenced by prior entity knowledge. Too aggressive redaction strips away crucial contextual clues or linguistic patterns that indicate bias. Removing descriptive common nouns associated with entities, for instance, might make text too abstract for meaningful analysis.</p><p>The real challenge lay in ensuring redaction was thorough and semantically intelligent. If text mentioned “Rome” and later referred to it as “the Eternal City,” how could the system recognize these as the same entity? The goal was for the Bias Analyzer to understand that bias expressed toward “the Eternal City” was actually bias related to “Rome.”</p><p>This required the Redactor to do more than assign [CITY_1] to “Rome” — it needed to link related terms.</p><h3>The Power of LLMs for Semantic Understanding</h3><p>Through cycles of prompt testing and adjustment, I experimented with different ways to instruct the Redactor to identify not just primary entities but also their aliases, acronyms, or descriptive references. Success came through careful prompt engineering that guided the LLM to generate linked placeholders. The refined Redactor could identify “Rome” as [CITY_1] and recognize “the Eternal City” as [CITY_1_NICKNAME], with explicit linking in the placeholder nomenclature itself.</p><p><strong>This is precisely where LLMs shine for such tasks.</strong> Their inherent understanding of semantic meaning and context allows them to identify relationships — like linking a city to its well-known nickname — that would be extraordinarily complex and brittle to achieve with traditional rule-based programming, and impossibly laborious to do manually at scale. The LLM’s ability to grasp these nuances was fundamental to developing a Redactor that could intelligently prepare text for analysis.</p><p>This iterative dialogue with the Redactor LLM — defining problems with increasing precision, crafting nuanced instructions, observing outputs across diverse texts, and continually refining prompts — was where much of the project’sx§ learning occurred. It highlighted that effective AI application often lies in this detailed, persistent conversation with the model.</p><h3>The Road Ahead</h3><p>While BiasDetector’s V1 demo is now functional and represents a significant milestone, the potential for further development is substantial. Future possibilities include:</p><ul><li>Refining analytical depth</li><li>Exploring applications to different content types (government press releases, children’s literature, academic papers)</li><li>Expanding into related areas like logical fallacy detection</li></ul><p>The core architecture built with n8n provides a solid foundation for these future explorations, demonstrating how modern no-code platforms can orchestrate sophisticated AI workflows to tackle complex analytical challenges.</p><h3>Conclusion</h3><p>BiasDetector has been an incredibly rewarding project. It pushed me to combine thoughtful prompt engineering, workflow automation with n8n, and a critical approach to AI-driven text analysis. Building it involved not just connecting APIs, but truly designing an intelligent process to navigate the complexities of LLM behavior and natural language. It’s a clear demonstration of how these modern tools can be orchestrated to create applications that offer genuine insight. The journey from initial concept to a functioning, user-facing demo has been a significant and fulfilling experience in applied AI.</p><p><em>I’m always keen to discuss AI, automation, and challenging projects. Feel free to connect with me on </em><a href="https://www.linkedin.com/in/collardeau/"><em>LinkedIn</em></a><em> or </em><a href="https://x.com/collardeau">Twitter/X</a><em>. Thanks for reading!.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fbc311b8534c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Anonymity Advantage: Sharpening Your LLM’s Eye for Textual Bias]]></title>
            <link>https://medium.com/@collardeau/the-anonymity-advantage-sharpening-your-llms-eye-for-textual-bias-7f76e42c604d?source=rss-ac1c764a559e------2</link>
            <guid isPermaLink="false">https://medium.com/p/7f76e42c604d</guid>
            <category><![CDATA[automation]]></category>
            <category><![CDATA[llm]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[news-analysis]]></category>
            <category><![CDATA[bias]]></category>
            <dc:creator><![CDATA[Thomas Collardeau]]></dc:creator>
            <pubDate>Wed, 21 May 2025 10:39:49 GMT</pubDate>
            <atom:updated>2025-05-21T10:39:49.179Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*m8ubYFTQFs3uaG8xEcF38g.png" /><figcaption>Through the lens of anonymity, the LLM’s focus sharpens on textual bias.</figcaption></figure><p>Large Language Models (LLMs) offer immense potential for text analysis, but achieving optimal results, especially in sensitive areas like <strong>bias detection in news</strong>, often requires careful consideration of how input data is prepared. In this post, I’ll share a practical approach to enhancing LLM performance through <strong>strategic pre-processing techniques</strong>, focusing on how to guide the model’s attention to uncover subtle linguistic patterns that might indicate bias or narrative shaping.</p><p>My work involves using LLMs to analyze textual nuances — identifying underlying patterns in framing, language, and narrative choices. This is <strong>particularly crucial when examining news content</strong>, where the way information is presented can subtly influence perception. While LLMs possess broad knowledge, this very breadth can sometimes be a challenge. An LLM’s pre-existing information about specific entities, organizations, or events can influence its analysis, <strong>potentially diverting it from the purely textual qualities</strong> that reveal how a story is constructed and potentially skewed.</p><p><strong>The Challenge: LLM Knowledge vs. Textual Nuance in Evolving Current Events</strong></p><p>A clear example of this challenge arose when analyzing a news story pertinent to our current timeframe (May 2025). The article detailed diplomatic interactions involving the new Pope and the current US President. When this original, unredacted article was fed to an LLM for bias analysis, the model’s output was <strong>significantly colored by its static knowledge base</strong>, which would not yet have incorporated these very recent leadership roles or their specific interactions.</p><p>Because this particular configuration of world leaders and their dialogue was novel and potentially outside its training data’s direct experience, the LLM appeared to struggle. Instead of dissecting the article’s journalistic framing or linguistic choices concerning bias, its critique shifted dramatically. <strong>The LLM framed its “bias” analysis around the premise that it was being fed an imagined story or a futuristic, speculative scenario</strong>, rather than a report of current events. It focused on the perceived unusualness of these figures interacting in this way, effectively misinterpreting the article’s nature and thereby failing to analyze how the actual news story was journalistically constructed or if any inherent bias was present in its telling. This highlighted a critical issue: <strong>for rapidly evolving current events, an LLM’s static knowledge can lead it to misinterpret the very genre of the text, completely derailing a nuanced textual bias assessment.</strong></p><p><strong>Strategic Pre-Processing: Isolating Linguistic Cues through Anonymization</strong></p><p>To mitigate such diversions and steer the LLM towards a more purely linguistic analysis, I’ve focused on a <strong>pre-processing technique involving the anonymization of key named entities</strong>. This means replacing specific names with consistent, generic identifiers.</p><p>Consider a sentence from a hypothetical news report about a tech company:</p><p>“TechGiant CEO, Ms. Anya Sharma, unveiled the ‘Orion Project’ in Berlin, drawing criticism from consumer watchdog FairPlay Initiative.”</p><p>After applying the anonymization transformation, it might become:<br>“EXECUTIVE_1 from CORPORATION_A, unveiled PROJECT_X in LOCATION_B, drawing criticism from ORGANIZATION_Y.”</p><p>The goal here is to reduce the model’s reliance on its pre-existing knowledge or sentiment towards entities like “Anya Sharma,” “TechGiant,” the “Orion Project,” or the “FairPlay Initiative.” If these were well-known, real-world entities, an LLM would almost certainly have extensive pre-existing data and potential ‘opinions’ or common associations related to them. <strong>By anonymizing such entities, we encourage the LLM to concentrate on the linguistic and structural elements:</strong> the verbs used (e.g., “unveiled,” “drawing criticism”), the framing of the actors and their initiatives, and the overall narrative construction. This allows for a <strong>more objective analysis of how the news is presented</strong>, which is essential for identifying potential bias or manipulative language, regardless of one’s stance on the actual entities involved.</p><p><strong>A/B Testing for Nuanced Insights</strong></p><p>To assess the impact of this pre-processing approach on bias detection, I’ve implemented a <strong>systematic A/B testing framework</strong>. This involves analyzing news texts both with and without the pre-processing transformation applied, and comparing the resulting LLM analyses.</p><p>The testing workflow helps determine:</p><ul><li>If anonymization allows the LLM to pick up on <strong>more subtle framing biases</strong> embedded in word choice and sentence structure, as seen in the “Pope story” example where the unredacted analysis went off-track.</li><li>Whether the LLM, unburdened by specific entity knowledge, can <strong>better identify rhetorical strategies or narrative patterns</strong> that might be used to sway opinion.</li></ul><p><strong>Considerations for Bias Analysis</strong></p><p>Applying this to bias detection involves specific considerations:</p><ul><li><strong>Defining Bias Markers:</strong> The anonymization itself doesn’t detect bias; it <strong>prepares the text for another LLM</strong> to more clearly identify linguistic markers of bias.</li><li><strong>Context Sensitivity:</strong> While removing entity specifics helps focus on language, some biases are deeply contextual. <strong>Finding the right balance is key.</strong></li><li><strong>Transformation Robustness:</strong> The pre-processing must accurately identify and replace entities. Flaws here could skew subsequent analysis.</li><li><strong>Prompt Engineering:</strong> LLM prompts for bias analysis must be crafted to leverage the anonymized text effectively, guiding the model to look for patterns in language and framing.</li></ul><p><strong>Building the Testing Framework</strong></p><p>To facilitate this testing process, I’ve built an <strong>automated workflow using n8n</strong>. This workflow allows me to batch process news articles, apply the pre-processing transformations, submit both versions to LLMs configured for bias analysis, and then collect and compare the outputs. <strong>This automation is crucial for efficiently evaluating the efficacy</strong> of different pre-processing and analysis strategies.</p><p><strong>Key Takeaways:</strong></p><ul><li><strong>Strategic pre-processing, like entity anonymization, is a powerful technique</strong> for preparing texts (especially current news) for more focused LLM-driven bias analysis.</li><li>This approach helps <strong>shift the LLM’s focus</strong> from reconciling events with its static knowledge to analyzing how the narrative is constructed, potentially revealing subtle linguistic biases.</li><li><strong>Systematic A/B testing and robust automation</strong> (e.g., with n8n) are essential for developing and validating these complex text analysis pipelines.</li><li>The effectiveness of this method hinges on <strong>accurate entity transformation and sophisticated prompt engineering</strong> for the final bias assessment.</li></ul><p>By refining how we prepare data for LLMs, we can better equip them to dissect complex texts and gain deeper insights into how language shapes our understanding, <strong>particularly in the critical domain of news and information.</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7f76e42c604d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[From Data to Delight: Using n8n and LLMs to Automate Insightful Weather Updates]]></title>
            <link>https://medium.com/@collardeau/from-data-to-delight-using-n8n-and-llms-to-automate-insightful-weather-updates-8c6ae1fddd5e?source=rss-ac1c764a559e------2</link>
            <guid isPermaLink="false">https://medium.com/p/8c6ae1fddd5e</guid>
            <category><![CDATA[llm]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[automation]]></category>
            <category><![CDATA[n8n]]></category>
            <dc:creator><![CDATA[Thomas Collardeau]]></dc:creator>
            <pubDate>Fri, 16 May 2025 13:08:03 GMT</pubDate>
            <atom:updated>2025-06-04T12:02:29.158Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pF4xT1vwdN4bzLWsvZsajw.png" /><figcaption>The Kairos automation: From data nodes to a sunny forecast, powered by n8n and LLMs.</figcaption></figure><p>Throughout my exploration of automation’s vast potential, I’ve documented various experiences—from <a href="https://medium.com/@collardeau/hands-free-ai-video-how-i-connected-google-sheets-and-luma-via-make-com-8cd1c435aa90">grappling with conditional JSON challenges in Make.com</a> to uncovering more streamlined <a href="https://medium.com/@collardeau/leveling-up-my-automation-game-when-visual-builders-led-me-to-n8ns-code-7d51e05de770">solutions with n8n’s Code Node during a Luma API integration</a>.</p><p>Each project provided valuable insights, but my latest venture stands apart. Building Kairos, an <strong>AI-powered weather scout</strong>, has vividly demonstrated how integrating robust automation tools with the advanced reasoning capabilities of Large Language Models (LLMs) can effectively address complex, real-world problems with remarkable efficiency.</p><p>The initial idea was simple: find the best weather in Europe and tweet about it. But “best” is subjective, and sifting through forecasts for dozens of cities, each with multiple data points (temperature, conditions, precipitation probability over several days), to make a human-like judgment and then craft an engaging tweet? That’s not a trivial coding task. Traditionally, this would mean complex conditional logic, weighting systems, and perhaps even sentiment analysis libraries to get the tone right for a tweet.</p><p>This is where the synergy of n8n and LLMs truly shines.</p><p><strong>The Challenge: Drowning in Data, Dreaming of Simplicity</strong></p><p>My n8n workflow diligently fetches detailed 5-day forecasts for 30 European cities from OpenWeatherMap. Using n8n’s Split Out and HTTP Request nodes, this part is fairly standard. Then, a Code Node steps in to transform and clean this data, stripping unnecessary fields, formatting values, and crucially, adding city names to each forecast. The result is a single, clean JSON object — an array where each element represents a city’s detailed weather report, all under a top-level fetch_date.</p><p>Here’s a conceptual glimpse of what that data structure looks like before it heads to the AI:</p><pre>{<br>  &quot;fetch_date&quot;: &quot;May 16, 2025&quot;,<br>  &quot;weather_reports&quot;: [<br>    {<br>      &quot;city_name&quot;: &quot;Paris, FR&quot;,<br>      &quot;daily_forecast&quot;: [<br>        { &quot;day&quot;: 1, &quot;temp_max&quot;: 22, &quot;condition&quot;: &quot;Sunny&quot;, &quot;precip_prob&quot;: 10 },<br>        { &quot;day&quot;: 2, &quot;temp_max&quot;: 23, &quot;condition&quot;: &quot;Clear&quot;, &quot;precip_prob&quot;: 5 }<br>        // ... more days<br>      ]<br>    },<br>    {<br>      &quot;city_name&quot;: &quot;Oslo, NO&quot;,<br>      &quot;daily_forecast&quot;: [<br>        { &quot;day&quot;: 1, &quot;temp_max&quot;: 18, &quot;condition&quot;: &quot;Partly Cloudy&quot;, &quot;precip_prob&quot;: 20 },<br>        // ... more days and data points<br>      ]<br>    }<br>    // ... 28 more cities<br>  ]<br>}</pre><p>Now, imagine writing the code to:</p><ol><li>Parse this for 30 cities.</li><li>Define what “best weather” means. Is it just warmest? What about “sunny but not too hot”? Or “surprisingly good for this time of year”?</li><li>Compare all 30 cities based on these nuanced criteria.</li><li>Select a single winner.</li><li>Compose a tweet that sounds natural, engaging, and includes relevant details like temperature ranges and emojis.</li></ol><p>The logic would be extensive and brittle.</p><p><strong>The LLM Breakthrough: Outsourcing Complex Logic and Creativity</strong></p><p>Instead of coding that mountain of logic, I turned to an LLM (Gemini 2.5 Pro, accessed via n8n’s OpenAI node configured for OpenRouter). I fed it the entire JSON object of weather reports and, through careful prompt engineering, asked it to do the heavy lifting.</p><p>My prompt instructed the LLM to:</p><ul><li>Act as Kairos, whose mission is to find appealing weather for spontaneous trips.</li><li>Analyze all provided city forecasts.</li><li>Identify the city with the overall “best weather in Europe,” considering factors like pleasant temperatures (e.g., 18–28°C), sunshine, and low precipitation.</li><li>Crucially, give preference to cities experiencing “unusually pleasant” weather for their location/season (this was a key refinement for more interesting picks).</li><li>Return its findings in a structured JSON format, including the chosen city, reasoning, and, importantly, a suggested_tweet.</li></ul><p>The result? The LLM not only intelligently analyzed the data — weighing multiple factors across numerous cities in a way that mimics human intuition — but it also drafted a ready-to-post tweet, complete with relevant emojis and a call to action.</p><p>This ability to hand off complex data analysis and creative content generation to an LLM, simply by providing structured data and clear instructions, felt like a superpower. The hundreds, if not thousands, of lines of conventional code I might have written were replaced by a well-crafted prompt.</p><p><strong>n8n: The Indispensable Orchestrator</strong></p><p>The LLM, powerful as it is, needs a robust platform to manage the overall workflow. Here’s how n8n played that crucial role:</p><ul><li><strong>Data Ingestion &amp; Iteration:</strong> Efficiently fetching data from OpenWeatherMap for each city using HTTP Request and Split Out nodes.</li><li><strong>Data Preparation:</strong> The Code Node ensured the LLM received clean, well-structured JSON tailored for analysis.</li><li><strong>AI Integration:</strong> The OpenAI node seamlessly handled the LLM call, abstracting the API complexities.</li><li><strong>Action &amp; Communication:</strong> The X (Twitter) node took the LLM’s suggested_tweet and posted it, while the Gmail node sends me a confirmation.</li><li><strong>Reliability &amp; Scheduling:</strong> n8n also handles scheduling the workflow to run twice a week and incorporates a separate error-handling workflow that emails me if anything goes amiss, ensuring robust operation.</li></ul><p>The platform’s visual interface allowed me to design the overall flow, while specific nodes like the Code Node and OpenAI node provided the power needed for the more intricate parts.</p><p><strong>Key Learnings for an AI &amp; Automation Toolkit:</strong></p><ol><li><strong>LLMs as Data Analysts:</strong> LLMs can ingest large, structured datasets and extract nuanced insights based on natural language instructions, saving vast amounts of custom coding.</li><li><strong>LLMs as Content Generators:</strong> Beyond analysis, they can generate contextually relevant and stylistically appropriate content (like tweets) based on that analysis.</li><li><strong>Prompt Engineering is Key:</strong> The quality of the LLM’s output is directly proportional to the clarity, specificity, and iterative refinement of the prompt. This is a skill in itself.</li><li><strong>n8n + LLMs = A Power Duo:</strong> n8n provides the robust framework for data flow, service integration, scheduling, and error handling, while the LLM provides the “brain” for complex decision-making and generation.</li><li><strong>The Future is Orchestration:</strong> My role increasingly feels like an orchestrator of these powerful tools, designing the interaction points and guiding the AI, rather than coding every single logical step from scratch.</li></ol><p>This Kairos project has been incredibly rewarding, not just for the functional automation it produced, but for the deeper understanding it gave me of how AI can be practically integrated into workflows to solve real-world problems in surprisingly elegant ways.</p><p>You can see the results of this automation live on the <a href="https://x.com/kairos_sun">@kairos_sun X (Twitter) account</a>, which is now autonomously tweeting its weather picks. It’s a small demonstration, but for me, it represents a big step forward in leveraging AI within automation.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8c6ae1fddd5e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Leveling Up My Automation Game: When Visual Builders Led Me to n8n’s Code]]></title>
            <link>https://medium.com/@collardeau/leveling-up-my-automation-game-when-visual-builders-led-me-to-n8ns-code-7d51e05de770?source=rss-ac1c764a559e------2</link>
            <guid isPermaLink="false">https://medium.com/p/7d51e05de770</guid>
            <category><![CDATA[n8n]]></category>
            <category><![CDATA[automation]]></category>
            <category><![CDATA[low-code]]></category>
            <dc:creator><![CDATA[Thomas Collardeau]]></dc:creator>
            <pubDate>Mon, 12 May 2025 16:07:29 GMT</pubDate>
            <atom:updated>2025-05-12T16:07:29.906Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bo2wxjmhie6wY1eq896oRw.png" /><figcaption>Simplifying visual workflows: Sometimes, a little code is the best eraser.</figcaption></figure><p>A little while ago, I shared my journey <a href="https://medium.com/@collardeau/hands-free-ai-video-how-i-connected-google-sheets-and-luma-via-make-com-8cd1c435aa90"><strong>building an automated workflow</strong></a> to generate AI videos with Luma Labs directly from a Google Sheet using Make.com. It was a success, but one piece of the puzzle — handling optional API inputs requiring specific JSON structures — necessitated a slightly cumbersome workaround involving Make.com’s Router module and duplicate steps.</p><p>While functional, that Router-based solution felt like using a visual sledgehammer for a logic nut that needed cracking. It worked, but the repetition highlighted a limitation: sometimes, intricate conditional logic, especially when dealing with nested data structures for APIs, can become awkward in a purely visual builder. This itch — the feeling that there <em>must</em> be a cleaner way — prompted me to look at other automation tools.</p><p><strong>Exploring n8n: The Promise of Integrated Code</strong></p><p>n8n often came up in discussions about flexible automation, particularly its “Code Node” which allows running custom JavaScript directly within a workflow. Could this be the answer to the JSON construction challenge? I decided to find out by replicating my exact Luma API automation in n8n.</p><p>Setting up the basic flow in n8n was straightforward. The real test came when it was time to dynamically create that tricky JSON payload for the Luma API — the part that had required the Router detour in Make.com. This time, I dropped in n8n’s Code Node.</p><p><strong>The Breakthrough: Solving Logic with Logic</strong></p><p>The difference was immediate. Instead of visual branching, I wrote a small JavaScript snippet. Using simple if statements, the code checked which input fields (like start or end image URLs) were present and built the <em>exact</em> JSON payload required by the Luma API for that specific combination, adding or omitting keys and nested objects as needed.</p><p>This single Code Node, containing just a handful of logical JavaScript lines, cleanly replaced the Router and multiple duplicated HTTP modules I’d used in Make.com. It directly addressed the core challenge — conditional data structure generation — in a way that felt much more direct and maintainable.</p><p><strong>Visual vs. Code-Enhanced: Finding the Balance</strong></p><p>This experience was illuminating. Make.com’s visual approach is brilliant for connecting services and mapping data in many scenarios. But for that specific task, the rigid structure of the API’s conditional requirements was simply easier to express programmatically.</p><p>n8n’s ability to seamlessly integrate these small code snippets <em>within</em> the visual flow provided the flexibility I needed. It wasn’t about abandoning visual building entirely, but about having the right tool — sometimes code — available for specific, tricky parts of the process. It felt like unlocking a new level in automation, combining the ease of visual flow design with the precision of code when necessary.</p><p>This discovery has definitely shifted my perspective. Having experienced the power of code-enhanced automation, I’m eager to tackle more complex projects with n8n, knowing I have that extra layer of flexibility available when the drag-and-drop approach meets its limits. Sometimes, the path to a more elegant solution involves embracing a little bit of code.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7d51e05de770" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Hands-Free AI Video: How I Connected Google Sheets and Luma via Make.com]]></title>
            <link>https://medium.com/@collardeau/hands-free-ai-video-how-i-connected-google-sheets-and-luma-via-make-com-8cd1c435aa90?source=rss-ac1c764a559e------2</link>
            <guid isPermaLink="false">https://medium.com/p/8cd1c435aa90</guid>
            <category><![CDATA[aivideocreation]]></category>
            <category><![CDATA[automation]]></category>
            <category><![CDATA[make]]></category>
            <category><![CDATA[api]]></category>
            <dc:creator><![CDATA[Thomas Collardeau]]></dc:creator>
            <pubDate>Thu, 01 May 2025 16:09:42 GMT</pubDate>
            <atom:updated>2025-05-01T16:09:42.882Z</atom:updated>
            <content:encoded><![CDATA[<p>The rise of AI video generation tools like Luma Labs is incredibly exciting, opening up new possibilities for creators. However, manually generating clips, especially for ongoing projects, can quickly become time-consuming. As part of <strong>refining my automated workflows</strong> (and for my creative project, HenceStories!), I set out to build a system that could trigger Luma video generations directly from a simple Google Sheet, using Make.com as the automation platform. The goal? A truly “hands-free” video pipeline.</p><h3>The Dream Workflow</h3><p>The plan seemed straightforward enough:</p><ol><li>Add details for a new video job (like prompts, image URLs, settings) to a row in a Google Sheet and mark its status as “Ready”.</li><li>Have Make.com detect this “Ready” row.</li><li>Make.com calls the Luma Labs API with the details from the sheet.</li><li>Luma does its magic and generates the video.</li><li>Luma sends a notification (webhook) back to Make.com when the job is complete.</li><li>Make.com receives this notification, grabs the video URL, and updates the original Google Sheet row with the URL and a “Completed” status. (Optionally, it could also save the video file to cloud storage like Dropbox).</li></ol><p>This setup would allow me to queue up multiple video jobs just by filling out a spreadsheet — pretty neat!</p><h3>The API Curveball: Handling Optional Inputs</h3><p>Connecting Google Sheets and setting up the basic Make.com scenarios (one to “Call” Luma, one to “Receive” the callback) went smoothly. However, I soon hit an unexpected hurdle when constructing the actual API request to Luma.</p><p>The Luma API allows for generating video from a text prompt, a starting image (frame0), an ending image (frame1), or both images. These image inputs are nested within a keyframes object in the JSON payload sent to the API.</p><p>The challenge? If you only provide one image (or none), the API doesn’t just want an empty string for the missing image URL. It requires the <em>entire key</em> for the missing frame (e.g., &quot;frame1&quot;: {...}) or potentially even the parent keyframes object itself to be <strong>completely omitted</strong> from the JSON request. Sending incorrect structures, like frame1: {} or frame1: { &quot;url&quot;: &quot;&quot; }, results in an error. This kind of strictness is fairly common with APIs, requiring careful payload construction.</p><h3>Navigating Make.com’s Visual Logic</h3><p>My first instinct was to use Make.com’s built-in functions. Functions like ifempty(variable, ignore) worked perfectly for top-level optional fields, like the main text prompt. If the prompt cell in my Google Sheet was empty, ignore would correctly remove the prompt key from the final JSON.</p><p>However, applying this logic to <em>nested</em> objects like frame0 or frame1 within keyframes proved trickier within the visual interface. Trying to ignore just the url inside frame0 would leave an empty frame0: {} object, which the API rejected. I needed a way to conditionally remove the <em>entire</em> frame0 or frame1 object, or the keyframes object altogether, based on the input data from the Google Sheet.</p><h3>The Router Workaround</h3><p>After some experimentation, the most reliable solution within Make.com’s visual builder involved using the <strong>Router</strong> module. Here’s how it works in my “Luma Caller” scenario:</p><ol><li>The scenario triggers and finds “Ready” rows in Google Sheets.</li><li>It iterates through each job.</li><li><em>Initial Validation:</em> A first router checks if essential data (like model, aspect ratio) is present.</li><li><em>Status Update:</em> The Google Sheet row is updated to “Processing”.</li><li><strong>The Core Logic (Router):</strong> A second Router module checks the input columns for the First Frame (C) and Last Frame (D) image URLs from the Google Sheet.</li></ol><ul><li><strong>Path 1:</strong> If only First Frame (C) has a URL, it proceeds down a path with an HTTP module configured <em>only</em> with the JSON structure for frame0.</li><li><strong>Path 2:</strong> If only Last Frame (D) has a URL, it uses a different HTTP module configured <em>only</em> for frame1.</li><li><strong>Path 3 (Fallback):</strong> If both C and D have URLs, it uses a third HTTP module configured for <em>both</em> frame0 and frame1.</li></ul><p><em>6. API Call &amp; Update:</em> The appropriate HTTP module calls the Luma API. On success, another Google Sheets module updates the row to “Generating” and stores the Luma Job ID.</p><p>Here’s a look at that part of the Make.com scenario:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2h1y25Q-wsy23CaE2Y3-iA.png" /><figcaption><em>The Make.com ‘Luma Caller’ scenario flow. The crucial Router module branches the process based on input data (presence of first/last image frames), sending the job to one of three dedicated HTTP modules configured with the correct Luma API payload structure.</em></figcaption></figure><p>A separate “Luma Receiver” scenario listens for the webhook callback from Luma, filters for the “completed” status message, finds the matching row in the Google Sheet using the Job ID, and updates the status to “Completed”, pasting in the final video URL.</p><h3>Reflections and What’s Next</h3><p>This Router-based solution works reliably and achieves the goal: I can now trigger Luma video generations simply by adding rows to a Google Sheet. It’s a functional hands-free pipeline!</p><p>From a Make.com perspective, the solution feels a bit repetitive, requiring separate, almost identical HTTP modules for each conditional path. I was genuinely surprised I couldn’t find a more direct visual method to dynamically build or omit those nested JSON structures based on input variables. It works well, though I do wonder if the Make.com community has found more streamlined visual methods for handling such conditional nested structures.</p><p>This project was a <strong>valuable practical exercise</strong>, deepening my understanding of Make.com’s capabilities, the practicalities of API integration, and the importance of carefully handling API requirements. It also highlighted the trade-offs between visual builders and code. For future projects involving more complex conditional logic, exploring platforms like n8n, which often integrate code modules more directly, might be worth comparing.</p><p>For now, I have a working automation that saves significant time and effort, demonstrating the practical power of tools like Make.com for streamlining creative and technical workflows.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8cd1c435aa90" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[A Committed Intro Guide to ReactJS, Part 3]]></title>
            <link>https://medium.com/@collardeau/a-committed-intro-guide-to-reactjs-part-3-7ab6330b03eb?source=rss-ac1c764a559e------2</link>
            <guid isPermaLink="false">https://medium.com/p/7ab6330b03eb</guid>
            <category><![CDATA[reactjs]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[webdev]]></category>
            <category><![CDATA[es6]]></category>
            <dc:creator><![CDATA[Thomas Collardeau]]></dc:creator>
            <pubDate>Wed, 11 Apr 2018 21:41:55 GMT</pubDate>
            <atom:updated>2018-04-15T03:21:55.320Z</atom:updated>
            <content:encoded><![CDATA[<p>Welcome back to our app-building endeavor with <a href="https://reactjs.org/">ReactJS</a>! <a href="https://medium.com/@collardeau/a-committed-guide-to-reactjs-47c0371df3ab">In part 1</a>, we bootstrapped a new app and acquainted ourselves with stateful components. <a href="https://medium.com/@collardeau/building-an-app-with-reactjs-part-2-b0f75cb5506c">In part 2</a>, we delved right into React development. We used the lifecycle hook componentDidMount and we created an action to fetch data asynchronously and render a list of todos! Lastly, we refactored code to make use of stateless functional components.</p><p>There is a <a href="https://github.com/collardeau/react-todo-app">dedicated Github repo</a> for this blog series. The <a href="https://github.com/collardeau/react-todo-app/commits/master">commit history</a> follows the steps taken in this guide. Feel free to fork the repo and checkout any commit to experiment along with this series!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*M3rXE0jIemSWqZ81." /><figcaption>Where we we?</figcaption></figure><p>We’re working right in the file src/App.js, which stands <a href="https://github.com/collardeau/react-todo-app/blob/2368e7e2c3e76324e20200083ceacd2ea2779eef/src/App.js">like this</a> before we begin here in part 3. We have a little list of feature requirements, of which we already took care of the first two items.</p><p><strong>Requirements:<br></strong>X) display a loading text (while “fetching” todos) — done!<br>X) load and display todos<br>3) add new todos<br>4) toggle todos done/undone<br>5) delete todos</p><p>We’ve acquired much of the knowledge we need to tackle the last three features. Let’s begin with <strong>adding new todos</strong>…</p><h3>Adding New Todos</h3><p>We need to accept input from the user creating new todos.</p><h4>Creating a Form</h4><p>Let’s build a Form component that will have a submit button, and a text input from which we will process new todo “titles”. Let’s sketch out such a form:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/994/1*97zkJfKIv_FmZIFKYNnLnA.png" /></figure><p>We’ve prepped the Form component, and the App (parent) component passes it all of its state <strong>and</strong> actions right there on line 38.</p><p>We could also pass down individual props (as Form is only using one prop thus far) for example:<br>&lt;Form submit={this.actions.submit} /&gt;,<br>but this “prop drilling” gets tedious because you have to keep updating the parent component as you build the children components. For now, as we’re prototyping, I suggest we pass everything down by default; we can move faster and not to worry if the prop will be there in the child component. If prop drilling drives you mad, look into <a href="https://reactjs.org/docs/context.html"><strong>context</strong></a>, which was made official in <a href="https://github.com/facebook/react/releases/tag/v16.3.0">React 16.3</a>)</p><p>So, back to our little code review of our Form component. It has a onSubmit handler, which calls e.preventDefault to prevent an unwanted page reload from the browser, and then calls the submit action… that we still need to write, on line 16.</p><h4><strong>Controlled Input</strong></h4><p>Before we can submit the form however, we need to use that text input to get a todo title from the user. We’ll wire up a <a href="https://reactjs.org/docs/forms.html">controlled input</a>, meaning that we keep track of (and control) the value of our input from the state up top. Let me just show you what I mean:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/888/1*L9au4FNiWq8iEu5u3Pz9ow.png" /></figure><p>Voila, we add a newTitle state (line 12) which is tied to the value of the form, on line 60. To change its value, we call our newly created action changeTitleInput on line 62 which does a setState on newTitle on line 17. Our controlled input is all wired up! The new title input is now on our state and we can access it from the root component!</p><h4>Submitting the Form</h4><p>All of a mere sudden, actions.submit has all that it needs because it can just look on this.state for the title input. Let’s tie up our implementation then:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XHqQvZ1u2CvmmkSOk6ZgXQ.png" /><figcaption>Now users can submit todos</figcaption></figure><p>In the submit action, we call on our mock db to add a new todo to the database (which will callback our setState function from syncTodos, if you remember from <a href="https://medium.com/@collardeau/building-an-app-with-reactjs-part-2-b0f75cb5506c">part 2</a>) so we’ll have that new todo just pop up on the screen. Hooray!</p><p>Also, we reset the input field on line 25 with:<br>this.setState({newTitle: &#39;&#39; }) <br>so the input is empty again right after the user has submitted the form.</p><p>Finally, on line 70 we’re disabling the button when the input is empty, otherwise we’re making it possible to create empty todos which is not desirable. Here is what it looks like in the browser:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/248/1*XOm8pBrIr5osqcxALOUrKQ.gif" /><figcaption>creating new todos</figcaption></figure><h4>Destructuring Hipness</h4><p>We’re done with “adding new post”, but let’s do one small (esthetic) enhancement; let’s <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Destructuring_assignment">destructur</a>e the props of our new Form component, so our code isn’t as repetitive:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iyW0UzFYZhN7l-UGGgh-UA.png" /><figcaption>Destructuring assignment syntax was recently added to JavaScript</figcaption></figure><p>We no longer have props all over the component and fewer “. chaining” in our JSX (props.submit becomes just submit). It’s also clearer what props we’re using in the rendering without scanning the entire component. The component is making use of newTitle, changeTitleInput, and submit as we can see at the top of the function. (Note that we can use this syntax because it’s been bundled for us via <a href="https://babeljs.io/">Babel</a> and <a href="https://github.com/facebook/create-react-app">create-react-app</a> from <a href="https://medium.com/@collardeau/a-committed-guide-to-reactjs-47c0371df3ab">part 1</a> of this guide).</p><p>Sweetness! Let’s commit our changes. It may seem like a work of work but in the end we’ve only added 34 lines of code in this commit.</p><ul><li><a href="https://github.com/collardeau/react-todo-app/commit/d955657d59dedf487ccdca220ae5635b051a496b">add ability to create todos</a></li></ul><p>I’ve only destructured our new Form component above. Can you do the same for the Todos component?</p><ul><li><a href="https://github.com/collardeau/react-todo-app/commit/bb007909c2bcd8cc2571088dd3dbd299f07f380f">destructure todos component</a></li></ul><h3>Toggling Individual Todos</h3><p>Let’s ride the wave… and tackle our next task: the toggling of individual todos as completed (done) or not. We’ll start by adding a controlled <em>checkbox</em> input for each mapped todo:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9zgoKz4ENct-gQLkJd6nrQ.png" /><figcaption>adding a controlled checkbox for each todo</figcaption></figure><p>We’re adding a checkbox input for each todo in our list. We’re “controlling” it via the todo’s done property, which is always initiated in the mockDB as false. Let’s create a new action to update the appropriate done key to its opposite (from false to true or vice-versa):</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/976/1*srq4wGZ8fOyqPSjXoDf-Dg.png" /><figcaption>Are you ready to toggle?</figcaption></figure><p>The new action toggle on line 16 just needs the id of the todo, as it looks up its current done status on this.state, flips it with !, and updates the DB. The DB change triggers a new setState as part of our prior componentDidMount setup (see <a href="https://medium.com/@collardeau/building-an-app-with-reactjs-part-2-b0f75cb5506c">part 2</a> of this guide).</p><p>On line 55, we have to remember to do a little “drilling” with our actions: we pass all the actions down to the Todos component (because it’s now using the action toggle). Then we simply attach the toggle to the controlled checkbox via its onChange handler on line 88.</p><p>And we’re all <em>done</em> with the toggling!</p><p><strong>A Touch of Style</strong></p><p>It would be nice to have more visual feedback when a todo is done. Right now we only see the checkbox itself as an indication, which makes it a bit hard to tell if it’s even connected to the todos state at this point.</p><p>Let’s cross out an item when it is “done” by conditionally adding this CSS rule: text-decoration: line-through, so our UI end up like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/291/1*TJu8bQpDgZzh85tuuPHotg.gif" /><figcaption>Crossing out the text when the todo is marked done</figcaption></figure><p>We’ll take the opportunity to use <a href="https://objectpartners.com/2017/11/03/css-in-js-benefits-drawbacks-and-tooling/">CSS-IN-JSS</a>, a technique popularized by React where you define CSS within the JS and basically abandon CSS files, (a bit similar to how we “handle HTML” in JS with React in fact). It looks like this in practice:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zDtQQ5gh-G-XUq4LDBzjrg.png" /></figure><p>We can use the style property of an element and pass it an object (within a JS expression — that’s why the double bracket style={{ ... }}) . Each objet key is a CSS property, but you have to be careful to camel case it: the CSS text-decoration becomes textDecoration. Then we use the JS <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Logical_Operators">logical operator</a> &amp;&amp; to add the line-through when done is true. Now we have conditional styling.</p><p>Please note this implementation of CSS-IN-JS is rather naive and limiting. For example, you can’t use selectors like :hover. However, if you like this approach, I recommend you check out <a href="https://www.styled-components.com/">Styled Components</a>.</p><p>Furthermore, <a href="https://blog.bitsrc.io/best-react-ui-component-libraries-for-2018-part-2-d231dcb04c0a">check out the multitude of UI-Kits</a> out there to style your React app. Perfect if you don’t have a designer onboard yet.</p><h3>Deleting A Todo</h3><p>Well, well… I leave this one up to you, partner! Why not send me a <a href="https://codeburst.io/a-step-by-step-guide-to-making-your-first-github-contribution-5302260a2940">pull request</a> on Github? Consider it a challenge. If you can complete the task, you’ll be well on your way to being a React dev!</p><p>Hint: you’ll be making use of db.deleteTodo which takes a todo id as a parameter. Good luck!</p><p>[update]: <a href="https://github.com/collardeau/react-todo-app/pull/1">A PR has been merged</a>. (Thanks Nick!)</p><h3><strong>The Bittersweet End</strong></h3><p>We’re arrived at the end of this guide. I hope you’ve enjoyed the content, and that you now feel comfortable with the key aspects of React development!</p><p>If we were to continue, what would you like to do next: add some tests? integrate a backend? add more features? Feel free to leave a comment. Feedback is always appreciated.</p><p>I’m also <a href="https://twitter.com/collardeau">on Twitter.</a></p><p><strong>Photo Credit</strong><br>“A MacBook with lines of code displayed on its screen next to a mug” by <a href="https://unsplash.com/@sapegin?utm_source=medium&amp;utm_medium=referral">Artem Sapegin</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7ab6330b03eb" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>