<?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: Fantasy</title>
    <description>The latest articles on DEV Community by Fantasy (@fantasy_3d94b64450126b360).</description>
    <link>https://dev.to/fantasy_3d94b64450126b360</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4121583%2Ffbddc6ec-47e7-4fe2-be7a-bea73ea2b701.png</url>
      <title>DEV Community: Fantasy</title>
      <link>https://dev.to/fantasy_3d94b64450126b360</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/fantasy_3d94b64450126b360"/>
    <language>en</language>
    <item>
      <title>How I structured a secure Groq summarizer in React and TypeScript</title>
      <dc:creator>Fantasy</dc:creator>
      <pubDate>Sat, 12 Sep 2026 01:52:20 +0000</pubDate>
      <link>https://dev.to/fantasy_3d94b64450126b360/how-i-structured-a-secure-groq-summarizer-in-react-and-typescript-27pc</link>
      <guid>https://dev.to/fantasy_3d94b64450126b360/how-i-structured-a-secure-groq-summarizer-in-react-and-typescript-27pc</guid>
      <description>&lt;p&gt;I built Sift to address a common problem in React/TypeScript AI prototypes: the browser needs a simple summarization experience, but the Groq API key must remain server-side. The project is a small technical showcase of that boundary, with enough product polish to make the architecture easy to exercise and extend.&lt;/p&gt;

&lt;h3&gt;
  
  
  Architecture
&lt;/h3&gt;

&lt;p&gt;The browser uses a typed tRPC mutation rather than calling Groq directly. The server validates the source text, summary format, tone, and requested model, then sends the request to Groq's OpenAI-compatible chat-completions endpoint using the server-only &lt;code&gt;GROQ_API_KEY&lt;/code&gt;. The response is normalized into summary text, model metadata, and usage information for the UI.&lt;/p&gt;

&lt;p&gt;The important rule is simple: &lt;strong&gt;the client never receives the Groq credential&lt;/strong&gt;. Local development uses an environment template, while hosted deployments should use the platform's secret manager.&lt;/p&gt;

&lt;h3&gt;
  
  
  Product surface
&lt;/h3&gt;

&lt;p&gt;Sift includes three summary styles—brief, detailed, and bullet points—and three tone presets—neutral, executive, and friendly. The model selector supports GPT-OSS 20B, GPT-OSS 120B, and Groq Compound Mini. The interface also includes loading and error states, a sample input, character/word counts, copy and print actions, and a responsive layout.&lt;/p&gt;

&lt;p&gt;History is deliberately local for this starter kit. Recent summaries are stored in browser storage so the app can demonstrate a useful workflow without introducing a database or user-account dependency. That trade-off keeps the starter kit small; a production product could replace it with authenticated persistence, quotas, and team-level retention policies.&lt;/p&gt;

&lt;h3&gt;
  
  
  What I would improve next
&lt;/h3&gt;

&lt;p&gt;The next practical additions would be streaming output, document upload with extraction limits, request-rate controls, and an evaluation harness that compares summary quality across models and prompt versions. I would also add explicit privacy controls before positioning the app for sensitive business documents.&lt;/p&gt;

&lt;p&gt;I would appreciate feedback on the API boundary and on which extension would make this most useful as a foundation for other AI features.&lt;/p&gt;

&lt;p&gt;Optional time-saver for developers who want the ready-to-deploy codebase: &lt;a href="https://buy.stripe.com/fZueVc5Qm4d31nae5w6wE00" rel="noopener noreferrer"&gt;https://buy.stripe.com/fZueVc5Qm4d31nae5w6wE00&lt;/a&gt;&lt;/p&gt;

</description>
      <category>react</category>
      <category>typescript</category>
    </item>
  </channel>
</rss>
