Inspiration
Inspiration
Most business education teaches strategy backwards. You read a polished case study after the outcome is already known, so every good decision looks obvious in hindsight and every mistake looks foolish. I wanted a tool that puts you in the seat before the outcome is known, forces you to weigh messy trade-offs with incomplete information, and only then shows you what actually happened.
I also wanted to prove that a serious learning platform does not need user accounts, cloud tracking, or a subscription wall. Your decisions, reflections, and API keys belong on your own machine. That is what led to BIZSIM: an open-source, zero-login, local-first business case simulation platform spanning 3,700 years of strategy, from Hammurabi's Babylon to modern tech and AI companies.
How I Built It
BIZSIM is built around a shared deterministic core (shared/) powering a React + Vite frontend, a Node.js + Express backend with no database, an Electron desktop shell (Windows, macOS, Linux), and Capacitor mobile builds (Android and iOS).
- 200 Offline Seasons (800 Episodes, 1,600+ Decisions): Every built-in season follows a spoiler-free six-step loop: Situation, Concept, Evidence, Episodes, Outcome, Insight. Decisions are scored on process quality \(q \in {1, 2, 3}\) given what was known at the time, kept strictly separate from historical alignment (since history itself was often wrong).
- Live Company Research & Chat Builder: Beyond the offline library, BIZSIM pulls live public evidence from Wikidata, Wikipedia, U.S. SEC EDGAR filings, recent news, and official company websites, then synthesizes a playable 4-episode season where Episode IV puts you in the decisions the company faces today. Every AI-written season passes the same deterministic validator as the hand-curated ones and runs through an ordered multi-provider fallback chain (Gemini, NVIDIA NIM, Groq, Anthropic, OpenAI, OpenRouter, xAI, or local Ollama) with automatic
jsonrepairrecovery. - Honest Uncertainty in the Learning Profile: Instead of showing vanity scores after two clicks, BIZSIM computes 95% confidence bands. For historical alignment across \(n\) documented decisions with \(k\) matches (\(\hat{p} = k / n\)) and \(z = 1.96\), it uses the Wilson score interval:
$$\text{CI}_{95\%}(p) = \frac{\hat{p} + \frac{z^2}{2n} \pm z\sqrt{\frac{\hat{p}(1-\hat{p})}{n} + \frac{z^2}{4n^2}}}{1 + \frac{z^2}{n}}$$
For average decision quality \(\bar{q}\) with sample standard deviation \(s\), it computes:
$$\bar{q} \pm z \cdot \frac{s}{\sqrt{n}}$$
Strategic tendencies across 10 dimensions (such as short-term vs. long-term horizon or capital preservation vs. asymmetric bets) update via exponential weighting so recent habits shape your profile faster than old runs:
$$D_{t} = (1 - \alpha) D_{t-1} + \alpha \cdot \Delta_t$$
- Zero-Cloud Sync & Native Updates: Devices sync progress offline using animated cycling QR codes or
.bizsimpackages, pair over local Wi-Fi using one-time codes with HMAC-SHA256 signed requests, and update natively inside the app with SHA-256 verification againstSHA256SUMS.txt.
Challenges I Faced
- Making AI case generation reliable on free tiers: Models regularly hit rate limits, time out, or return broken JSON mid-season. Originally, if Episode 4 of 4 failed after exhausting fallbacks, the entire run was lost. I rebuilt
seasonWriter.jswith per-episode error isolation and fallback chaining so completed episodes are preserved and delivered cleanly with a clear partial-completion notice. - SSRF hardening vs. Node.js networking quirks: Pinning DNS lookups to block private and metadata IP ranges broke non-Gemini HTTPS calls on Node 20 and 22 with
ERR_INVALID_IP_ADDRESSbecauseautoSelectFamilypasses{ all: true }todns.lookup. Writing a customcreatePinnedLookuphandler resolved all A/AAAA records cleanly without weakening SSRF protection. - Wikimedia and GitHub API rate limits: Unauthenticated GitHub API checks triggered
403rate-limit errors on shared networks, and Wikimedia rejected generic User-Agents. I solved both by publishing a staticlatest.jsonCDN manifest alongside a 3-tier update fallback and adding Wikimedia-compliantApi-User-Agentheaders withopensearchand REST summary fallbacks. - Cross-platform packaging & security: Fixing macOS dual-arch
.pkgbuild races in GitHub Actions, building an atomic in-place.AppImageand macOS.appself-updater plus a native Android APK updater plugin, and clearing every CodeQL and Dependabot alert down to zero required treating the release pipeline with the same rigor as the app code.
What I Learned
- Determinism is what makes AI useful in education. An LLM alone hallucinates sources and leaks spoilers; wrapping it in strict schema sanitization, source-ID checks, and anti-spoiler gates turns it into a trustworthy learning engine.
- Local-first forces better architecture. When you refuse to rely on a central backend, you learn to design cleaner state schemas, offline-capable media (like client-side Piper neural TTS), and cryptographic local pairing from day one.
- Shipping across six platforms is half the engineering. A feature is only real when automated CI builds, checksums, in-app updaters, and 16-language localization all hold together end to end.
Limitations & What's Next
- Machine-Assisted Translations: All 15 non-US-English interface languages (including right-to-left layouts for Arabic and Urdu) are machine-assisted and awaiting native-speaker review. The 200 built-in seasons remain in English apart from single-season samples in Bengali and Spanish. Next, I want to open community translation reviews and expand full season localization.
- Mobile Signing & Distribution: Because BIZSIM is zero-budget and open source, iOS builds ship as an unsigned
.ipa(with an AltStore source feed and Xcode project) rather than through TestFlight or the App Store, and Android APK in-place upgrades require configuring a permanent signing keystore secret. Adding signed store releases is a priority once a developer account is in place. - Public Web vs. Native Apps: Running BIZSIM on a public web server exposes browser storage and headers to shared environments; for bring-your-own-key AI and SEC EDGAR lookups, users are encouraged to download the native desktop or mobile builds.
- Free-Tier AI Quotas: Live Company Research and Chat Builder still depend on external provider quotas. When all fallback keys exhaust mid-run, BIZSIM delivers the completed episodes as a partial season rather than failing silently. Next on the roadmap is adding one-click local Ollama model presets and resumable episode continuation so partial seasons can finish seamlessly later.
Built With
- capacitor
- claude
- electron
- express.js
- gemini
- github-actions
- react
- vite