Does anyone know any good open source examples or ...
# compose-desktop
b
Does anyone know any good open source examples or articles on how to best structure a compose application? or what patterns to use? i've tried using stuff from android but sometimes you just don't have libraries available to accomplish all of the same things
a
I learned a lot from this repo: https://github.com/chrisbanes/tivi I used KodeinDI as DI framework for our html and desktop apps. I made a simple ViewModel implementation to use cross platform as well.
s
My production app Ashampoo Photos is based on this and I can generally recommend it: https://github.com/Kotlin/kmm-production-sample This simple redux pattern is well suited to handle complex logic and make it testable.
c
I’ve found the Android docs on Architecture to be extremely helpful in thinking through my own projects and really understanding the why and how of mobile app architecture. And along with that, the Now in Android is a pretty good implementation of the principles of those architecture documents
👍 1
In particular, introducing an explicit Domain Layer has been the biggest improvement I’ve been making in my own projects lately. Using my Ballast MVI library for the UI and an explicit Domain Layer has helped me to put logic in the right places to make even the most complex features pretty straightforward to implement. My “stack” does introduce a fair amount of boilerplate, but what I get in return in terms of maintainability, testability, analytics, etc. is worth it for me.
a
@Casey Brooks cool, that’s exactly what we did. It felt a bit over engineered at first. But when the app grows it really helps! DI was critical here though
c
Yeah, I spent some time trying to get the arch to work with “manual DI”, but came to the conclusion that if the app is large enough to actually benefit from this “Clean Architecture” approach, it’s large enough that it needs proper DI. I’ve been using Koin and have been happy enough it it so far.
I’ve also been reading Just Enough Architecture, which has helped me understand when to apply this “over-engineered” architecture (because it’s definitely overkill for smaller apps)
a
Cool, Will check that book