<?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: Brian Laposa</title>
    <description>The latest articles on DEV Community by Brian Laposa (@brianbot).</description>
    <link>https://dev.to/brianbot</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%2F3282830%2Fac1dd414-49f8-4416-acff-a212bb0ae8e5.png</url>
      <title>DEV Community: Brian Laposa</title>
      <link>https://dev.to/brianbot</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/brianbot"/>
    <language>en</language>
    <item>
      <title>Our Lord of Lethality v1</title>
      <dc:creator>Brian Laposa</dc:creator>
      <pubDate>Wed, 22 Apr 2026 22:25:21 +0000</pubDate>
      <link>https://dev.to/brianbot/our-lord-of-lethality-v1-1ele</link>
      <guid>https://dev.to/brianbot/our-lord-of-lethality-v1-1ele</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fp6dd01fr26lui41iio6b.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fp6dd01fr26lui41iio6b.png" alt=" " width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  title: "Building a Satirical AI Chaplain: 'Our Lord of Lethality' with React, Vercel, and Gemini API"
&lt;/h2&gt;

&lt;p&gt;What happens when you cross the military-industrial complex with dominionist religious fervor? You get &lt;strong&gt;Our Lord of Lethality v1&lt;/strong&gt;. &lt;/p&gt;

&lt;p&gt;I recently built this satirical web application to explore highly-constrained AI prompt generation wrapped in a heavily themed, immersive UI. The app acts as a "UAV / C2 Terminal" that generates militarized prayers by structurally twisting &lt;em&gt;real&lt;/em&gt; Bible verses to justify specific military ordnances.&lt;/p&gt;

&lt;p&gt;Here is a breakdown of how the project was architected, the technologies used, and the prompt engineering tricks required to keep the AI from hallucinating scripture. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;a href="https://ourlordoflethality.vercel.app" rel="noopener noreferrer"&gt;https://ourlordoflethality.vercel.app&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  🛠️ The Tech Stack
&lt;/h2&gt;

&lt;p&gt;I needed a stack that was fast, secure, and capable of handling serverless API routes without managing a dedicated Node.js server.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  &lt;strong&gt;Frontend:&lt;/strong&gt; React (Vite) + Tailwind CSS + Framer Motion&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;Backend:&lt;/strong&gt; Vercel Serverless Functions (&lt;code&gt;/api/*&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;AI Inference:&lt;/strong&gt; &lt;code&gt;@google/genai&lt;/code&gt; (Gemini 3.1 Flash-Lite)&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;Rate Limiting:&lt;/strong&gt; Upstash Serverless Redis&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  🎨 Crafting the "Terminal" Aesthetic
&lt;/h2&gt;

&lt;p&gt;The entire UI is built to look like a ruggedized military laptop. We threw away default minimalist component libraries in favor of pure Tailwind CSS sorcery to create an immersive, hostile environment.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  &lt;strong&gt;CRT Effects:&lt;/strong&gt; Heavy use of &lt;code&gt;mix-blend-overlay&lt;/code&gt;, CSS gradients for scanlines, and custom keyframe animations (&lt;code&gt;crt-flicker&lt;/code&gt;) give the screen a distinct phosphor glow and instability.&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;Monospace Typography:&lt;/strong&gt; Using standard &lt;code&gt;font-mono&lt;/code&gt; tightly tracked to replicate dot-matrix and early command-line interfaces.&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;Thematic Micro-interactions:&lt;/strong&gt; Buttons don't just "submit"—they "EXECUTE FIRING SOLUTION." Errors aren't "404s"—they are "SATELLITE DOWNLINK FAILED." &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;By treating the UI as an actual character in the satire, the user is immediately immersed in the world.&lt;/p&gt;




&lt;h2&gt;
  
  
  🧠 Taming the LLM: Strict Structural Prompting
&lt;/h2&gt;

&lt;p&gt;The core mechanic of the app relies on the Gemini API. Early iterations had a glaring problem: if you ask an LLM to "write a dark prayer based on a Bible verse," it will confidently hallucinate a Bible verse that never existed to make its job easier.&lt;/p&gt;

&lt;p&gt;To fix this, we implemented &lt;strong&gt;Payload-First Security TDD&lt;/strong&gt; for the prompt itself:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt; &lt;strong&gt;Lowered Temperature:&lt;/strong&gt; We dropped the temperature to &lt;code&gt;0.4&lt;/code&gt; to reduce hallucination and force deterministic retrieval of real texts.&lt;/li&gt;
&lt;li&gt; &lt;strong&gt;Structural Invariants:&lt;/strong&gt; We updated the &lt;code&gt;System Instruction&lt;/code&gt; to treat the AI as a Find-and-Replace algorithm. &lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Here is what the core prompt structure looks like in our serverless backend:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// /api/generate.ts&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;prompt&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;`Generate a dark, gothic, satirical dominionist prayer...

CRITICAL INSTRUCTION: You MUST select a REAL, highly-verifiable, and well-known Bible verse first. The customized prayer MUST be a direct, recognizable structural rewriting of this exact verse, mapped to the military context. Do NOT invent or hallucinate the base scripture.

You must return a JSON object with exactly the following fields:
- invocation: The 'Militarized Form'. This MUST strictly mirror the exact cadence, structure, and pacing of the original scripture.
- citation: The exact Book, Chapter, and Verse of the real Bible verse you chose (e.g., 'Psalm 144:1'). ALWAYS INCLUDE THIS REFERENCE.
- scripture: The exact, real verbatim text.
- twist: The satirical, dominionist 'Exegesis'...`&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Because of this strict instruction, the AI outputs a genuinely jarring structural corruption. It forces the output to be a dark mirror of the original text.&lt;/p&gt;




&lt;h2&gt;
  
  
  🔒 Security &amp;amp; Serverless Architecture
&lt;/h2&gt;

&lt;p&gt;Because we are calling the Gemini API, we cannot expose the &lt;code&gt;GEMINI_API_KEY&lt;/code&gt; to the client. &lt;/p&gt;

&lt;p&gt;We abstracted the application logic entirely behind Vercel Serverless Functions. The React frontend simply posts the user's tactical selections (Branch, Role, Weapon) to our &lt;code&gt;/api/generate&lt;/code&gt; route.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;handler&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;req&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;VercelRequest&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;VercelResponse&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="c1"&gt;// 1. Verify Method&lt;/span&gt;
  &lt;span class="c1"&gt;// 2. Enforce Rate Limits&lt;/span&gt;
  &lt;span class="c1"&gt;// 3. Ping Gemini&lt;/span&gt;
  &lt;span class="c1"&gt;// 4. Return secure payload&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This abstraction ensures that API keys remain completely secret in the Vercel production environment.&lt;/p&gt;




&lt;h2&gt;
  
  
  🛑 Gamified Rate Limiting with Upstash Redis
&lt;/h2&gt;

&lt;p&gt;AI isn't free, so we needed rate limiting. But instead of throwing a generic "429 Too Many Requests" error, we tied the architecture directly into the theme using &lt;strong&gt;Upstash Serverless Redis&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;We map the rate limit to an "Ordnance Quota." Users only get 5 "prayers" per 24 hours per IP address.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;rateLimitKey&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;`rate_limit:&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;userIp&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;requests&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;redis&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;incr&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;rateLimitKey&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;requests&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;redis&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;expire&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;rateLimitKey&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;86400&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// 24-hour expiration&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;MAX_REQUESTS&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;requests&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;MAX_REQUESTS&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
   &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;status&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;429&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;json&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; 
     &lt;span class="na"&gt;error&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;RATE LIMIT EXCEEDED. ORDNANCE DEPLETED. AWAIT RESUPPLY CYCLE.&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
     &lt;span class="na"&gt;remaining&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;
   &lt;span class="p"&gt;});&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The frontend checks this limit via a separate &lt;code&gt;/api/ammo&lt;/code&gt; endpoint on initialization. If the user runs out of API calls, the UI flashes red, disables the firing mechanism, and reads: &lt;code&gt;ORDNANCE DEPLETED&lt;/code&gt;. We turned a backend constraint into a frontend feature!&lt;/p&gt;




&lt;h2&gt;
  
  
  📡 The "Tactical Net" Sharing Feature
&lt;/h2&gt;

&lt;p&gt;Finally, we wanted users to be able to share their corrupted scriptures. We built a custom &lt;code&gt;ShareModal&lt;/code&gt; that mimics a secure uplink transmission. Clicking "BROADCAST TO TACTICAL NET" executes a &lt;code&gt;setTimeout&lt;/code&gt; progression, flashing "UPLINKING... Routing through MILSTAR..." before marking the transmission as sent. &lt;/p&gt;

&lt;p&gt;It’s completely fake and non-functional on the backend, but it's a massive UX win that fits perfectly with the aesthetic. &lt;/p&gt;

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

&lt;p&gt;&lt;em&gt;Our Lord of Lethality v1&lt;/em&gt; is a prime example of how taking a very strict, highly opinionated approach to both UX and Prompt Engineering can transform a generic "wrapper" into a compelling, immersive piece of interactive satire. By leaning into Serverless architecture and Redis, it handles API rate limiting and security cleanly, while offering a deeply thematic experience to the end user. &lt;/p&gt;




&lt;p&gt;&lt;em&gt;Stay frosty, and praise the payload.&lt;/em&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Red Star Realism</title>
      <dc:creator>Brian Laposa</dc:creator>
      <pubDate>Fri, 12 Sep 2025 00:10:59 +0000</pubDate>
      <link>https://dev.to/brianbot/red-star-realism-pd6</link>
      <guid>https://dev.to/brianbot/red-star-realism-pd6</guid>
      <description>&lt;p&gt;Title: Red Star Realism: Revolutionary Generative AI Propaganda with Google Gemini 2.5 Flash Image!!&lt;br&gt;
published: True&lt;br&gt;
tags: devchallenge, googleaichallenge, ai, gemini&lt;/p&gt;

&lt;h2&gt;
  
  
  What I Built
&lt;/h2&gt;

&lt;p&gt;With the Red Star Realism tool you can harness the power of generative AI to inform and influence the masses! This app creatively emulates the visual style, motifs, and color palette of Socialist Realist style. This iconic art style hails from mid-20th-century Soviet Union and its severe and monolithic style is easily recognizable. &lt;/p&gt;

&lt;h2&gt;
  
  
  Demo
&lt;/h2&gt;

&lt;p&gt;You can try the deployed app here:&lt;br&gt;&lt;br&gt;
🔗 [Red Star Realism App] &lt;a href="https://red-star-realism.vercel.app/" rel="noopener noreferrer"&gt;https://red-star-realism.vercel.app/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Below is a walkthrough video demonstration of the workflow and outputs:&lt;br&gt;
&lt;a href="https://www.youtube.com/embed/Dom-wlS_MLU?si=s3i8omjKVfv1vHvu" rel="noopener noreferrer"&gt;https://www.youtube.com/embed/Dom-wlS_MLU?si=s3i8omjKVfv1vHvu&lt;/a&gt;&lt;/p&gt;

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

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fuzqcf6nv7mxajl4mwjae.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fuzqcf6nv7mxajl4mwjae.jpg" alt=" " width="672" height="1380"&gt;&lt;/a&gt;&lt;br&gt;
The vanguard of Revolutionary Shock Workers! &lt;/p&gt;

&lt;h2&gt;
  
  
  How I Used Google AI Studio
&lt;/h2&gt;

&lt;p&gt;Red Star Realism leverages Google AI Studio’s platform for construction and integration with Gemini api. Constructed in typescript, vite and react this app posts image uploads to a backend that performs image analysis using Gemini's powerful text and image analysis features. Uploads are processed to generate appropriate slogans based on image context. Everything from language to UI visuals is carefully tailored to exaggerate this aesthetic for entertainment and educational purposes.&lt;/p&gt;

&lt;h2&gt;
  
  
  Multimodal Features
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Image Analysis and Generation&lt;/strong&gt; Users upload any image and choose from the appropriate slogans and backgrounds Create your portrait as the generalissimo or a hero of the proletariat!&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Socialist Realist Style:&lt;/strong&gt; Every graphic, badge, and piece of feedback channels the socialist realist style—dramatic reds and golds, heroic worker motifs, bold block fonts, and stylized propaganda flourishes.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Dynamic Slogans:&lt;/strong&gt; Powered by Gemini's world-class multimodal AI models, so every slogan is inspired by a combination of real pose and expression analysis with a communist twist!&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Red Star Realism is both a rich technical showcase and a collective celebration of AI, aesthetics, and creative expression.&lt;/strong&gt;&lt;/p&gt;

</description>
      <category>devchallenge</category>
      <category>googleaichallenge</category>
      <category>ai</category>
      <category>gemini</category>
    </item>
  </channel>
</rss>
