<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Trevin Wisaksana 🎾 on Medium]]></title>
        <description><![CDATA[Stories by Trevin Wisaksana 🎾 on Medium]]></description>
        <link>https://medium.com/@trevinw?source=rss-9d23eeb6c5a2------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*aKcLLURzmwZudsw6zEWxpg.jpeg</url>
            <title>Stories by Trevin Wisaksana 🎾 on Medium</title>
            <link>https://medium.com/@trevinw?source=rss-9d23eeb6c5a2------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 28 Nov 2026 04:21:38 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@trevinw/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Building a Future-proof Registration Form]]></title>
            <link>https://medium.com/@trevinw/building-a-future-proof-registration-form-bc19ea204fa0?source=rss-9d23eeb6c5a2------2</link>
            <guid isPermaLink="false">https://medium.com/p/bc19ea204fa0</guid>
            <category><![CDATA[golang]]></category>
            <category><![CDATA[system-design-concepts]]></category>
            <category><![CDATA[online-registration-form]]></category>
            <category><![CDATA[android]]></category>
            <category><![CDATA[swift]]></category>
            <dc:creator><![CDATA[Trevin Wisaksana ]]></dc:creator>
            <pubDate>Sun, 05 Jul 2026 09:17:23 GMT</pubDate>
            <atom:updated>2026-07-05T09:38:25.611Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/517/1*QaHb4Wr07RDvPaVhHvmOTw.png" /></figure><p><em>Registration forms are one of the most overlooked parts of a product. Nobody talks about how to engineer one properly yet it is the entry point of many apps and websites. This is how I would build one.</em></p><h3>TL;DR</h3><ul><li>Registration flows in regulated products change all the time, and the changes come from outside engineering: regulators add fields, legal updates the terms and conditions, product reorders pages to reduce drop-off.</li><li>If the flow is hard-coded in the iOS app, the Android app, and the API, every one of those changes costs a backend deploy plus two app-store releases.</li><li>The fix is to make the app a thin renderer of a few fixed step types (form, camera, signature, document viewer, PIN pad) and let the backend own the entire flow as versioned JSON: the page order, the fields, and the validation.</li><li>After that, adding a field or reordering pages is a data edit, not a release. Go native only where the security demands it (camera, PIN); build the form pages as web views so they’re written once for both platforms.</li></ul><h3>The most overlooked part of the product</h3><p>If you’ve built onboarding for a regulated product like a trading or banking app, you know the flow: personal details, bank information, an ID photo, a selfie, terms and conditions, a PIN. Ten pages before the user can do anything.</p><p>Nobody writes about this part of the product. It’s “just forms,” so it gets underestimated by roadmaps, estimates, and the engineers assigned to it. In a regulated company it’s a complex system: versioned legal documents, per-call vendor costs, fraud attempts, compliance deadlines, and users dropping off on every page.</p><h3>The naive approach</h3><p>The average engineer’s first approach is to build it natively and mirror it on the backend: one hard-coded screen per page in iOS and Android, and one endpoint per page in the API. POST /register/personal-details, POST /register/bank-info, each with its own handler, its own validation, its own database columns. This creates three problems:</p><ul><li><strong>Every field is built three times.</strong> Once in Swift, once in Kotlin, and once in the backend. Changing a single field means changing all three, going through two app-store reviews, and waiting for users to update their apps. And because there are three copies, they go out of sync: Android accepts a value that the API rejects.</li><li><strong>Reordering pages is a two-week project.</strong> It sounds like dragging items in a list, but the page order is hard-coded in three places: the iOS navigation, the Android navigation, and the API, where each endpoint assumes certain pages were already submitted before it. Moving one page means updating and re-testing all three, then shipping two app releases.</li><li><strong>Logic that spans pages breaks easily.</strong> For example, page 3 should only show an SSN field if the user picked “United States” on page 2. That rule has to be written in the iOS app, again in the Android app, and again on the server for validation. Three hand-written copies of the same rule will eventually disagree, and you get bugs like a field that appears on Android but not on iOS.</li></ul><p>The natural next step is to make it schema-based: describe the fields in a schema (a JSON file that lists each field, its type, and its validation rules) instead of hard-coding the screens.</p><p>It helps, but most teams make a mistake: the schema ships inside the apps, and the backend keeps its endpoint-per-page API. The page order and the cross-page logic still live in native code, so a schema change still needs an app release, and a reorder still needs a backend deploy plus two app releases. The screens became declarative, but the flow didn’t.</p><p>Meanwhile, the form keeps changing, and almost never for engineering reasons:</p><ul><li><strong>Regulators add fields.</strong> A tax residency question, a FATCA declaration, a source-of-funds breakdown, all with deadlines you don’t control.</li><li><strong>Legal updates the terms and conditions.</strong> Every new sign-up must see and accept the current version.</li><li><strong>Product reorders pages</strong> to reduce drop-off, or inserts a step for a third-party KYC vendor (the company that verifies IDs and selfies).</li><li><strong>Things break mid-flow.</strong> The KYC vendor gets backed up, or a partner bank’s API goes down. Ops needs to show users a message like “verification is taking longer than usual” right now. If that requires an engineer and an app release, the message arrives after the outage is over.</li></ul><p>This is the core problem: the form changes often, the changes come from outside engineering, and with the naive architecture every change costs a backend deploy and two app releases.</p><p>A well designed registration form is the one that absorbs regulatory changes, drop-off, vendor costs, and consent requirements without a fire drill. Here’s the design I’d build.</p><h3>The core idea: the app never knows the flow</h3><p>The fix is to take the schema out of the app entirely. The design rests on one inversion: <strong>the app never knows the flow.</strong></p><p>The mobile app is a thin renderer. It knows how to render a small, fixed set of <em>step types</em>: a form, a camera screen, a signature pad, a document viewer, a PIN pad. Nothing else. It doesn’t know how many pages exist, what order they come in, or what fields are on them.</p><p>The backend owns everything else: the flow definition, the page order, the validation, and the state machine that tracks where each user is. The entire contract between app and server is one loop:</p><blockquote>“Here is the user’s answer to step X.” → “Here is step Y. Render it.”</blockquote><p>The app never decides what comes next. It asks the server “what’s next?”, and the server reads a <strong>versioned JSON flow definition</strong> from the database and returns the next step, fully resolved and ready to draw.</p><p>The API can be much simpler as well. Instead of one endpoint per page, there are three generic API calls: open a session, submit a step, fetch the current state. Reordering pages can’t break the API, because the API never mentions specific pages. Validation is written once, in the flow definition, and enforced by the server; the apps just render the rules they’re given.</p><p>Here’s a flow definition (middle pages left out to keep it short):</p><pre>{<br>  &quot;flow&quot;: &quot;retail_onboarding&quot;,<br>  &quot;version&quot;: 14,<br>  &quot;steps&quot;: [<br>    { &quot;id&quot;: &quot;personal_details&quot;, &quot;type&quot;: &quot;form&quot;,<br>      &quot;fields&quot;: [<br>        { &quot;key&quot;: &quot;full_name&quot;, &quot;kind&quot;: &quot;text&quot;, &quot;required&quot;: true },<br>        { &quot;key&quot;: &quot;dob&quot;, &quot;kind&quot;: &quot;date&quot;, &quot;rules&quot;: [&quot;age&gt;=18&quot;] },<br>        { &quot;key&quot;: &quot;tax_id&quot;, &quot;kind&quot;: &quot;text&quot;, &quot;since_version&quot;: 14 }  // ← the new regulatory field<br>      ]},<br>    // … contact, employment, trading experience, bank pages …<br>    { &quot;id&quot;: &quot;id_card&quot;, &quot;type&quot;: &quot;camera&quot;, &quot;capture&quot;: &quot;id_card&quot; },<br>    { &quot;id&quot;: &quot;selfie&quot;,  &quot;type&quot;: &quot;camera&quot;, &quot;capture&quot;: &quot;selfie&quot; },<br>    { &quot;id&quot;: &quot;tnc&quot;,     &quot;type&quot;: &quot;document&quot;, &quot;doc&quot;: &quot;tnc&quot; },<br>    { &quot;id&quot;: &quot;sign&quot;,    &quot;type&quot;: &quot;signature&quot; },<br>    { &quot;id&quot;: &quot;setup_pin&quot;, &quot;type&quot;: &quot;pin&quot; }<br>  ],<br>  &quot;on_complete&quot;: [<br>    { &quot;adapter&quot;: &quot;vendor_kyc&quot; }  // verification is not a page<br>  ]<br>}</pre><p>Changes that used to be app releases become data edits:</p><ul><li><strong>Add a regulatory field</strong> → publish a new flow version.</li><li><strong>Reorder pages</strong> → edit the steps array.</li><li><strong>Insert a vendor step</strong> → add a step pointing at an adapter.</li></ul><p>An app release is only needed for a brand-new native step type, which is built once and reused forever e.g. liveness SDK integration. Everything else is data: fields, pages, ordering, copy.</p><h3>Should the screens be native, web, or both?</h3><p>Server-driven UI raises an obvious question: why not skip native screens entirely and put the whole flow in a web page inside the app?</p><p>The deciding factor is that the form has to work on <strong>both iOS and Android</strong>. Every native screen has to be built twice and shipped through two app-store reviews. A web page is built once and reaches both platforms instantly, and you can change it without any app release. Web has real downsides — it needs extra security work and feels slightly less polished than native — but building once instead of twice is worth it.</p><p>If you only support one platform, fully native is a perfectly good choice. You’d build each screen only once anyway, and you’d avoid the web security work. The web approach only pays off when you have two platforms to support.</p><p>To support two platforms the best decision is to go hybrid and decide per step:</p><ul><li><strong>Camera (selfie / ID): native.</strong> Camera control, on-device photo quality checks, and the KYC vendor’s liveness SDKs only work natively.</li><li><strong>Signature and PIN: native.</strong> If there’s a step to create a PIN or e-signature go native to completely eliminate the possibility of a vulnerability that comes with a web implementation.</li><li><strong>Form pages, T&amp;C, banners: web view inside the app.</strong> These pages get built once for both platforms, and new field types and visual changes ship from the server with no app release.</li></ul><p>The web pages need real security work, and it’s ongoing, not a one-time setup:</p><ul><li><strong>A strict Content Security Policy (CSP).</strong> This is a browser rule that says “this page may only load code from our own servers.” It blocks injected or third-party scripts from running on registration pages, which handle sensitive data.</li><li><strong>XSS review on frontend changes.</strong> XSS (cross-site scripting) is an attack where someone gets their own JavaScript to run on your page, letting them steal whatever the user types. Any change to the web form code gets reviewed for it.</li><li><strong>A safe login handoff from native to web.</strong> The web page needs to prove which user session it belongs to. The native app passes it a short-lived token that only works for this one registration session, and the token is never saved in the browser’s storage, where other scripts could read it.</li></ul><h3>The overall benefit</h3><p>The architecture is small: one session API, versioned flow JSON, a state machine, per-step submissions, five native renderers plus web form pages. What it changes is the day-to-day work:</p><ul><li><strong>A regulatory field</strong> is a flow version publish. Users mid-flow get asked for just the new field; nobody’s progress is thrown away.</li><li><strong>A T&amp;C update</strong> is a legal-docs publish. New sign-ups see it immediately.</li><li><strong>“Bank X is having issues”</strong> is one row in the announcements table, shown only on the bank-info page.</li><li><strong>You can measure whether a form change helped or hurt.</strong> Because each session is pinned to the flow version it started on, users on v14 and users on v15 exist side by side. Compare their completion rates and you know within a day whether the new version made drop-off better or worse — instead of finding out weeks later through support tickets.</li></ul><p>Every decision in this article is the same move: <strong>put the knowledge on the server, resolve it when the page is served, keep the app dumb.</strong> Ordering, validation, conditional fields, T&amp;C versions, progress bars, banners — all of it. Once you commit to that, “the form changed again” stops being a fire drill and becomes a Tuesday.</p><h3>The checklist: what a good registration form needs</h3><p>Few people talk about registration forms, so most teams don’t know what to demand from one until each gap becomes an incident. Grade any design against this list, including the one you have in production.</p><p><strong>The flow is data</strong></p><ul><li>The server owns ordering, validation, and the state machine. The app only renders a fixed set of step types.</li><li>Flow definitions are versioned. Sessions are pinned to the version they started on, so a publish never breaks a user mid-flow.</li><li>Adding a field, reordering pages, or inserting a step is a data change. No release, no deploy.</li><li>The app declares its capabilities when it opens a session; the server never serves a step the app can’t render. Old app versions get an update prompt, not a crash.</li></ul><p><strong>Conditional logic lives in one place</strong></p><ul><li>Field visibility and required-ness are rules in the flow definition, not hand-written screen code.</li><li>Dependencies across pages are resolved by the server when it serves the page; the app never needs another page’s answers.</li><li>Editing an earlier answer cascades: still-valid answers are kept, no-longer-relevant ones are dropped, newly required ones are asked for.</li><li>Server-side validation is the only validation that counts. Client-side rules are for user experience and are always re-checked.</li></ul><p><strong>Drop-off is a first-class scenario</strong></p><ul><li>Every page submit is saved server-side; progress never lives only on the device.</li><li>Resuming never re-asks what’s still valid. It asks only for what’s missing.</li><li>Submits carry idempotency keys (a unique ID per submit attempt), so a double-tap can’t trigger a vendor call twice or create a duplicate record.</li></ul><p><strong>Money and abuse are designed for</strong></p><ul><li>Expensive verification e.g. anti-fraud scanning runs once per session, at the end, and can’t be triggered twice. Never triggered by an upload.</li><li>Cheap checks run early: on-device photo checks at capture, basic file validation at upload.</li><li>Upload abuse is contained structurally: one storage slot per document type, presigned upload URLs, per-session quotas, rate-limited session creation.</li></ul><p><strong>Consent and compliance leave evidence</strong></p><ul><li>Legal documents have their own versioned publishing process, separate from flows and app releases.</li><li>Consent records store the exact version, language, and content hash the user saw: evidence, not a boolean.</li><li>Sensitive fields are encrypted at the application layer; credentials like a PIN never enter form storage.</li></ul><p><strong>Ops can act without engineering</strong></p><ul><li>Banners and maintenance mode are server-side data, scoped globally or to a single page.</li><li>Every state transition emits a structured event, so per-page conversion, validation-failure rates, and resume rates come free.</li><li>Completion rate is tracked per flow version, so every publish doubles as an experiment and a broken change shows up in the numbers within a day.</li></ul><p>This is how it should be done especially when your product is highly regulated e.g. stock brokers, banks. It’ll make your life easier than handling on-call on a daily basis due to bugs or breaking changes. The registration form is the first thing every user touches and the last thing most teams design deliberately. It deserves better than “just forms.”</p><p>If you’d like to see an example of how its implemented you can have a look at this example.</p><p><a href="https://github.com/trevinwisaksana/adaptive-registration-form">GitHub - trevinwisaksana/adaptive-registration-form</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bc19ea204fa0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[PII Detection at Scale: Regex First, LLM Last]]></title>
            <link>https://medium.com/@trevinw/pii-detection-at-scale-regex-first-llm-last-35bc42c31dab?source=rss-9d23eeb6c5a2------2</link>
            <guid isPermaLink="false">https://medium.com/p/35bc42c31dab</guid>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[pii]]></category>
            <category><![CDATA[gdpr]]></category>
            <category><![CDATA[llm]]></category>
            <category><![CDATA[bosch]]></category>
            <dc:creator><![CDATA[Trevin Wisaksana ]]></dc:creator>
            <pubDate>Tue, 09 Jun 2026 10:09:06 GMT</pubDate>
            <atom:updated>2026-06-09T10:09:06.912Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VrMjB1_fcFEEw2bvrZgujA.jpeg" /></figure><p><em>We built a GDPR PII discovery system in a day at the TECHon hackathon. Here’s what we learned.</em></p><h3>The problem at enterprise scale</h3><p>A large enterprise holds personal data across file shares, mailboxes, object storage, SaaS tools, and old project folders nobody has opened in years. The longer the company operates, the more of it piles up, and the harder it gets to answer three basic questions: what personal data do we hold, where does it live, and is any of it still in use?</p><p>GDPR expects an answer to all three. The principles of data minimization and storage limitation mean personal data is supposed to be deleted once it no longer serves the purpose it was collected for. But you cannot delete, or even defend, data you have lost track of. At enterprise scale, that tracking problem is where compliance quietly breaks down.</p><p>The fines are not theoretical. Meta holds the largest GDPR penalty to date, <a href="https://www.edpb.europa.eu/news/news/2023/12-billion-euro-fine-facebook-result-edpb-binding-decision_en">€1.2 billion</a> (roughly $1.3 billion), handed down by Ireland’s Data Protection Commission in 2023. Regulators have made the point clearly: mishandling personal data at scale carries consequences at the same scale.</p><p>That is the problem we decided to solve in the TECHon Hackathon. We built an automated GDPR data discovery tool from scratch in a day.</p><h3>What we built</h3><p>A fully automated pipeline that scans every file in a Google Drive from texts to videos and flags the ones containing personally identifiable information (PII). The results then surface through a web dashboard built around two personas:</p><ul><li>A Data Protection Officer (DPO) who works in an admin view</li><li>An employee who reviews the flagged files that belong to them</li></ul><h3>The detection pipeline</h3><p>The core of the project is a three-tier cascade. Each file moves through the tiers in order and stops at the first positive hit. The goal is to spend almost nothing on the easy cases and save the expensive work for the genuinely hard ones.</p><p><strong>Tier 1, regex.</strong> Fast, deterministic patterns for emails, phone numbers, IBANs, SSNs, ID numbers, and IP addresses. This handles most structured PII at sub-millisecond latency.</p><p><strong>Tier 2, Azure NER.</strong> When regex finds nothing, we hand the text to Azure Language Service’s named-entity recognition, which catches unstructured PII like full names buried in prose. High-confidence hits (a score of 0.85 or above) pass straight through.</p><p><strong>Tier 3, LLM verify and detect.</strong> Low-confidence NER findings get confirmed by an LLM (Qwen via OpenRouter). And if both regex and NER come up empty, the LLM does a full pass on the file. This is the last resort, the tier that catches the edge cases the first two miss. Ideally this is done via a local model so PII does not get sent to a third-party server.</p><p>The payoff of ordering it this way: more than 80% of files never reach an LLM at all. Cost and latency stay low because the cheap tiers do most of the work.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/680/1*QonhMh9v8tu3e8NeBeEu8g.gif" /></figure><h3>Architecture</h3><p>The system is a set of small services wired together with Pub/Sub:</p><ul><li><strong>File scanner</strong>(a scheduled GCP Cloud Run Job) that can be triggered through the admin dashboard lists Drive files, upserts them into Postgres, and publishes to Pub/Sub.</li><li><strong>Extractor consumer</strong> (Cloud Run Service) pulls from Pub/Sub, downloads each file, and extracts text from PDF, DOCX, XLSX, CSV, PPTX, RTF, and HTML, then publishes to the scanner topic.</li><li><strong>Scanner consumer</strong> (Cloud Run Service) runs the detection logic and writes the status flag, PII category, and detection stage back to Postgres.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/680/1*g4r7upUG9WYz0RxILDubsQ.gif" /></figure><h3>The user experience</h3><p>The dashboard splits cleanly along the two personas.</p><p>The <strong>admin (DPO) view</strong> gives a compliance officer the overview:</p><ul><li>KPI cards for files registered, processed, flagged, and the flag rate</li><li>A donut chart of detection outcomes</li><li>Flagged-file exposure broken down per Drive owner</li><li>A live text scanner: paste any text and watch findings appear inline with category toggles</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dhAF4O5mPIq8Rmh5TGa9yw.png" /></figure><p>The <strong>employee view</strong> is built for the person who actually has to act on a finding:</p><ul><li>A list of flagged files assigned to you, sorted by risk</li><li>An inline document viewer with the PII highlighted in place</li><li>Per-finding cards showing which GDPR article each finding implicates</li><li>Bulk actions: mark for deletion, flag as a false positive, or extend retention</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sI9XCM4wvVO9S7wB_GZg6A.png" /><figcaption>The employee dashboard. Unfortunately the Google project ran out of credits and disabled the database.</figcaption></figure><h3>Here’s what we learned</h3><p>Hackathon code is hackathon code. Here is the honest list of what stands between this and a production-grade system:</p><ul><li><strong>Higher recall beats higher precision here.</strong> For PII detection it is better to over-detect than to miss, because a miss can mean failing GDPR compliance. False positives can be marked by a human and used for further training.</li><li><strong>An LLM is not a silver bullet.</strong> If regex and NER consistently miss, the LLM fallback can hit every file in a large Drive. This would be very expensive and slow which would struggle in a system handling petabytes of data.</li><li><strong>Encoder models are the better fit.</strong> One of our biggest assumptions was that an LLM would make the detector more accurate. That part is true, since an LLM does bring context awareness. For example, a name “Louis Vuitton” in a sentence could refer to a person’s name or the name of an organization. It depends on the context. The catch is that generative LLMs are built to produce text, not to classify it, so reaching for ChatGPT, Claude, or Llama is overkill when the task is just labeling spans of text. An encoder model trained for that classification is the more suitable tool.</li></ul><h3>Closing thought</h3><p>We had a lot of fun building this project like wizards. But we think we can take these lessons we’ve learned to continue to refine this project and make it production ready. If you’d like to learn more about this feel free to reach out. We’re interested to learn more about what other pain points we can solve and battle test our system.</p><blockquote>Shoutout to Lasse, Angel and Krish for having a blast building this!</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=35bc42c31dab" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>