Skip to content

Potsane/pokemon_app

Repository files navigation

Pokemon App

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.

API

https://pokeapi.co/api/v2/

Artchitecture

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

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.

Screenshot 2024-01-16 at 13 10 37

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

Illustraton

Screen_recording_20240116_101548.webm

LIBRARIES USED

  • 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

License

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.