Client app architecture - mzogheib/quoll GitHub Wiki
Summary
- Based on Clean Architecture and MVVM.
- The application is split into layers
- View
- View Model
- Model
- Service
- Upper layers depend on lower layers. Not the other way around, e.g. code in the Service layer cannot call code in the Model layer.
Layers
View
- The UI components, screens etc.
- Has minimal logic just for managing the UI, e.g. event handlers, navigation etc.
- No CRUD or application logic - that should be triggered via View Models instead.
View Model
- Defines the application logic that the View layer can trigger.
- Composes CRUD operations from the Model layer.
Model
- Defines the async CRUD operations on a given entity.
- Manages the application state while doing these operations, e.g. setting loading indicators, entity values etc.
Store
- Persists application state to be used across the app.
- Each model has its own store.
Service
- The external systems onto which CRUD operations are done