Frontend Architect
at Nyle
2025 — Present
Architecture & Migration. Designed the target architecture Components → Hooks → RTK Query → Effect Services → ReScript Core and executed the migration without halting feature development — through parallel coexistence of legacy and new code. Completed 4 of 6 migration phases, including the pilot (What-If FSM) and 8 domain modules.
Domain Modeling. Developed a domain-variant architecture in ReScript: replaced nullable fields with discriminated union types (Snapshot, WhatIf, PeriodCompare, Timeline, WhatIfTimeline), eliminating an entire class of bugs at the type level — "make illegal states unrepresentable."
FSM (Finite State Machines). Designed and implemented an FSM for What-If functionality (3 states, 4 actions, 18 slider parameters) following the Elm pattern: pure transitions in ReScript + a command interpreter in TypeScript with dependency injection via Effect.
Stack Integration. Wired together ReScript (domain logic, Sury validation), Effect (HTTP, DI, typed errors), RTK Query (cache & orchestration), and React 18 (useSyncExternalStore) into a unified pipeline with strict layer boundaries.
Documentation & Processes. Built a comprehensive architectural documentation system: ARCHITECTURE.md as single source of truth (600+ lines), an ADR process (4 decisions documented), enforcement rules for code review, a TDD workflow, and code generation skills for new services.