Context
Bodhi is the learner-facing platform at an ed-tech company that sells courses to schools. I founded the monorepo in July 2024 and was its architect. It serves the learner web app, school sites, the live-class app and the WebViews inside the mobile app.
The problem
The old learner app was one large React app. Web pages, school sites, the live-class app and mobile WebViews all needed the same capabilities: API access, auth, cache, config, analytics, sockets and i18n. Each surface carried its own copy, and the copies drifted apart.
Rebuilding and redeploying everything together for every change was not workable across that many surfaces.
What I did
I set up the Turborepo monorepo and imported the legacy app so old and new code could run side by side.
I designed a runtime loader that fetches services from a CDN by version, and a dependency-injection container on the page that every surface reads from.
I wrote the core services myself, including storage, the GraphQL client with error handling, config, event bus, analytics, sockets and logging. That made 13 shared services.
I added per-service versioning and changelogs, and CDN deploys for services and widgets.
I later built the player SDK on this runtime. It is now the default player.
Key decision
I chose runtime-loaded, independently versioned service bundles over per-surface builds. One fix then ships to every surface without a rebuild of each.
The cost is an implicit contract between bundles: nothing checks types across them at compile time. I accepted that because independent deploys mattered more, and the contract is the risk I would watch first.
Result
One runtime now serves 4 surfaces, with 13 shared DI services behind it. The player adapter built on it reaches a 98% mutation score.
What I learned
I would do the runtime loader again. I would add a typed contract check between bundles earlier, because that gap is where the problems hide.
Stack
- TypeScript
- Turborepo
- Inversify
- Next.js
- Lit
- React Native
- CDN versioning
