• Skip to main content
  • Skip to primary sidebar

Phelela

  • Phelela
  • Build with me
  • Engineering Notes
  • Beyond Code
  • My GitHub

Why I Rebuilt My Sudoku App: A Developer’s Refactoring Journey

29. July 2025

When I first started working on Neurodoku, it was my very first Android side project. I wanted to learn about clean architecture, experiment with tools like KSP, and just have fun building something that worked.

And it did — at least in the beginning.

But Neurodoku didn’t start as a polished, perfect Sudoku app. In fact, the first version was complete chaos. It was built around a single Main Activity, without any proper architecture or navigation. The UI, logic, and data all lived in one place. No separation of concerns. No testability. No scalability.

It worked — for exactly one feature: solving Sudoku puzzles.

But as soon as I tried to add more — a timer, notes mode, hint system, or even dark mode — things started falling apart. The codebase simply couldn’t handle it.

Red Flags That Made Refactoring Inevitable

Here’s what made me realize it was time to rebuild the app from scratch:

  • One Activity to Rule Them All: Every responsibility — UI, logic, state — lived in one bloated Main Activity.
  • No Architecture = No Flexibility: There was no clean way to introduce features like hints, notes mode, or solver visualization.
  • UI Limitations: Hardcoded layouts and colors made it impossible to modernize the design or support dark mode.
  • Tooling Chaos: I jumped between tools like KAPT and KSP without a clear plan, leading to inconsistent implementation.
  • Unscalable Codebase: Every new feature felt like a gamble — anything could break.

My Refactoring Approach: Starting from a Clean Slate

Rather than trying to untangle the spaghetti code, I made a tough but necessary decision:
Start over. Completely. But this time with structure and intention.

Here’s how I approached the rebuild:

1. Architecture First

I began by designing a proper structure using Clean Architecture and the MVVM pattern, creating clear separation between the UI, domain logic, and data layers.

2. Feature Planning

Before writing any code, I outlined all the features I wanted:

  • Puzzle generation and solving
  • Solving visualization
  • User stats and profiles
  • Blog section
  • Brain health tips
  • Full offline and online support

3. Screens Before Logic

Using Jetpack Compose and Navigation-Compose, I first created the basic screens and navigation flows — only then did I start implementing business logic.

4. Theming from the Start

To properly support dark mode, I moved all colors and styles into a centralized theme system, avoiding hardcoded values.

5. Choosing the Right Tools

This time, I selected my tools with care and consistency:

  • Jetpack Compose for UI
  • Room for local data persistence
  • Firebase for cloud sync and authentication
  • Koin for dependency injection
  • Kotlin + KSP for clean and modern development

What the New Version Can Do (That the Old One Couldn’t)

The refactored Neurodoku isn’t just a basic Sudoku solver — it’s a complete mobile experience with features including:

  • Real-time solving visualizations (backtracking algorithm)
  • Puzzle generator across four difficulty levels
  • Full dark mode support
  • Hints, notes mode, and puzzle reset
  • An in-app blog about brain health and Sudoku strategies
  • User authentication, custom profiles, and stats tracking
  • Offline storage with Room and optional cloud sync with Firebase
  • A modern, modular, and testable codebase with unit tests

You can check it out on my GitHub under the Neurodoku repository.

What I Learned from Refactoring

Rebuilding Neurodoku taught me more than I expected — here are some of the biggest lessons:

  • Architecture matters — even for small or hobby projects.
  • The first version is just a draft — don’t be afraid to throw it away and do better.
  • Tools like Jetpack Compose shine when the codebase is clean and modular.
  • Scalability comes from structure, not clever shortcuts.
  • Plan first, code second. It saves a lot of pain later.

Final Thoughts

Neurodoku was never supposed to be a full-fledged Sudoku platform — but refactoring it gave me the chance to apply everything I’d learned about Android development, architecture, and clean code.

If you’re a developer sitting on a messy old project, ask yourself:
Is it time to refactor?

If the answer is yes, don’t hesitate to start fresh.
It might be the best decision you make for your code — and your skills

in Build with me

Reader Interactions

you may also like
How I Handle Puzzle Solving and Validation: Generating a Sudoku Grid in Kotlin
Backtracking in Action – Think Like an Engineer
Mastering the Development Cycle: A Guide to Writing Better Code
How to Write a Code Review Without Losing Your Mind (or Patience)

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Primary Sidebar

Katarína Kováčová

Hi, I’m Katarina. I’m a mobile developer working with Android and iOS, and this blog is where I share things I learn, test, or find interesting in the world of mobile development.

I enjoy clear explanations, practical insights, and topics that make me think — a mix I try to bring into my writing as well.

Outside of tech, I like Sudoku, running, and reading thrillers and detective stories. I also cook and bake gluten-free, because I’m celiac, and experimenting in the kitchen has become part of my routine.

Welcome — hope you find something here that’s useful or inspiring.

My life in pictures

My kind of offline mode.
Old but still stealing the spotlight.
Chaos of ideas, order of pillows.
Where the world goes quiet for a moment.
Because every good day starts with a cookie.
2025 © Phelela
theme by soleilflare