Refactoring Journey: Breathing New Life into a Project with Claude

From Chaos to Clarity: How I Restructured and Optimized with Claude’s Guidance

Posted by Wafer on April 24, 2025

How I Ended Up in the Infra World

Back in early April, I got an interview notice for an infra-related position. As someone used to writing backend code, I suddenly found myself wandering into the mysterious land of infrastructure. I looked back at my previous project, webook, and honestly… I wasn’t thrilled to open it. The frontend was, let’s say, charmingly janky. Despite living with it for a month, and learning tons of cool tech like GIN, GORM, REDIS-GO, KAFKA, and even getting a glimpse of Domain-Driven Design (DDD), the project ended up being me just copying code from a tutorial video. It felt more like a performance than real development. So yeah, I quit working on webook — not with a bang, but with a Ctrl+C.

Birth of a New Project

Then came the main quest: I wanted to practice CICD and all the fancy infra stuff on a somewhat complete project. But first, I needed... a project. That’s how msproject was born. After some initial setup, I discovered the frontend was surprisingly smooth to work with — way better than slogging through endless go test sessions. So I committed to using this one.

DDD Is Just a Lie You Tell Your Code

But of course, it had a fatal flaw: it claimed to follow DDD. Spoiler alert: it did not. The project structure was a tangled spaghetti mess. Layers? What layers? Everything was coupled tighter than my weekend plans. So I did what any rational dev would do: googled “clean microservice architecture,” picked a highly-rated template, and — with Claude’s gentle wisdom — began refactoring the whole thing. Step by step, from monolith setup to GORM, GIN, ZAP, VIPER, and eventually migrating to gRPC. All I can say is, in an age with Claude, even a noob like me can build something halfway decent.

Complain About AI for a Second

And since we’re talking AI... let me just rant for a sec. GPT? Amazing at conversation, but without GitHub access, it codes like it’s blindfolded. Cursor’s hyped AI agents? Sure, if you’re a demigod, maybe. For us mere mortals, the best combo is still: let Claude generate the code, read it yourself, copy-paste the good parts, and tweak as needed. Context limits are still real, and AI agents have a long way to go. But hey — we’re getting there!

What’s Next in the Future

To be honest, I used to hate Git, avoid GitHub, and never touched Markdown. But after finally giving them a shot — wow, they’re pretty convenient. Same with this blog. Writing in HTML feels kinda weird, and I might switch to Markdown in the future. But since this is my first-ever blog post, I figured I’d stick with good ol’ HTML and finish it proper.

Blog text by Wafer