<?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>Forem: Gamey001</title>
    <description>The latest articles on Forem by Gamey001 (@gamey001).</description>
    <link>https://forem.com/gamey001</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%2F3574310%2Fb8575ae0-c447-4331-8714-d0fcbc45f0d1.png</url>
      <title>Forem: Gamey001</title>
      <link>https://forem.com/gamey001</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/gamey001"/>
    <language>en</language>
    <item>
      <title>Telex Weather Agent</title>
      <dc:creator>Gamey001</dc:creator>
      <pubDate>Wed, 05 Nov 2025 20:34:57 +0000</pubDate>
      <link>https://forem.com/gamey001/telex-weather-agent-d9m</link>
      <guid>https://forem.com/gamey001/telex-weather-agent-d9m</guid>
      <description>&lt;h1&gt;
  
  
  🌦️ Telex Weather Agent — FastAPI + Railway + Telex.im
&lt;/h1&gt;

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

&lt;p&gt;This project is my &lt;strong&gt;Stage 3 Backend Task&lt;/strong&gt; for &lt;strong&gt;HNG Internship&lt;/strong&gt;.&lt;br&gt;&lt;br&gt;
I built an &lt;strong&gt;AI-powered Weather Agent&lt;/strong&gt; that integrates with &lt;strong&gt;&lt;a href="https://telex.im" rel="noopener noreferrer"&gt;Telex.im&lt;/a&gt;&lt;/strong&gt; — a platform for intelligent AI coworker agents.  &lt;/p&gt;

&lt;p&gt;The agent helps users fetch real-time weather data for any city in the world using &lt;strong&gt;FastAPI&lt;/strong&gt;, deployed on &lt;strong&gt;Railway&lt;/strong&gt;, and connected to &lt;strong&gt;Telex&lt;/strong&gt; via the &lt;strong&gt;A2A protocol&lt;/strong&gt;.&lt;/p&gt;




&lt;h2&gt;
  
  
  🧠 What the Agent Does
&lt;/h2&gt;

&lt;p&gt;The &lt;strong&gt;Telex Weather Agent&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Accepts a city name as input from Telex conversations.&lt;/li&gt;
&lt;li&gt;Fetches current weather data from the &lt;strong&gt;OpenWeather API&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Returns a concise and human-friendly weather summary.&lt;/li&gt;
&lt;li&gt;Handles invalid or missing inputs gracefully.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Example Interaction&lt;/strong&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;User: "What's the weather in Lagos?"&lt;br&gt;&lt;br&gt;
Agent: "The weather in Lagos is 30°C, clear sky, humidity 78%, and wind speed 3.2 m/s."&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h2&gt;
  
  
  🧩 Tech Stack
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Component&lt;/th&gt;
&lt;th&gt;Technology&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Language&lt;/td&gt;
&lt;td&gt;Python&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Framework&lt;/td&gt;
&lt;td&gt;FastAPI&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Hosting&lt;/td&gt;
&lt;td&gt;Railway&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;API&lt;/td&gt;
&lt;td&gt;OpenWeatherMap&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Integration&lt;/td&gt;
&lt;td&gt;Telex.im (A2A Protocol)&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;




&lt;h2&gt;
  
  
  ⚙️ Project Structure
&lt;/h2&gt;

</description>
      <category>agents</category>
      <category>showdev</category>
      <category>python</category>
      <category>ai</category>
    </item>
    <item>
      <title>Building a Dynamic Profile API with FastAPI</title>
      <dc:creator>Gamey001</dc:creator>
      <pubDate>Sun, 19 Oct 2025 19:59:01 +0000</pubDate>
      <link>https://forem.com/gamey001/building-a-dynamic-profile-api-with-fastapi-43ea</link>
      <guid>https://forem.com/gamey001/building-a-dynamic-profile-api-with-fastapi-43ea</guid>
      <description>&lt;p&gt;🎯 Task Overview&lt;/p&gt;

&lt;p&gt;In Stage 0 of hng13 backend, the goal was simple but powerful:&lt;/p&gt;

&lt;p&gt;Build a RESTful API endpoint /me that returns your profile details along with a random cat fact fetched dynamically from an external API.&lt;/p&gt;

&lt;p&gt;*&lt;em&gt;This task tested our understanding of:&lt;br&gt;
*&lt;/em&gt;&lt;br&gt;
API design with proper JSON structure&lt;/p&gt;

&lt;p&gt;Integrating external APIs&lt;/p&gt;

&lt;p&gt;Handling network errors gracefully&lt;/p&gt;

&lt;p&gt;Returning dynamic UTC timestamps&lt;/p&gt;

&lt;p&gt;Deploying a small but complete backend app&lt;/p&gt;

&lt;p&gt;🧩 Stack &amp;amp; Tools&lt;/p&gt;

&lt;p&gt;Language: Python&lt;/p&gt;

&lt;p&gt;Framework: FastAPI 🏎️&lt;/p&gt;

&lt;p&gt;HTTP Client: Requests&lt;/p&gt;

&lt;p&gt;Environment Management: python-dotenv&lt;/p&gt;

&lt;p&gt;Deployment: Railway&lt;/p&gt;

&lt;p&gt;Testing: cURL &amp;amp; browser&lt;/p&gt;

&lt;p&gt;⚙️ Project Setup&lt;br&gt;
🗂️ Structure&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;backend-wizards-stage0/
│
├── app/
│   ├── main.py
│   ├── config.py
│   └── utils/
│       └── cat_facts.py
├── requirements.txt
├── .env
├── Procfile
└── README.md

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;🧱 Main Endpoint&lt;/p&gt;

&lt;p&gt;The /me endpoint returns:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{
  "status": "success",
  "user": {
    "email": "youremail@example.com",
    "name": "Your Full Name",
    "stack": "Python/FastAPI"
  },
  "timestamp": "2025-10-19T11:52:23.789Z",
  "fact": "Cats sleep for around 13 to 14 hours a day."
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;⚡ Core Logic (simplified)&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;@app.get("/me")
async def get_profile():
    timestamp = datetime.now(timezone.utc).isoformat()
    response = {
        "status": "success",
        "user": {
            "email": Config.USER_EMAIL,
            "name": Config.USER_NAME,
            "stack": Config.USER_STACK
        },
        "timestamp": timestamp,
        "fact": fetch_cat_fact()
    }
    return JSONResponse(content=response)

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;*&lt;em&gt;Each request dynamically:&lt;br&gt;
*&lt;/em&gt;&lt;br&gt;
Fetches a new cat fact from Cat Facts API&lt;/p&gt;

&lt;p&gt;Generates a fresh UTC timestamp&lt;/p&gt;

&lt;p&gt;Returns all data in a consistent JSON schema&lt;/p&gt;

&lt;p&gt;🧠 What I Learned&lt;br&gt;
1️⃣ Working with External APIs&lt;/p&gt;

&lt;p&gt;Using the requests library, I learned to:&lt;/p&gt;

&lt;p&gt;Handle timeouts and connection errors&lt;/p&gt;

&lt;p&gt;Extract specific JSON keys safely&lt;/p&gt;

&lt;p&gt;Return fallback messages when the API fails&lt;/p&gt;

&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;def fetch_cat_fact():
    try:
        res = requests.get("https://catfact.ninja/fact", timeout=5)
        res.raise_for_status()
        return res.json().get("fact")
    except requests.RequestException:
        return "Could not fetch cat fact at the moment."

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;*&lt;em&gt;Error Handling Matters&lt;br&gt;
*&lt;/em&gt;&lt;br&gt;
Instead of letting the entire app crash when the Cat Facts API fails, the function gracefully returns a friendly message.&lt;br&gt;
This makes the API robust and user-friendly — a key real-world backend skill.&lt;/p&gt;

&lt;p&gt;3️⃣ Dynamic Data and Time Formatting&lt;/p&gt;

&lt;p&gt;I learned how to generate ISO 8601 UTC timestamps:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;datetime.now(timezone.utc).isoformat()
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Every new request shows a fresh timestamp ⏰ — confirming the endpoint is truly dynamic.&lt;/p&gt;

&lt;p&gt;4️⃣ Deployment &amp;amp; Environment Variables&lt;/p&gt;

&lt;p&gt;This task reinforced best practices:&lt;/p&gt;

&lt;p&gt;Keeping sensitive data (like name/email) in a .env file&lt;/p&gt;

&lt;p&gt;Configuring environment variables in the hosting platform (Railway)&lt;/p&gt;

&lt;p&gt;Using a Procfile to define the startup command&lt;/p&gt;

&lt;p&gt;My Procfile:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;web: uvicorn app.main:app --host 0.0.0.0 --port ${PORT:-8000}

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Deployment on Railway was smooth:&lt;/p&gt;

&lt;p&gt;Push code to GitHub&lt;/p&gt;

&lt;p&gt;Connect repo on Railway&lt;/p&gt;

&lt;p&gt;Add environment variables (USER_EMAIL, USER_NAME, USER_STACK)&lt;/p&gt;

&lt;p&gt;Deploy 🚀&lt;/p&gt;

&lt;p&gt;Visit &lt;a href="https://yourappurl.up.railway.app/me" rel="noopener noreferrer"&gt;https://yourappurl.up.railway.app/me&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;📸 Screenshots&lt;/p&gt;

&lt;p&gt;(Add screenshots here of your running API on localhost and on Railway)&lt;/p&gt;

&lt;p&gt;✅ Local run on &lt;a href="http://127.0.0.1:8000/me" rel="noopener noreferrer"&gt;http://127.0.0.1:8000/me&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;☁️ Live endpoint showing real-time cat facts&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{
  "status": "success",
  "user": {
    "email": "jdoe@example.com",
    "name": "John Doe",
    "stack": "Python/FastAPI"
  },
  "timestamp": "2025-10-19T13:09:45.123Z",
  "fact": "Cats use their whiskers to detect objects and navigate tight spaces."
}

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;💡 Takeaways&lt;/p&gt;

&lt;p&gt;A small API can teach big backend fundamentals — request handling, responses, error management, and clean JSON formatting.&lt;/p&gt;

&lt;p&gt;Using FastAPI makes development extremely fast and intuitive with automatic docs at /docs.&lt;/p&gt;

&lt;p&gt;I learned to appreciate clean error handling, environment separation, and deployment best practices.&lt;/p&gt;

&lt;p&gt;🏁 Final Thoughts&lt;/p&gt;

&lt;p&gt;This task reminded me that clarity + consistency = good backend design.&lt;br&gt;
Even a simple endpoint like /me can demonstrate:&lt;/p&gt;

&lt;p&gt;Professional structure&lt;/p&gt;

&lt;p&gt;Error resilience&lt;/p&gt;

&lt;p&gt;Proper documentation&lt;/p&gt;

&lt;p&gt;You can check out the GitHub repository here:&lt;br&gt;
👉 GitHub Repo&lt;/p&gt;

&lt;p&gt;And the live API here:&lt;br&gt;
👉 Live Endpoint&lt;a href="https://web-production-0489.up.railway.app/me" rel="noopener noreferrer"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Author: Gamaliel Dashua&lt;/p&gt;

&lt;p&gt;Stack: Python / FastAPI&lt;br&gt;
Challenge: Hng13 - Backend Stage 0 🚀&lt;/p&gt;

</description>
      <category>api</category>
      <category>python</category>
      <category>tutorial</category>
      <category>backend</category>
    </item>
  </channel>
</rss>
