• Skip to main content
  • Skip to primary sidebar

Phelela

  • Phelela
  • Engineer Path
  • My Project
  • Home Office
  • Day Off
  • 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 My Project

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
Why is Sudoku Good for me? – 7 Benefits for Brain Health

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 backend software engineer. My specialization is Android & Backend development. I started this blog as a space to share my journey in tech. It also serves as a portfolio of my work and a place for exciting topics.

When I’m not coding, I get lost in the fascinating world of Sudoku. Welcome to my corner of the internet.

My life in pictures

This year will be mine. I belive I will beat my obesity.
My first work with GCP – I was on a Cloud 9.
I really adore old cars. They are elegant and beautiful.
Need some rest and a good book in Spanish. Maybe Harry Potter?
I started with regular running and I feel incredible.
2025 © Phelela
theme by soleilflare