<?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: Yousaf Khalil</title>
    <description>The latest articles on DEV Community by Yousaf Khalil (@yousafk279).</description>
    <link>https://dev.to/yousafk279</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%2F3783970%2F0712fa6b-b709-4cae-bf7f-44d5b79b30c9.jpg</url>
      <title>DEV Community: Yousaf Khalil</title>
      <link>https://dev.to/yousafk279</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/yousafk279"/>
    <language>en</language>
    <item>
      <title>How I Built a Visioryx Forensic Engine with FastAPI and BLIP 🛡️</title>
      <dc:creator>Yousaf Khalil</dc:creator>
      <pubDate>Fri, 06 Mar 2026 18:10:51 +0000</pubDate>
      <link>https://dev.to/yousafk279/how-i-built-a-visioryx-forensic-engine-with-fastapi-and-blip-3kbh</link>
      <guid>https://dev.to/yousafk279/how-i-built-a-visioryx-forensic-engine-with-fastapi-and-blip-3kbh</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%2Fpplpl76rj8u4ef7f0hmm.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%2Fpplpl76rj8u4ef7f0hmm.jpg" alt=" " width="800" height="833"&gt;&lt;/a&gt;&lt;br&gt;
Most AI image captioners just tell you what is in the picture. I wanted to build something deeper. I built Visioryx to bridge the gap between Neural Scene Intelligence and Digital Hardware Forensics.&lt;br&gt;
Key Engineering Wins:&lt;/p&gt;

&lt;p&gt;Multimodal Analysis: Integrated the Salesforce/blip-image-captioning-base model to transform pixels into descriptive natural language.&lt;/p&gt;

&lt;p&gt;Metadata Recovery: Engineered a Python-based forensic layer using PIL to extract hidden EXIF headers (Camera Model, ISO, Aperture).&lt;/p&gt;

&lt;p&gt;The "Scrubbed Data" Problem: One of my biggest challenges was handling images from platforms like Unsplash or Facebook that strip metadata. I implemented a fallback logic that identifies "Data Stripping" as a forensic state rather than a system failure.&lt;/p&gt;

&lt;p&gt;Full-Stack Utility: Designed a custom Glassmorphic UI and an automated PDF report generator for professional hand-offs.&lt;/p&gt;

&lt;p&gt;The Stack:&lt;/p&gt;

&lt;p&gt;Backend: FastAPI / Uvicorn&lt;/p&gt;

&lt;p&gt;AI Logic: PyTorch / Transformers&lt;/p&gt;

&lt;p&gt;Frontend: Tailwind CSS&lt;/p&gt;

&lt;p&gt;Live Demo: &lt;a href="https://huggingface.co/spaces/yousafk279/Visioryx" rel="noopener noreferrer"&gt;https://huggingface.co/spaces/yousafk279/Visioryx&lt;/a&gt;&lt;br&gt;
Open Source: &lt;a href="https://github.com/yousafk279/visioryx" rel="noopener noreferrer"&gt;https://github.com/yousafk279/visioryx&lt;/a&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>How I Solved the "API Cost" Problem with a Dual-Mode Engine in FastAPI</title>
      <dc:creator>Yousaf Khalil</dc:creator>
      <pubDate>Tue, 24 Feb 2026 21:31:15 +0000</pubDate>
      <link>https://dev.to/yousafk279/how-i-solved-the-api-cost-problem-with-a-dual-mode-engine-in-fastapi-1d5a</link>
      <guid>https://dev.to/yousafk279/how-i-solved-the-api-cost-problem-with-a-dual-mode-engine-in-fastapi-1d5a</guid>
      <description>&lt;p&gt;The Problem&lt;br&gt;
Like many developers building portfolio projects, I wanted to integrate the Twilio SMS API. However, I faced two hurdles: 1) Managing API costs and 2) Ensuring my project remained functional for recruiters even if my credentials were inactive.&lt;/p&gt;

&lt;p&gt;The Solution: The Dual-Mode Architecture&lt;br&gt;
Instead of letting the app crash, I engineered a logic gate using Python's os.getenv.&lt;/p&gt;

&lt;p&gt;if SID and TOKEN and NUMBER:&lt;br&gt;
    # Real API logic&lt;br&gt;
else:&lt;br&gt;
    # Demo Mode logic&lt;/p&gt;

&lt;p&gt;Key Features I Implemented:&lt;/p&gt;

&lt;p&gt;State Simulation: In Demo Mode, the backend uses asyncio.sleep to simulate network latency, providing a high-fidelity experience.&lt;/p&gt;

&lt;p&gt;Local Persistence: Every message—demo or real—is committed to a local SQLite database to ensure an audit trail exists.&lt;/p&gt;

&lt;p&gt;Data Portability: I added a StreamingResponse endpoint to export database logs as a CSV file directly to the user's machine.&lt;/p&gt;

&lt;p&gt;UI Polish: As a Graphic Designer, I couldn't settle for a basic form. I used Tailwind CSS to build a glassmorphism "Cyberpunk" console that reflects the high-stakes nature of a dispatch system.&lt;/p&gt;

&lt;h1&gt;
  
  
  python #fastapi #webdev #showdev #api #coding
&lt;/h1&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%2Fvo2uky9qjsdwciq8tgim.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%2Fvo2uky9qjsdwciq8tgim.png" alt=" " width="800" height="361"&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%2Fgfjralqoixs5y1ippuqe.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%2Fgfjralqoixs5y1ippuqe.png" alt=" " width="800" height="340"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>api</category>
      <category>backend</category>
      <category>fastapi</category>
      <category>python</category>
    </item>
    <item>
      <title>Building a Resilient Financial Engine: How I Fixed a Data Duplication Bug with Idempotent SQL</title>
      <dc:creator>Yousaf Khalil</dc:creator>
      <pubDate>Sat, 21 Feb 2026 13:48:16 +0000</pubDate>
      <link>https://dev.to/yousafk279/building-a-resilient-financial-engine-how-i-fixed-a-data-duplication-bug-with-idempotent-sql-27jn</link>
      <guid>https://dev.to/yousafk279/building-a-resilient-financial-engine-how-i-fixed-a-data-duplication-bug-with-idempotent-sql-27jn</guid>
      <description>&lt;p&gt;Most developers hide their bugs. I prefer to document them.&lt;/p&gt;

&lt;p&gt;I recently built a full-stack financial dashboard to track budgets and spending. The goal was simple: connect a Python backend to a SQLite3 database and render the output dynamically on a web interface. &lt;/p&gt;

&lt;p&gt;But during testing, I hit a massive logic failure. My migration script was blindly inserting data every time it ran. Instead of my actual balance, my dashboard rendered a massive deficit of $-460.0&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%2F6h4jltb7h6wv2c46pqc5.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%2F6h4jltb7h6wv2c46pqc5.png" alt=" " width="668" height="376"&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%2Fpasgxdif7kyi3hdsq9t2.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%2Fpasgxdif7kyi3hdsq9t2.png" alt=" " width="669" height="376"&gt;&lt;/a&gt;&lt;br&gt;
Here is exactly how I refactored the database logic to enforce data integrity and deployed the final application to the cloud.&lt;/p&gt;

&lt;p&gt;The Tech Stack&lt;br&gt;
Backend: Python&lt;br&gt;
Database: SQLite3&lt;br&gt;
Frontend: HTML5 / CSS3&lt;br&gt;
Hosting: Hugging Face Spaces&lt;/p&gt;

&lt;p&gt;The Problem: Blind Data Insertion&lt;br&gt;
Initially, my Python script was executing simple &lt;code&gt;INSERT&lt;/code&gt; statements without checking if the record already existed. Every time the app initialized, it duplicated the transactions. In a financial application, bad data is worse than a crashed app. A $-460.0 balance on a $500 budget meant my core logic was fundamentally broken.&lt;/p&gt;

&lt;p&gt;The Fix: Idempotency&lt;br&gt;
To fix this, I had to implement Idempotency the concept that an operation can be applied multiple times without changing the result beyond the initial application.&lt;/p&gt;

&lt;p&gt;I updated my SQL execution logic. Instead of blindly inserting data, I leveraged &lt;code&gt;UNIQUE&lt;/code&gt; constraints and &lt;code&gt;INSERT OR IGNORE&lt;/code&gt; (or &lt;code&gt;IF NOT EXISTS&lt;/code&gt; for table creation) in SQLite3. &lt;/p&gt;

&lt;p&gt;By forcing the database engine to handle the validation, I eliminated the duplication at the source. The application could now restart 100 times, and the data would remain perfectly accurate.&lt;/p&gt;

&lt;p&gt;The Result: A Cloud-Hosted Source of Truth&lt;br&gt;
Once the backend logic was secured, the dashboard immediately reflected the verified, mathematically correct balance of $180.0. &lt;/p&gt;

&lt;p&gt;I then packaged the application and deployed it live via Hugging Face Spaces, ensuring standard UTF-8 encoding so the UI rendered cleanly across all browsers. &lt;/p&gt;

&lt;p&gt;Live Links &amp;amp; Code&lt;br&gt;
I’m a big believer in building in public. You can review the idempotent logic in my repository or test the live dashboard yourself.&lt;/p&gt;

&lt;p&gt;💻 Review the Source Code: &lt;a href="https://github.com/yousafk279/Life-Manager-SQL-Engine" rel="noopener noreferrer"&gt;https://github.com/yousafk279/Life-Manager-SQL-Engine&lt;/a&gt;&lt;br&gt;
🚀 Test the Live Dashboard: &lt;a href="https://huggingface.co/spaces/yousafk279/Financial-Integrity-Dashboard" rel="noopener noreferrer"&gt;https://huggingface.co/spaces/yousafk279/Financial-Integrity-Dashboard&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you're building data-driven applications, never trust your initial migration scripts. Enforce idempotency at the database level. &lt;/p&gt;

&lt;p&gt;Let me know in the comments how you handle data validation in your own Python projects!&lt;/p&gt;

</description>
      <category>backend</category>
      <category>database</category>
      <category>python</category>
      <category>sql</category>
    </item>
  </channel>
</rss>
