DEV Community

From Brython to React + TypeScript: How I Built 42+ Math & File Utilities 100% in the Browser 🛠️🚀

In 2021, I just wanted to stop wasting time on repetitive calculations and broken files at work. I didn't want to spin up a server, configure a database, or pay for hosting. I just wanted to open a browser tab and solve the problem on the spot.

Five years later, that simple page turned into Ahtools, a suite of over 42 mathematical calculators, file parsers, and cryptography utilities running 100% client-side. Spoiler: the codebase has been rewritten three times - moving from client-side Python in the browser, to vanilla JavaScript, and most recently to a full TypeScript and React refactor with the help of AI.

Grab a coffee and let me walk you through how this architecture evolved. ☕👇

🔒 1. Rule Number One: No Data Ever Leaves the Browser

When you deal with corporate spreadsheets, system logs, and sensitive records, sending files to an external API is always a liability. That's why Ahtools was designed from day one around Zero Backend Storage.

Everything runs inside the user's browser sandbox:

  • Native FileReader API: parses and tokenizes large files directly in RAM.
  • Web Workers: offloads heavy tasks (like client-side OCR) asynchronously so the UI thread never freezes.
  • HTML5 Blobs: generates sanitized files, CSVs, and PDF reports dynamically for instant download.
  • Minimal LocalStorage: used strictly to remember UI preferences like light or dark mode.

🧮 2. What's Under the Hood (Math & Algorithms)

Instead of juggling massive spreadsheets or scattered terminal scripts, I built dedicated calculation and data-processing engines straight into the app:

  • Time Math & Sexagesimal/Centesimal Conversion: instant bidirectional conversion between HH:MM and decimal hours (08:30 ⇄ 8.50h), duration tracking across midnight rollovers, and proportional time-reduction multipliers (60 / 52.5, or 8/7).
  • Dynamic Calendar Algorithms: business day and working-hour calculators for any year, ISO week numbers, algorithmic calculation of movable holidays, and exact timestamp diffs down to the second.
  • Modulo 11 Check-Digit Validation & Synthetic Data: bulk scanning of thousands of rows in CSV/Excel files to verify mathematical check digits (supporting both numeric and alphanumeric formats), alongside valid synthetic ID generators for QA and staging environments.
  • Cryptography, Entropy & Auditable Randomness:
    • In-browser file vault using 256-bit AES-GCM with PBKDF2 key derivation (100,000 iterations).
    • Symmetric text encryption for sharing temporary credentials safely.
    • Password generator aligned with NIST SP 800-63B and ISO 27001 guidelines, stripping ambiguous characters (l, 1, O, 0) and computing mathematical entropy in bits.
    • Fisher-Yates shuffle randomizer that outputs SHA-256 sealed PDF receipts for auditable draws.
  • Parsers & File Engineering: fixed-width positional file auditing (such as 240-column batch layouts with cent-level control totals), bidirectional JSON ⇄ CSV conversion with nested object flattening, invisible UTF-8 BOM stripping, local OCR powered by Tesseract.js, lossless PNG merging, PDF concatenation, and network latency/jitter diagnostics.

🔄 3. Three Generations of Code Since 2021

I've been working on Ahtools since 2021, adding and refining features almost every single day. Looking back, the project's architecture ended up documenting my own growth as a developer:

Phase Core Stack What Triggered the Shift
1. The Beginning (2021) Brython I wanted to write Python logic running directly in the browser, manipulating the DOM without setting up a backend.
2. Scale & Speed Vanilla JavaScript As dozens of modules piled up, runtime Python-to-JS transpilation overhead became noticeable. Moving to pure JS gave instant load times.
3. Current Architecture React 18 + TypeScript 5.x + Vite With AI-assisted code refactoring, I migrated the entire codebase to strict static typing and modular components.

Each phase solved the bottleneck of its time. Starting with Brython let me ship a working tool fast using a language I already loved, while migrating to strict TypeScript eliminated silent type bugs in complex math formulas and made maintaining 42+ tools in a single SPA sustainable.

⚠️ An Honest Note About Side Projects

The Ahtools repository remains private, as it started out as a personal toolbox built to solve real day-to-day support and operational bottlenecks. Even so, the live application is deployed, open, and completely free for anyone to test or use in their workflow:

👉 Try Ahtools live: https://delean-mafra.github.io/Ahtools/

If there's one thing working on this project daily since 2021 has taught me, it's that you don't need the perfect stack to build something useful. You just need to solve a real problem today and make it 1% better tomorrow.

💬 Your Turn!

I'd love to hear from other devs maintaining long-running side projects:

  • 🧠 What is the oldest side project you still actively maintain and improve today?
  • 🤖 Have you used AI to migrate a legacy codebase to TypeScript or React? What went smoothly, and what gave you a headache?
  • 🛠️ Which math utility or file parser do you wish existed 100% offline in your browser?

Drop your thoughts in the comments - I'll reply to every one! 🙌

Building every day at Ahtools. Find me on GitHub (@Delean-Mafra) or connect with me on LinkedIn.

Read on DEV Community ↗ ← Back to News

Comments

No comments yet. Start the discussion.