This is Pokemon application, made with Jetpack Compose, Coroutines, Flow, Hilt, and Material Desing and follows a multi-module MVVM Architecture. It shows a list of the first 100 Pokemon elements, the ability to search and the Pokemon details screen.
https://pokeapi.co/api/v2/
The application follows Google’s Layered architecture design guideline. The app's overall architecture comprises of three layers: the UI, Domain Layer, and Data layers. Each of these has different responsibilities.
![Screenshot 2024-01-16 at 13 05 06](https://private-user-images.githubusercontent.com/7416651/297024072-327baccf-fc41-4768-931e-4a2f7522e273.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjI0MTk1MTAsIm5iZiI6MTcyMjQxOTIxMCwicGF0aCI6Ii83NDE2NjUxLzI5NzAyNDA3Mi0zMjdiYWNjZi1mYzQxLTQ3NjgtOTMxZS00YTJmNzUyMmUyNzMucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDczMSUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDA3MzFUMDk0NjUwWiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9ZDc2MzQ5NGE1MDk2OTY4ZGQxMzc5Zjg1NDJlZWQ3OTA4YTU4MzA5NWQ2NzBkNDNmZDkxYThhNzA2ZWFiOTRjNCZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.BV_vS2kkWqM_k9UiONT_TijTA4JkSnX1yyn7rg6QuuY)
The solution makes use of a Unidirectional Flow of data between each of the layers, the UI Layer components send events to the Domain Layer, which in turn sends data requests to the Data Layer. In return, the Data Layers send data to the Domain Layer, which sends UI events to the UI layer.
On the UI Layer, we make use of StateFlow for reactive state management. The views (composables) send events and observe data updates on the view model, and the view model responds by updating the state variables in question.
Modularization
To achieve a better code organization and a loosely coupled code base, we have separated each part into a different module. This is the dependency graph for all the modules defined on the app
![Screenshot 2024-01-16 at 13 35 19](https://private-user-images.githubusercontent.com/7416651/297032542-df7364de-57f6-4d06-bdd7-5688001166d0.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjI0MTk1MTAsIm5iZiI6MTcyMjQxOTIxMCwicGF0aCI6Ii83NDE2NjUxLzI5NzAzMjU0Mi1kZjczNjRkZS01N2Y2LTRkMDYtYmRkNy01Njg4MDAxMTY2ZDAucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDczMSUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDA3MzFUMDk0NjUwWiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9NGVlNzAyNmQ0ZTIyZTcxM2U5OTU0NGU1MWFiNDIyODUyZjFiNmVhYTAzYzYxNzY5MTA3ZDQwNTBiNjJjOWI2NyZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.N9RDzDvBa8rJB5w-YAAJ7lVatc8km8i3XLh_ZOFt6aw)
Screen_recording_20240116_101548.webm
-
Compose - For the UI, screens and custom views
-
Kotlin coroutines - Multithreading and Async operations
-
Hilt - Dependency management & injection
-
Retrofit - For communicating with the Pokemon API
-
Coil - Image loading, and displaying remote source images
-
Lottie - Used for some funky animations
-
Navigation componemt - For navigation between the composables
Copyright 2024 Potsane Mohale
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.