Project overview
Software engineering internship at Documatrix. The brief was infrastructure: the codebase had outgrown its build pipeline, and a JavaScript monolith was producing runtime bugs that should have been caught at compile time. I led both fixes.
The same instinct that fixes a slow build fixes a slow ML pipeline — strict types, fast feedback, ruthless dependency choice.
The challenge
As the startup’s codebase grew, the existing build system (based on Webpack) had become a significant bottleneck:
- Development latency. Cold starts and HMR were taking over two minutes, disrupting flow.
- Production risk. The lack of static typing led to frequent runtime errors and made refactoring high-risk.
- CI/CD overhead. Deployment pipelines were slow, delaying time-to-market for new features.
What I did
1. Build system — replaced Webpack with esbuild
esbuild is written in Go and leverages parallelism that JavaScript bundlers can’t match.
- Replaced Babel with esbuild’s native transpiler.
- Re-architected asset handling and code-splitting strategies.
- Configured automated minification and tree-shaking that outperformed previous results.
Result: Build times dropped from ~120 seconds to under 10 seconds — a consistent 10× boost.
2. Full TypeScript migration
Transitioned from a dynamic JavaScript codebase to a strictly typed TypeScript ecosystem, incrementally, without halting feature work.
- Established a strict
tsconfig.jsonto enforce code quality from day one. - Designed core interfaces and types for the central state management and API layers.
- Systematically converted
.jsand.jsxto.tsand.tsx, keeping the application functional throughout. - Integrated ESLint and Prettier with TypeScript support to automate style and catch bugs before production.
Impact
| Metric | Legacy (JS / Webpack) | Optimized (TS / esbuild) | Improvement |
|---|---|---|---|
| Local cold start | 135 s | 12 s | 11× |
| HMR (update speed) | 4–6 s | < 0.5 s | Instant |
| CI pipeline build | 9 min 30 s | 2 min 15 s | ~75% faster |
| Code reliability | Frequent runtime bugs | Caught at compile time | Significant |
Stack
- Bundler: esbuild
- Language: TypeScript (strict mode)
- Environment: Node.js, React
- CI/CD: GitHub Actions, Docker
What this proves for AI work
Modern ML codebases drift faster than web ones. The same instincts — strict types, fast feedback, ruthless dependency choice — keep them sane. Eval pipelines, agent harnesses, and on-device inference toolchains all live in the same kind of infrastructure that this migration replaced. When AI work is described as “engineering,” this is part of what that means.