<?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: Mustafa Güngör</title>
    <description>The latest articles on DEV Community by Mustafa Güngör (@0xstoic_bit).</description>
    <link>https://dev.to/0xstoic_bit</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%2F4104331%2F6ea399c1-1f38-4254-aa5d-e2300bbf5bbe.png</url>
      <title>DEV Community: Mustafa Güngör</title>
      <link>https://dev.to/0xstoic_bit</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/0xstoic_bit"/>
    <language>en</language>
    <item>
      <title>I built an open-source alternative to Cloudflare Turnstile using Fitts's Law and Kinematics</title>
      <dc:creator>Mustafa Güngör</dc:creator>
      <pubDate>Tue, 01 Sep 2026 12:23:05 +0000</pubDate>
      <link>https://dev.to/0xstoic_bit/i-built-an-open-source-alternative-to-cloudflare-turnstile-using-fittss-law-and-kinematics-442</link>
      <guid>https://dev.to/0xstoic_bit/i-built-an-open-source-alternative-to-cloudflare-turnstile-using-fittss-law-and-kinematics-442</guid>
      <description>&lt;p&gt;Hey everyone! 👋&lt;/p&gt;

&lt;p&gt;I’ve always hated intrusive CAPTCHAs and expensive proprietary cloud WAFs. Even the "invisible" ones (like Cloudflare Turnstile or reCAPTCHA v3) are black boxes that collect massive amounts of user telemetry.&lt;/p&gt;

&lt;p&gt;So, I spent the last few months building &lt;strong&gt;Synapse Shield&lt;/strong&gt; — a completely open-source, self-hosted behavioral bot mitigation engine for Python (FastAPI/Django/Flask) and React.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;🔗 &lt;strong&gt;GitHub Repository:&lt;/strong&gt; &lt;a href="https://github.com/0xStoic-bit/Synapse_Shield" rel="noopener noreferrer"&gt;https://github.com/0xStoic-bit/Synapse_Shield&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;📦 &lt;strong&gt;PyPI Package:&lt;/strong&gt; &lt;a href="https://pypi.org/project/synapse-shield/" rel="noopener noreferrer"&gt;https://pypi.org/project/synapse-shield/&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  🧠 How it works (Kinematics &amp;amp; Math)
&lt;/h2&gt;

&lt;p&gt;Instead of just checking if a mouse moves in a straight line, Synapse Shield analyzes 19D kinematic vectors in sub-milliseconds:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Jerk (3rd Derivative of Position):&lt;/strong&gt; Human muscles have micro-tremors. Bots (even advanced Bézier curve bots) produce near-zero or static Jerk. The engine looks for biological tremors ($da/dt$).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Fitts's Law Terminal Deceleration:&lt;/strong&gt; Humans naturally decelerate as the cursor approaches a target to click. We measure the &lt;code&gt;terminal_decel_ratio&lt;/code&gt; to catch bots.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Poisson Anomaly Detection:&lt;/strong&gt; Headless API flooders are caught using a cumulative Poisson distribution algorithm.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  ✨ Key Features &amp;amp; Hardening (v0.5.0)
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;⚡ &lt;strong&gt;Async Non-Blocking SLA (&amp;lt;0.5ms):&lt;/strong&gt; Offloaded via &lt;code&gt;asyncio.to_thread&lt;/code&gt; so it never blocks the FastAPI/Django event loop.&lt;/li&gt;
&lt;li&gt;🔐 &lt;strong&gt;Cryptographic Replay Defense:&lt;/strong&gt; Uses HMAC-SHA256 signed nonces (with SQLite WAL) to ensure tokens can't be replayed.&lt;/li&gt;
&lt;li&gt;♿ &lt;strong&gt;Accessibility Mode:&lt;/strong&gt; &lt;code&gt;accessibility_mode=True&lt;/code&gt; gracefully scales down kinematic thresholds so motor-impaired users aren't falsely flagged.&lt;/li&gt;
&lt;li&gt;⚛️ &lt;strong&gt;React &amp;amp; Next.js SSR Support:&lt;/strong&gt; Native &lt;code&gt;"use client"&lt;/code&gt; Drop-in Component and hook to avoid Hydration errors.&lt;/li&gt;
&lt;li&gt;📈 &lt;strong&gt;Enterprise Prometheus Metrics:&lt;/strong&gt; Native &lt;code&gt;PROMETHEUS_MULTIPROC_DIR&lt;/code&gt; support for Gunicorn/Uvicorn workers.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  🚀 Quick Code Example (FastAPI)
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
python
from fastapi import FastAPI, Request
from synapse_shield import shield_protect, SynapseShieldMiddleware

app = FastAPI()
app.add_middleware(SynapseShieldMiddleware, protected_paths=["/api/auth"])

@app.post("/api/login")
@shield_protect(max_risk_score=50.0, accessibility_mode=False)
async def login(request: Request):
    return {"status": "authenticated"}

I'm a 2nd-year Computer Engineering student, and I built this to bridge the gap between low-level math and modern web frameworks.

I’d love your feedback, code audits, or ideas on how to improve the kinematics engine!
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

</description>
      <category>ai</category>
      <category>python</category>
      <category>opensource</category>
      <category>programming</category>
    </item>
  </channel>
</rss>
