A calorie tracker app based on Philipp Lackner's multi module course. With this app you can search for any type of food you desire, whether it's breakfast, lunch, dinner or a snack. Once you have found the food you want, you can add it to your meal section, which helps you keep track of what you're eating throughout the day. You can find the detailed tech stack and architecture in the below sections. The purpose is to learn how to structure different modules with Clean Architecture.
After completing the course I made the following changes/improvements:
- Replaced Compose Navigation with Compose Destinations
- Inceased test cases
- Added Detekt for static code analysis
- Android Architecture Components - Best practices for testable, maintainable and robust high-quality apps.
- Compose Destinations - Easy navigation library for compose (used with single activity)
- Lifecycle - use viewmodel, a lifecycle aware component
- ViewModel - Stores UI-related data and persists it through configuration changes.
- UseCases
- Contains business logic with a single responsibility.
- Located in domain layer that sits between the UI layer and the data layer.
- Repository - Located in data layer that contains application data and business logic.
- Jetpack Compose - is the modern toolkit recommended by Android for building native user UI. It streamlines and speeds up the development process by allowing for the creation of powerful and intuitive UI with less code and easy-to-use Kotlin APIs.
- Android Hilt - Dependency Injection Library for Android
- Coroutines - is a concurrency design pattern that you can use on Android to simplify code that executes asynchronously.
- Flow - is a type that can emit multiple values sequentially. They are built on top of coroutines and can provide multiple values.
- Channels - are a good fit for communication between different coroutines, or any use case that requires a producer-consumer approach.
- Room - Persisten library for Android
- Retrofit - simplifies network requests and responses by providing a high-level REST client implementation.
- Coil Compose - is a library for loading images on Android, utilizing Kotlin Coroutines for efficient and responsive performance.
- Detekt - Static code analysis for Kotlin
- Timber - Logging library for Android
- Testing
- Truth - Fluent assertions for Android
- Mockk - Mocking library
- MockWebServer - A scriptable web server for testing HTTP clients
- Turbine - A small testing library for kotlinx.coroutines Flow
The app is built using MVVM (Model-View-ViewModel) architecture with Presentation, Domain and Data layers.
The graph below illustrates the relationships between different modules by indicating which modules include other modules.