<?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: luis eduardo</title>
    <description>The latest articles on DEV Community by luis eduardo (@luizgarcg).</description>
    <link>https://dev.to/luizgarcg</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%2F4098825%2F74990417-5b32-49a4-8d2d-a0da38dd199d.jpg</url>
      <title>DEV Community: luis eduardo</title>
      <link>https://dev.to/luizgarcg</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/luizgarcg"/>
    <language>en</language>
    <item>
      <title>How I Built a 100% AI-Generated Document Translator with WCAG AAA &amp; Zero-Data Retention</title>
      <dc:creator>luis eduardo</dc:creator>
      <pubDate>Fri, 28 Aug 2026 12:09:21 +0000</pubDate>
      <link>https://dev.to/luizgarcg/how-i-built-a-100-ai-generated-document-translator-with-wcag-aaa-zero-data-retention-422e</link>
      <guid>https://dev.to/luizgarcg/how-i-built-a-100-ai-generated-document-translator-with-wcag-aaa-zero-data-retention-422e</guid>
      <description>&lt;h1&gt;
  
  
  🚀 Building a 100% AI-Generated Document Translator
&lt;/h1&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Overview:&lt;/strong&gt; A full-stack, production-grade web application created entirely via AI/Vibe Coding. It converts complex legal terms, fine print, and bureaucratic bills into everyday Portuguese while enforcing WCAG AAA accessibility and strict LGPD compliance.&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h2&gt;
  
  
  1. 📌 Introduction
&lt;/h2&gt;

&lt;p&gt;Recently, I set out to test the limits of &lt;strong&gt;Vibe Coding&lt;/strong&gt; by building an end-to-end software product using AI-driven development. &lt;/p&gt;

&lt;p&gt;The result is the &lt;strong&gt;Real-World Document Translator&lt;/strong&gt; (&lt;em&gt;Tradutor de Documentos da Vida Real&lt;/em&gt;). Its goal is to bridge the accessibility gap for elderly individuals, people with low vision, and folks with limited literacy—allowing anyone to understand legal and financial contracts without needing a lawyer.&lt;/p&gt;




&lt;h2&gt;
  
  
  2. 🎯 The Challenge
&lt;/h2&gt;

&lt;p&gt;Translating legal documents through AI presents two major technical hurdles:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Challenge&lt;/th&gt;
&lt;th&gt;Impact / Risk&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Privacy &amp;amp; LGPD&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Raw documents contain sensitive PII (CPFs, bank accounts, emails). Standard regex fails due to OCR noise (broken numbers, homoglyphs).&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Accessibility&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Most web tools ignore low-vision users and the elderly, lacking high contrast, scalable typography, and native screen reader tools.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;




&lt;h2&gt;
  
  
  3. 💡 Technical Solution &amp;amp; Architecture
&lt;/h2&gt;

&lt;p&gt;Through iterative prompting and AI engineering, we designed a zero-trust, highly accessible architecture.&lt;/p&gt;

&lt;h3&gt;
  
  
  🛡️ Cybersecurity &amp;amp; Privacy (LGPD by Design)
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;BFF (Backend for Frontend):&lt;/strong&gt; Built with &lt;strong&gt;FastAPI&lt;/strong&gt; to keep API keys secure inside &lt;code&gt;.env&lt;/code&gt; variables.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;OCR-Resilient PII Sanitizer:&lt;/strong&gt; Automatically normalizes homoglyphs and masks sensitive data before sending prompts to the LLM.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Zero-Data Retention:&lt;/strong&gt; 100% ephemeral processing—no database, no disk storage, instant memory sanitization.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Upload Security:&lt;/strong&gt; Inspects &lt;strong&gt;Magic Bytes&lt;/strong&gt; and enforces strict file limits to block malicious uploads.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  👁️ Universal Accessibility (WCAG AAA)
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Dynamic Typography:&lt;/strong&gt; Controls ($A-$, $A$, $A+$) paired with a minimum $48\text{px}$ touch area for mobile/keyboard usability.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Native Text-to-Speech (TTS):&lt;/strong&gt; Web Speech API integration with slowed playback controls tailored for elderly users.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  🏗️ System Architecture Flow
&lt;/h3&gt;

&lt;p&gt;[ User ] ───▶️ [ Accessible Frontend (HTML/CSS/JS) ]&lt;br&gt;
│&lt;br&gt;
▼&lt;br&gt;
[ Secure BFF (FastAPI) ]&lt;br&gt;
├── File Validation (Magic Bytes)&lt;br&gt;
├── PII Sanitization (OCR-Resilient)&lt;br&gt;
└── API Key Guard (.env)&lt;br&gt;
│&lt;br&gt;
▼&lt;br&gt;
[ Google Gemini API / Mock AI ]&lt;/p&gt;




&lt;h2&gt;
  
  
  4. 🌐 Real-World Application
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Digital Inclusion:&lt;/strong&gt; Empowers vulnerable groups to independently review financial, rental, and legal agreements.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Enterprise Privacy Standards:&lt;/strong&gt; The OCR-resilient PII masking module can be integrated into banking, healthcare, and HR platforms handling sensitive documentation.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Zero-Cost Local Sandbox:&lt;/strong&gt; Features a &lt;strong&gt;Smart Mock AI mode&lt;/strong&gt;, allowing developers to run and test full accessibility workflows locally without incurring API charges.&lt;/li&gt;
&lt;/ol&gt;




&lt;h2&gt;
  
  
  5. 🧠 Reflection &amp;amp; Career Impact
&lt;/h2&gt;

&lt;p&gt;Building this project 100% through AI was a major technical milestone. It proved that Vibe Coding isn't just about speeding up syntax—it's about directing AI to construct &lt;strong&gt;secure, accessible, and architecturally sound systems&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Key takeaways from this build:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Advanced &lt;strong&gt;FastAPI&lt;/strong&gt; backend structure and custom security pipelines.&lt;/li&gt;
&lt;li&gt;Accessible front-end design complying with WCAG AAA standards.&lt;/li&gt;
&lt;li&gt;Stress testing anonymization logic against dirty OCR data using &lt;strong&gt;PyTest&lt;/strong&gt;.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  🛠️ Quick Start Guide
&lt;/h2&gt;

&lt;p&gt;Want to test it locally? Follow these simple steps using Python 3.10+:&lt;/p&gt;




&lt;h2&gt;
  
  
  🔗 Links &amp;amp; Live Demo
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;🌐 &lt;strong&gt;Live Application:&lt;/strong&gt; &lt;a href="https://luizgarcg.github.io/tradutor-documentos/" rel="noopener noreferrer"&gt;Tradutor de Documentos da Vida Real&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;📁 &lt;strong&gt;GitHub Repository:&lt;/strong&gt; &lt;a href="https://github.com/luizgarcg/tradutor-documentos" rel="noopener noreferrer"&gt;luizgarcg/tradutor-documentos&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;






&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
bash
# 1. Clone repo &amp;amp; install dependencies
pip install -r backend/requirements.txt

# 2. Run the application
python backend/server.py

# 3. Open [http://127.0.0.1:8000](http://127.0.0.1:8000) in your browser
Note: If no Gemini API key is configured, the server automatically defaults to Smart Mock AI mode for instant offline testing!


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

&lt;/div&gt;

</description>
      <category>ai</category>
      <category>python</category>
      <category>webdev</category>
      <category>api</category>
    </item>
  </channel>
</rss>
