<?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: Name cannot be blank</title>
    <description>The latest articles on DEV Community by Name cannot be blank (@lostklan).</description>
    <link>https://dev.to/lostklan</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%2F97636%2Fb7e05c79-400d-41fe-8c51-cc3d0d9917ad.jpg</url>
      <title>DEV Community: Name cannot be blank</title>
      <link>https://dev.to/lostklan</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/lostklan"/>
    <language>en</language>
    <item>
      <title>Agent Lagbaja</title>
      <dc:creator>Name cannot be blank</dc:creator>
      <pubDate>Fri, 07 Nov 2025 13:47:47 +0000</pubDate>
      <link>https://dev.to/lostklan/agent-lagbaja-3c86</link>
      <guid>https://dev.to/lostklan/agent-lagbaja-3c86</guid>
      <description>&lt;h2&gt;
  
  
  Building Lagbaja: An AI-Powered Flashcard Generator
&lt;/h2&gt;

&lt;p&gt;&lt;em&gt;A production-ready A2A service that transforms PDFs into intelligent study flashcards&lt;/em&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  Overview
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Lagbaja&lt;/strong&gt; is an Agent-to-Agent (A2A) compliant backend service that converts PDF documents and text into study flashcards using Google's Gemini AI. It follows JSON-RPC 2.0 protocol, integrates with workflow platforms like Telex, and supports multiple input methods.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Problem
&lt;/h2&gt;

&lt;p&gt;Students need to convert lengthy study materials into digestible, testable content. Most flashcard tools require manual input and don't intelligently extract key concepts. Lagbaja solves this by:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Automatically generating flashcards from PDFs and text using AI&lt;/li&gt;
&lt;li&gt;Following A2A protocol for seamless agent-to-agent communication&lt;/li&gt;
&lt;li&gt;Supporting JSON-RPC 2.0 for standardized messaging&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Architecture Overview
&lt;/h2&gt;

&lt;p&gt;Lagbaja follows a clean, layered architecture built with Go 1.25.3:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;HTTP Server → Handler Layer → Service Layer → External APIs
    ↓             ↓              ↓              ↓
  /a2a        A2AHandler    FlashcardSvc    Gemini AI
  /upload                   PDFService      PDF Parser
  /health
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Key Components:&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;HTTP Server&lt;/strong&gt; (&lt;code&gt;main.go&lt;/code&gt;) - Routing, middleware, graceful shutdown&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Handler Layer&lt;/strong&gt; - JSON-RPC 2.0 and A2A message processing&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Service Layer&lt;/strong&gt; - Business logic for PDF processing and flashcard generation&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Models&lt;/strong&gt; - A2A, JSON-RPC, and domain structures&lt;/li&gt;
&lt;/ol&gt;




&lt;h2&gt;
  
  
  Key Features
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Multiple Input Methods
&lt;/h3&gt;

&lt;p&gt;Lagbaja accepts requests in three ways:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="err"&gt;//&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;Text&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;Input&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nl"&gt;"message"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nl"&gt;"parts"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[{&lt;/span&gt;&lt;span class="nl"&gt;"text"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Create flashcards about photosynthesis"&lt;/span&gt;&lt;span class="p"&gt;}]}}&lt;/span&gt;&lt;span class="w"&gt;

&lt;/span&gt;&lt;span class="err"&gt;//&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;PDF&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;URL&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nl"&gt;"message"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nl"&gt;"parts"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[{&lt;/span&gt;&lt;span class="nl"&gt;"text"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"https://example.com/notes.pdf"&lt;/span&gt;&lt;span class="p"&gt;}]}}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# File Upload&lt;/span&gt;
curl &lt;span class="nt"&gt;-X&lt;/span&gt; POST /upload &lt;span class="nt"&gt;-F&lt;/span&gt; &lt;span class="s2"&gt;"pdf=@notes.pdf"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Protocol Compliance
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;JSON-RPC 2.0&lt;/strong&gt;: Standard error codes (-32700 to -32603), proper request/response format&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;A2A Protocol&lt;/strong&gt;: Task management, structured artifacts, message history&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"result"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"status"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nl"&gt;"state"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"completed"&lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"artifacts"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[{&lt;/span&gt;&lt;span class="nl"&gt;"name"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"flashcardSet"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"parts"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="err"&gt;...&lt;/span&gt;&lt;span class="p"&gt;]}],&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"history"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="err"&gt;...&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  AI Generation
&lt;/h3&gt;

&lt;p&gt;Uses Google Gemini (gemini-1.5-flash) to analyze content and generate 5-10 focused flashcards with questions, answers, and topic categorization.&lt;/p&gt;




&lt;h2&gt;
  
  
  Technical Decisions
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Why Go?
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Built-in concurrency with goroutines&lt;/li&gt;
&lt;li&gt;Excellent HTTP and JSON standard library&lt;/li&gt;
&lt;li&gt;Single binary deployment&lt;/li&gt;
&lt;li&gt;Fast performance and low memory footprint&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Why Gemini over Anthropic?
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Primary reason&lt;/strong&gt;: Anthropic API credit limitations. Gemini's generous free tier enabled continued development and production deployment.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Additional benefits&lt;/strong&gt;: Simpler API, faster responses, native Google ecosystem integration.&lt;/p&gt;

&lt;h3&gt;
  
  
  Middleware Design
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight go"&gt;&lt;code&gt;&lt;span class="c"&gt;// Method enforcement + request logging&lt;/span&gt;
&lt;span class="n"&gt;mux&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Handle&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"/a2a"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;loggingMiddleware&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;methodGuard&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;handler&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"POST"&lt;/span&gt;&lt;span class="p"&gt;)))&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Clean separation of concerns keeps handlers focused on business logic.&lt;/p&gt;




&lt;h2&gt;
  
  
  Testing
&lt;/h2&gt;

&lt;p&gt;Comprehensive test coverage with 11 suites and 23 test cases (100% pass rate):&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;HTTP method validation&lt;/li&gt;
&lt;li&gt;JSON-RPC protocol compliance&lt;/li&gt;
&lt;li&gt;Message parsing and validation&lt;/li&gt;
&lt;li&gt;PDF processing and text extraction&lt;/li&gt;
&lt;li&gt;Flashcard formatting and generation
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;go &lt;span class="nb"&gt;test&lt;/span&gt; ./... &lt;span class="nt"&gt;-v&lt;/span&gt;  &lt;span class="c"&gt;# All tests passing&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Telex Integration
&lt;/h2&gt;

&lt;p&gt;Lagbaja integrates with Telex workflows via &lt;code&gt;workflow.json&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"category"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"education"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"nodes"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"type"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"a2a/mastra-a2a-node"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"url"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"http://lagbaja-production.up.railway.app/a2a"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"parameters"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"model"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"gemini-1.5-flash"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"httpMethod"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"POST"&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;}]&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This enables workflow platforms to discover and communicate with Lagbaja automatically.&lt;/p&gt;




&lt;h2&gt;
  
  
  Deployment
&lt;/h2&gt;

&lt;p&gt;Deployed on Railway with automatic builds:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;GEMINI_API_KEY&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&amp;lt;key&amp;gt;
&lt;span class="nv"&gt;PORT&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;8080
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Includes graceful shutdown, health checks, and request timeouts for production reliability.&lt;/p&gt;




&lt;h2&gt;
  
  
  Usage Example
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl &lt;span class="nt"&gt;-X&lt;/span&gt; POST https://lagbaja-production.up.railway.app/a2a &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-H&lt;/span&gt; &lt;span class="s2"&gt;"Content-Type: application/json"&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-d&lt;/span&gt; &lt;span class="s1"&gt;'{
    "jsonrpc": "2.0",
    "id": "test",
    "method": "message/send",
    "params": {
      "message": {
        "parts": [{"kind": "text", "text": "Create flashcards about quantum mechanics"}]
      }
    }
  }'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Response&lt;/strong&gt;: Structured flashcards with questions, answers, and topics in both text and JSON format.&lt;/p&gt;




&lt;h2&gt;
  
  
  Key Takeaways
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Protocol Compliance&lt;/strong&gt;: Following JSON-RPC 2.0 and A2A specs enables seamless integration&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Testing&lt;/strong&gt;: Comprehensive tests (23 cases) ensure reliability&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Pragmatic Choices&lt;/strong&gt;: Switched to Gemini due to Anthropic credit limits—practical constraints drive good decisions&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Clean Architecture&lt;/strong&gt;: Layered design with middleware keeps code maintainable&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Future Enhancements
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Batch PDF processing&lt;/li&gt;
&lt;li&gt;Custom flashcard templates&lt;/li&gt;
&lt;li&gt;Anki/Quizlet export formats&lt;/li&gt;
&lt;li&gt;Caching for repeated requests&lt;/li&gt;
&lt;li&gt;API authentication&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Try It
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Live&lt;/strong&gt;: &lt;code&gt;https://lagbaja-production.up.railway.app/a2a&lt;/code&gt;&lt;br&gt;&lt;br&gt;
&lt;strong&gt;Code&lt;/strong&gt;: &lt;code&gt;https://github.com/tobey0x/lagbaja&lt;/code&gt;&lt;br&gt;&lt;br&gt;
&lt;strong&gt;Quick Start&lt;/strong&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git clone https://github.com/tobey0x/lagbaja
&lt;span class="nb"&gt;cd &lt;/span&gt;lagbaja
&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"GEMINI_API_KEY=your-key"&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; .env
go run main.go
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;p&gt;&lt;em&gt;Built with Go 1.25.3 • Google Gemini AI • Deployed on Railway&lt;/em&gt;&lt;/p&gt;

</description>
      <category>agents</category>
      <category>gemini</category>
      <category>ai</category>
      <category>showdev</category>
    </item>
    <item>
      <title>Zero Day at HNGi13</title>
      <dc:creator>Name cannot be blank</dc:creator>
      <pubDate>Tue, 21 Oct 2025 10:59:11 +0000</pubDate>
      <link>https://dev.to/lostklan/zero-day-at-hngi13-27l7</link>
      <guid>https://dev.to/lostklan/zero-day-at-hngi13-27l7</guid>
      <description>&lt;h2&gt;
  
  
  Context and Goal
&lt;/h2&gt;

&lt;p&gt;This task involved creating a simple API endpoint (&lt;code&gt;/me&lt;/code&gt;) in any language and framework of choice so opted to using the Gin framework in Go. The critical requirement was that the API's response payload needed to include fresh data fetched from an external, third-party service &lt;a href="//%20raw%20`catfact.ninja`%20endraw%20"&gt;Cat Fact&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Why have I chosen Go? I'm currently learning Go and this serves as an opportunity to make it a project based learning.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Core Lesson: Outgoing Traffic Control
&lt;/h2&gt;

&lt;p&gt;The important architectural choice I faced was how to protect the third-party API from me. If my service goes viral(laughs) and gets 1,000 requests per second, I cannot afford to forward 1,000 requests to &lt;code&gt;catfact.ninja.&lt;/code&gt; This would certainly cause me to be blocked.&lt;/p&gt;

&lt;p&gt;Hence, I resorted to limiting outgoing traffic by implementing a Token Bucket using golang's &lt;a href="//%20raw%20`golang.org/x/time/rate`%20endraw%20"&gt;rate&lt;/a&gt; package to strictly control the flow leaving my service (strict 0.5 requests per second).&lt;/p&gt;

&lt;p&gt;If a request attempts to call the external API but the bucket is empty, we return a &lt;strong&gt;429 Too Many Requests&lt;/strong&gt; to the client, protecting the external service from my own overload.&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%2F56t7w34zcbkob1y6pxxw.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%2F56t7w34zcbkob1y6pxxw.png" alt="code snippet: rate limiting" width="752" height="715"&gt;&lt;/a&gt;&lt;br&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%2Fe7nugfgibixwgm8jlgvr.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%2Fe7nugfgibixwgm8jlgvr.png" alt="API response" width="759" height="371"&gt;&lt;/a&gt;&lt;/p&gt;

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

&lt;p&gt;It seems I've successfully built an API endpoint that is not only functional but is also resilient (with Timeouts), reliable (with UTC timestamps), and architecturally sound (with proper traffic control). Also, I hope I have not bitten more than I can chew by joining the rigorous HNG Internship while learning a new language.&lt;/p&gt;

</description>
      <category>go</category>
      <category>api</category>
      <category>learning</category>
      <category>backend</category>
    </item>
  </channel>
</rss>
