PropertyApp is a sample Android application developed using Jetpack Compose and follows the Modern App Architecture, incorporating modern design principles and development practices to create a robust and maintainable codebase.
Light | Dark | Loading and Error |
---|---|---|
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
The app follows a well-defined and organised architecture to ensure scalability and maintainability. Key architectural principles include:
- Reactive and Layered
- Unidirectional Data Flow
- Flows
- Dependency Injection
The data layer plays a crucial role in exposing data to the rest of the app. It consists of two main components:
-
Property API (Remote Datasource): This component handles interactions with the remote data source and fetches property data.
-
Property Repository: Responsible for abstracting the data source implementation details from the domain layer, the Property Repository provides a clean interface to access property data within the app.
The domain layer encapsulates the business logic of the application, enhancing reusability and testability. It includes the getPropertiesUseCase, which is responsible for converting the data received from the API into a format that is more view-friendly. Additionally, it efficiently handles and emits success and error cases through appropriate flow data, ensuring a smooth data flow throughout the app.
The UI layer serves as the front-end of the application, consuming data from the domain layer. It consists of two main components:
- ViewModel: plays a central role in the UI layer, publishing data to be observed and consumed by the UI elements, following the UDF (unidirectional data flow) pattern.
- UI Elements: responsible for presenting the data to the users, and sending events/ user actions to the ViewModel.
The UI layer establishes a clear separation of concerns, with the ViewModel solely responsible for publishing data, while the UI elements interact with the ViewModel by sending events, forming a unidirectional data flow.
Dagger-Hilt
- Although Koin DI is more appropriate for an app of this size, Hilt is a subjective preference.
Retrofit
- It makes networking so much easier.
Moshi
- I think Moshi is a better JSON processor than Gson. Also, Iโm more familiar with it.
Coil
- Image loading library that is light, fast, modern and easy to use (according to https://github.com/coil-kt/coil)
Accompanist Navigation with Compose
- Deprecated because all the functionalities will be in
androidx.navigation.compose
(Still in Alpha release as of now).
Google Truth
- Personal preference purely due to readability and expressiveness.
![unitTestSS](https://private-user-images.githubusercontent.com/72930376/255397180-e40d3e62-d0c6-4c68-9514-3b6c04fea063.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTcwMTcyODIsIm5iZiI6MTcxNzAxNjk4MiwicGF0aCI6Ii83MjkzMDM3Ni8yNTUzOTcxODAtZTQwZDNlNjItZDBjNi00YzY4LTk1MTQtM2I2YzA0ZmVhMDYzLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA1MjklMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNTI5VDIxMDk0MlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTk3ZmEzMGZkODg3ZmY3NDYwYzYxN2E4ZDEwZDJjMThmMjUxMGY1MjAwMjRmMGMwODg5Nzk3MmYyNjc5MmZiYzQmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.WTU5cszl1qof5mUOnVtcTLaNbbZqKVps2vwcVfw8BZQ)