--- title: Dark Patterns Consumer Shield emoji: 🛡️ colorFrom: blue colorTo: blue sdk: gradio sdk_version: 6.16.0 python_version: 3.13 app_file: app.py pinned: false license: apache-2.0 short_description: Serverless e-commerce dark patterns audit & scan tool. --- # 🛡️ Dark-Patterns Consumer Shield (E-Commerce Protection) > **A Low-Latency Web Vulnerability Scanner, Serverless Consumer Compliance Guard & Pattern Auditor.** > *Submitted for the Hugging Face Build Small Hackathon (Track 2: Performance & Efficiency Optimization).* --- ## 📽️ Project Demonstration & Walkthrough Check out the full workflow, speed metrics, and detection mechanics in action here: 🔗 **[Watch the Live Demo on TikTok](https://www.tiktok.com/@salarai123/video/7648566501598940436)** --- ## 🔍 The Deceptive E-Commerce Problem Modern e-commerce retail networks deploy malicious UI/UX layouts known as **Dark Patterns** (such as artificial stock scarcity tickers, forced hidden auto-renew terms, and masked transaction handling fees) to manipulate consumers into unintended financial transactions. Auditing these threat vectors traditionally requires connecting to massive neural compute architectures—creating substantial tracking latency, operational pricing spikes, and severe privacy data leak risks. ## ⚡ The Solution: Consumer Shield This tool provides an instantaneous, offline-capable verification pipeline that checks scraped web copies inside an isolated frontend container. By evaluating raw text tokens against a specialized structural detection engine, the code completely eliminates cloud reliance. It scores e-commerce sites dynamically and flags multi-tier consumer violations with zero latency metrics (<5ms execution speed). --- ## ⚡ Technical Core Architectures * **Stateless Token Boundary Scanning:** Uses lightweight localized regular expression streams to scan incoming textual DOM parameters, isolating pattern footprints (e.g., Hidden Fees, False Urgency) instantly. * **Threat Index Evaluation Matrix:** Computes threat scores dynamically based on detected violation frequencies, executing immediate safety levels without massive deep learning parameters. * **Strict Inline Component Rendering:** Implements clean inline document-object styling variables to enforce complete visual theme data contrast for both normal users and platform reviewers. * **Edge System Optimization Layout:** Developed explicitly to function flawlessly on minimal developer configurations (Intel i3 / 8GB RAM setups) with absolute zero system lag or infrastructure dependencies. --- ## 🏆 Pitch to the Hackathon Jury "Dark-Patterns Consumer Shield demonstrates how localized string tokenization and lightweight heuristic validation can secure web transactions without the carbon footprint of massive transformer models. By shifting complex pattern matching directly to the browser edge layer, this deployment satisfies the strict constraints of the Build Small framework—delivering immediate real-world consumer protection at zero platform scaling costs." *Engineered by Salar Ahsan for the Hugging Face Build Small Hackathon 2026.* 🚀