Stuck in monolith

September 2025.

Fix auth - CMS breaks. Change CMS - API crashes. Touch anything - something else falls over.

This is what dev.typus.dev became. A monster where everything is connected to everything.

How? Fast development. "Will refactor later". Modules exist on paper, but boundaries are blurry. One module reaches into another's internals. Shared helpers everywhere. Later never came.

Signs you're in the same trap:

  • Tests go red after any change
  • PR with 50 files for a one-line fix
  • "Don't touch this, it works" in code comments
  • Fear before every commit

I tried refactoring piece by piece. Two months. Didn't work. Fix one thing - something else breaks. Thought about rewriting from scratch. Counted the files. Unrealistic.

Then remembered Strangler Pattern from some architecture book. Don't rewrite at once. Extract a piece, wrap it, swap it, delete the old code.

Started with email module - most isolated. Extracted to separate package. Connected as dependency. Held my breath. Tests green.

Then notifications. Then file uploads. Each one - a week of careful surgery.

Six modules extracted. Ten more to go. But I can already change auth without breaking CMS. That alone was worth it.

← Back to blog