Skip to content

DRAFT: refactor discused in #116 - #132

Draft
jakubdomanski wants to merge 29 commits into
snehmatic:mainfrom
jakubdomanski:feature/118-code-refactor
Draft

DRAFT: refactor discused in #116#132
jakubdomanski wants to merge 29 commits into
snehmatic:mainfrom
jakubdomanski:feature/118-code-refactor

Conversation

@jakubdomanski

@jakubdomanski jakubdomanski commented May 19, 2026

Copy link
Copy Markdown
Contributor

THIS IS DRAFT
Just wanted to show that I'm still working on it; it’s taking a bit longer than expected.

Closes #119, #118, #117

See discussion #116

At time of writing this changes are tested by automatic testing and manually testing the web interface.
TODO:

  1. CLI is still untested.
  2. Some things are still coupled to db - e.g. aiService
  3. Some TODOs are added in code and should be done before merging
  4. Sync the fork with the upstream repository, since breaking changes prevent automatic merging of the fork branch.

What was done:

  1. repository pattern is introduced to core services. SQL as only implementation.
  2. User config is now singleton, most of the time is passed via DI, some work still needs to be done in this area
  3. errors moved to vars
  4. reworked logger to decouple services and zerolog
  5. some variable names are changed due to conflicting with package name
  6. some minor changes that i forgot
  7. lint/test/build CI runs on every branch now for easy code validation

Possible next steps / ideas:

  1. introduce ddd to core. This is a nice explanation/example: https://github.com/sklinkert/go-ddd
  2. Add support for other database connectors and repository implementations (e.g. Mongo). For now i'd categorize this as nice to have, just put it in backlog and forget :D
  3. More integrations - for me obsidian is the second brain and i just wanted to move daily notes from obsidian to more manageable tool. Right now, using this means duplicating work if I still want to persist that data in Obsidian. Maybe Ai Service could fill a user template with mindloop data? Or put file directly via mcp. Linking between existing notes and note "what i've done this week" would be nice addition.
  4. some authorization - allow to hide your dashboard on cloud instalation.
  5. multiple users on 1 cloud instance
  6. TUI - like lazygit https://github.com/jesseduffield/lazygit but for mindloop (this will probably work best with grpc, not http, and require massive amount of work)
  7. rework of config:
    6.1. to make kubernetes deployment easier - all vars in config should be able to overwrite by os.GetEnv()
    6.2. user config should be moved to db and edited by user in web/cli/tui
    6.3. initialization of the app should not depend on running some magic command in cli - wordpress like configuration in web at first run/login would be nice
  8. helm chart published on artifacthub.io for easy cloud deployment.

@jakubdomanski
jakubdomanski marked this pull request as draft May 19, 2026 09:58
@snehmatic

Copy link
Copy Markdown
Owner

I went through the suggestions quickly @jakubdomanski. Thanks for giving it this much thought. Honestly these seem to be pretty good additions to the repo. I'll take a closer look later and probably create issues and breakdowns. I'm struggling with my own capacity to work on mindloop for the time, but I'm sure breaking these down to finer details will help anyone contribute as well. Or if you'd like you could as well.

Thanks again! appreciate it.

@jakubdomanski

Copy link
Copy Markdown
Contributor Author

Sorry for the delay; I've had some stuff on my head that was very important.
I'll continue working on this and make the switch to DDD in this MR.
For the rest of the points, I will make issues after completing this MR, no problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Cleanup and organise common variables and errors

2 participants