Comments (2)
Happy to give some insight into the module structure.
The structure at the moment is a bit of an amalgamation of just trying stuff out, and pulling ideas from other projects I've worked on, luckily it seems to work fairly well.
The general structure I've tried to follow is
app
- Contains as little code as possible, main application class, hilt modules, main activity etcfeatures
- Contains dedicated features such as "login" or "settings"libraries
- Contains code that could be pulled into any feature for reusability
with a simple dependency graph being
app -> features
app -> libraries
features -> libraries
One improvement I think that could be made is a deeper set of modules for core components that could be used anywhere such as core
or foundation
, things like the string resources or retrofit configuration etc would sit there.
Pros and cons of this approach match what you would get with other modular structures, especially when it comes to performance etc.
But pros and cons for this particular structure I've found
Pros:
- Easy to know where to put a new module, removes ambiguity when adding new code
- Project navigation is pretty simple, always know where a component would be
- "Rules" on what can depend on what are usually easy to follow
- Code ownership in bigger teams is easier when you can say "Team X owns the login modules"
Cons:
- Lots of modules, quite easy to keep adding more modules
from nekome.
Thanks for the response. I have decided to also add CLI target for my app so the modules I imagine will be like this
app
- you said it will contain as little code as possible, probably it will be a bit different on my app. For example if there would be a screen which is like 20 lines of code, then I will leave it there...
cli
- this will be the terminal version of the app
there will be also app-features
and cli-features
folders with modules, which will contain the logic for their UI. I imagine they will be presentation layers.
and the libraries
folder will contain just Kotlin and other libraries that do not have dependency on Android. So it will be possible to reuse them in both CLI and Android variants. They will be like data and domain layer. Looking at the modules Nekome has, all of them depend on Android, for example :libraries:datasource:auth
seems to be just Kotlin. Was there a specific reason for having all modules depend on Android?
Found another interesting app having modules. But not yet sure what idea I will copy from them. Most likely 80% of my app will be just like Nekome.
Also watched this video, where a guy mentions apps having hundreds of modules, that would be interesting to see such apps. For mine it probably wont be much since I am alone and hopefuly my will power will last enough...
from nekome.
Related Issues (20)
- Add a fallback for user profile image if avatarUrl is null HOT 1
- Add Monochrome icon for android 12 and above. HOT 5
- Add volume progress HOT 1
- I made a new icon ! HOT 1
- Accessing animes with "/" (slash) in the title crashes the app HOT 2
- A problem occurred configuring root project 'Nekome'. HOT 1
- Support for alternate services? HOT 3
- Can skip login details screen HOT 1
- Add Black/AMOLED theme
- Add title preference setting HOT 1
- Japanese translation HOT 2
- Can't refresh if one of the lists is empty HOT 1
- Allow editing in the search module, and searching your list HOT 2
- Ability to add custom links to specific anime HOT 1
- Dependency Dashboard
- [Feature Request] Material You Support HOT 2
- MyAnimeList Support HOT 1
- Latest Version not available on F-Droid. HOT 2
- Can't Login. HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nekome.