An android application architecture exploration in compose

Related tags

App pokedex-android
Overview
Project logo

Pokédex Android

An android application architecture exploration in compose

Project License WCAG WAI Code Style Android Supported API

About Android Pokedex project

Hello there, In this project I tried showcasing how to build an Android Application in Jetpack Compose with clean architecture and MVI using some of the jetpack libraries with Kotlin Coroutines & Dagger Hilt. This App is using the GraphQL-Pokemon as a remote data source.

This app is based on the Guide to app architecture article, Kotlin 1.5, and coroutine. I also used some android architecture components like LiveData, ViewModel.

You can check my short term backlog in my Github Projects here

Libraries Used

  • ViewModel - store and manage UI-related data in a lifecycle conscious way
  • LiveData - notify the view when data changes .
  • Jetpack Compose - describe ui components with declarative functions
  • Material - Material Components.
  • Coroutine - performs background tasks
  • Flows - for asynchronous data streams
  • Coil - An image loading library for Android backed by Kotlin Coroutines
  • Gson - JSON Parser
  • Apollo- GraphQL client for the JVM, Android and Kotlin multiplatform
  • Dagger Hilt - dependency injector
  • Room - Save data in a local database
  • Espresso - UI test
  • Junit - unit tests
  • Truth - Makes your test assertions and failure messages more readable
  • Detekt - a static code analysis tool for the Kotlin programming language
  • KTLint - Kotlin linter in spirit of feross/standard (JavaScript) and gofmt (Go).
  • Gradle Kotlin Plugin - Gradle scripts in Kotlin
Comments
  • Create Navigation tests

    Create Navigation tests

    ⚙️ In this PR a setup the dependecies to create a test for navigation compose like:

    • Updating junit version
    • Add test library for Dagger Hilt
    • Setup the same version of the Dagger Hilt to libraries
    • Created a Custom Test runner to instrumented tests and setup it up in the build.gradle file
    • Created a Hilt Activity to inject test modules to the tests

    🧑‍🔬 Tests: I created a Navigation test class. In this class I check if loaded the Search Screen and try to navigate to the Pokémon detail screen

    🩰 Next Steps:

    • Inject the test module into the unit tests
    opened by felipecastilhos 0
  • Add navigation for compose

    Add navigation for compose

    This PR creates a navigation graph using Jetpack Compose Navigation library and creates a navigation graph for the pokemon search.

    Also adds coil library to fetch remote images and handle image caches.

    Next steps: add navigation tests

    opened by felipecastilhos 0
  • Alterando do Pokemon-graphql api para a PokeAPI

    Alterando do Pokemon-graphql api para a PokeAPI

    Esse PR migra o uso da api do pokemon-graphql para a PokeAPI.

    O que foi feito:

    • Adicionando Retrofit
    • Removendo uso do apollo-graphql
    • Alterando o resultado dos datasources remotos para Result do Kotlin
    • Criando CallAdapter para lidar com retorno com Result no Retrofit

    Próximos passos:

    • Tratar melhor estados de UI
    • Criar uma Home para listar: Pokemons, Movimentos e Jogos
    enhancement 
    opened by felipecastilhos 0
  • Adicionando teste a Repositórios

    Adicionando teste a Repositórios

    Esse PR adiciona a capacidade de testar repositórios ao projeto.

    • Adição das bibliotecas para tetar coroutines
    • Ajustes no uso do Flow
    • DataSource expondo somente o objeto de dominio e não mais um objeto do Apollo

    Próximos Passos

    • Adicionar teste aos mappers usados no DataSource
    • Alterar o uso de Resource para Result no DataSource
    enhancement 
    opened by felipecastilhos 0
  • Utilizando abstração de modelos de dominio

    Utilizando abstração de modelos de dominio

    Descrição

    Para isolar as classes de graphql na camada de datasource, o repositório vai ficar com a responsabilidade de transformar as classes de datasource em classes de dominio para dentro da aplicação.

    Aqui futuramente seria interessante tratar melhor os erros do graphql

    Solução

    • Adicionado mappers na camada dos repositories para converter objetos do graphql em modelos do repositório

    Próximos passos

    • Adicionar testes nas viewmodels, repositories e use cases
    enhancement 
    opened by felipecastilhos 0
  • Convertendo Apollo Response para abstração de Resource

    Convertendo Apollo Response para abstração de Resource

    Descrição

    Esse PR converte a abstração de apollo response para a abstração de resource do projeto.

    Lembrando que: A abstração de resouce serve para buscar dado dos datasources, tanto local quanto remoto, informando o estado da operação:

    • Carregando
    • Sucesso
    • Erro

    Esse é o primeiro passo para separar a dependencia do graphql somente na estrutura do datasource, removendo a dependência dele dentro da camada de domínio do projeto.

    Solução

    • Retornando um flow da camada de datasource contendo um resource
    • Adicionado tratamento do estado do resource na activity iniciando o tratamento de erros na aplicação

    Próximos passos

    • Melhorar o tratamento de erro
    • Separar talvez o resource de domain
    • Transformar o objeto do GraphQl em um model do projeto
    enhancement 
    opened by felipecastilhos 0
  • Organização do projeto

    Organização do projeto

    Descrição

    Agrupa todas classes utilitárias para criação de um projeto android no pacote core (talvez no futuro possa virar um módulo ou até uma outra lib).

    Dessa forma o projeto fica organizado da seguinte forma:

    project
        | buildSrc // Configurações de dependencias gradle do projeto
        | app // configurações principais do projeto
            | features // features da aplicação
            | core // classes da arquitetura e utilitários do projeto
                | coroutines // classes utilitárias para trabalhar com coroutines
                | datasource // classes utilitárias para trabalhar com datasources remotos e locais do projeto
                | di // classes com para prover componentes para injeção de dependência da arquitetura do projeto
                | logs // classes para trabalhar com logs no projeto  
             
    

    Solução:

    Migrado para arquitetura descrita acima

    enhancement 
    opened by felipecastilhos 0
  • Melhorando a divisão de responsabilidades

    Melhorando a divisão de responsabilidades

    Descrição

    Melhora a divisão de responsabilidades da aplicação, deixando mais claro o que a camada de datasource e domain devem fazer.

    Solução:

    • Adicionado o uso do flow na cama da data source
    • Divindo melhor a aplicação em datasource, domain e view
    • Movendo a dependência do apollo somente para a camada de datasource
    • Adicionado a abstração de Resource, para buscar informação do datasource

    Próximos passos

    • Remover a dependência das classes geradas do apollo da camada de domain, pra remover dependência da aplicação da api
    • Adicionar testes nas viewmodels
    enhancement 
    opened by felipecastilhos 0
  • Adicionando biblioteca para mockar objetos em testes

    Adicionando biblioteca para mockar objetos em testes

    Descrição

    Biblioteca adicionada para que seja possível mockar objetos como o Apollo.

    Solução

    • Adicionada versão e biblioteca ao arquivo Dependencies.kt
    • Adicionado biblioteca no build.gradle

    Próximos passos

    • Adicionar teste de viewmodel
    enhancement 
    opened by felipecastilhos 0
  • Trabalhando com coroutines em viewmodel

    Trabalhando com coroutines em viewmodel

    Descrição

    Esse PR adiciona um framework para trabalhar com courotines em viewmodels.

    Solução

    • Adicionada abstração para trabalhar com os coroutine dispatchers
    • Adicionada abstração para contextualizar os dispatchers com a viewmodel
    • Criada uma abstração(CoroutineViewModel)) de ViewModel para lidar com courotines.

    Próximos passos

    • Adicionar testes nas viewmodels
    • Criar abstração de Viewmodel para trabalhar com requests e retries
    enhancement 
    opened by felipecastilhos 0
  • Criar release ao fazer push na main

    Criar release ao fazer push na main

    Descrição

    Ao ser feito commit para main, automaticamente é gerada uma tag e uma release com o código da versão.

    Solução

    • Foi adicionada um action para fazer release
    • A versão é retirada do arquivo: BuildConfigVersions.kt, do módulo buildSrc

    Próximos passos

    • Tag ser gerada em cima do número da build e não do version name
    enhancement 
    opened by felipecastilhos 0
Releases(v0.0.9)
Owner
Felipe Castilhos
The less I type. Faster I work. Automate everything.
Felipe Castilhos
Food Recipes - Android application built with Jetpack compose, MVVM and clean architecture approach.

Food Recipes Android application that consuming (https://spoonacular.com/food-api) "Recipes api". It has been built with clean architecture principles

Mahmoud Elshahat 26 Jan 29, 2023
:movie_camera: Movie discovery app showcasing Android best practices with Google's recommended architecture: MVVM + Repository + Offline support + Android Architecture Components + Paging library & Retrofit2.

Popular Movies Stage 1 + Stage 2 Discover the most popular and top rated movies playing. Movies data fetched using themoviedb.org API. ✨ Screenshots M

Yassin AJDI 189 Nov 26, 2022
🛒A Minimal Expense E-Commerce App built to demonstrate the use of modern android architecture components [Navigation, Room, MotionLayout, etc..] with MVVM Architecture. ✔

E-Store A Simple E-Commerce App ?? built to demonstrate the use of modern android architecture component with MVVM Architecture ?? . Made with love ❤️

Ameen Essa 14 Nov 3, 2022
A Simple Expense Tracker App 📱 built to demonstrate the use of modern android architecture component with MVVM Architecture

Expenso ?? A Simple Expense Tracker App ?? built to demonstrate the use of modern android architecture component with MVVM Architecture ?? . Made with

Michel Horacio 1 Dec 28, 2022
NewsSpac-MVVM-CleanArch-TDD - The App uses MVVM architecture together with Clean architecture

Aplicativo NewsSpace Arquitetura O App utiliza a arquitetura MVVM em conjunto co

null 1 Feb 11, 2022
ArchGuard is a architecture governance tool which can analysis architecture in container, component, code level, create architecure fitness functions, and anaysis system dependencies..

ArchGuard backend ArchGuard is a architecture governance tool which can analysis architecture in container, component, code level, database, create ar

ArchGuard 446 Dec 20, 2022
Shreyas Patil 2.1k Dec 30, 2022
NewsApp is a an android project based on modern Android application tech-stacks and MVVM architecture.

NewsApp NewsApp is a an android project based on modern Android application tech-stacks and MVVM architecture. This project is for focusing especially

null 1 Jan 14, 2022
Alkaa is a to-do application project to study the latest components, architecture and tools for Android development

Alkaa (begin, start in Finnish) is a to-do application project to study the latest components, architecture and tools for Android development. The project evolved a lot since the beginning is available on Google Play! ❤️

Igor Escodro 851 Jan 9, 2023
MVVM News Application with clean code architecture & android jetpack components.

Android - Clean Architecture - Kotlin The purpose of this repo is to follow up Clean Architecture principles by bringing them to Android. The repo con

Rafsan Ahmad 38 Aug 8, 2022
How to build an Android application using the Uncle Bob's Clean Architecture approach

MVI-Clean-Architecture This is a sample app & basic code that demonstrate how to

Ahmed Shaban  Elhdad 13 Oct 22, 2022
☀️ Wheater is a small demo application based on modern Android tech-stacks and MVVM architecture. ⛅

Wheater is a small demo application based on modern Android tech-stacks and MVVM architecture. Tech stack & Open-source libraries Minimum SDK level 19

null 2 Jan 17, 2022
A minimalistic Android application Built with Clean architecture and Jetpack component

MovieMania A minimalistic Android application Built with Clean architecture and Jetpack component (Jetpack Compose, MVVM , Paging 3.0, HILT, ROOM DB,

Farhan Tanvir 196 Jan 1, 2023
A complete app that demonstrate how to build an Android application using the Uncle Bob's Clean Architecture approach

?? Blog taking application utilizing Ktor REST-API and following modern practices: Kotlin, Coroutines, Flows, Channels, Room, Work Manager, Navigation Component, MVI, Clean Architecture, Modularization, Dagger Hilt, Tests...

Haythem Mejerbi 47 Dec 17, 2022
Movie application created with TMDB API, Architecture Components, Android Jetpack libraries

MovieApp Movie application created with TMDB API, Architecture Components, Android Jetpack libraries Built With ??️ • Kotlin - The language used in th

Ahmet Tufan 5 Sep 29, 2022
❤️ A sample Marvel heroes application based on MVVM (ViewModel, Coroutines, LiveData, Room, Repository, Koin) architecture.

MarvelHeroes MarvelHeroes is a demo application based on modern Android application tech-stacks and MVVM architecture. Fetching data from the network

Jaewoong Eum 1.2k Dec 19, 2022
Book Parking is a demo application based on MVVM architecture. The app allows users to booking parking slots, the app uses firebase for the backend.

Book Parking is a demo application based on MVVM architecture. The app allows users to booking parking slots, the app uses firebase for the backend.

Dheeraj Gupta 5 Dec 24, 2022
The application is developed using Modern tools/libraries with UI implementations with Navigation architecture

This is mobile application which actual users will interact with. The application is developed using Modern tools/libraries with UI implementations with Navigation architecture. It connects with the Dog API to retrieve data. more detail of api can be found here - https://dog.ceo/dog-api/documentation/random This project a basic example of Retrofit and mvvm

null 4 Feb 3, 2022