|
1 |
| -[] |
2 |
| -[] |
3 |
| -[](https://developer.android.com/reference) |
4 |
| -[](https://app.bitrise.io/app/64cd2ed600a14151) |
| 1 | +<h1 align="center">SpaceX prepare for Clean Architecture liftoff:rocket:</h1> |
5 | 2 |
|
6 |
| -# SpaceX prepare for Clean Architecture liftoff:rocket: |
7 |
| - |
8 |
| - |
9 |
| - |
10 |
| -## Table of Contents |
11 |
| -- [Demo](#demo) |
12 |
| -- [Introduction](#introduction) |
13 |
| -- [Modules](#modules) |
14 |
| -- [Testing](#testing) |
15 |
| -- [Libraries Used](#libraries_used) |
16 |
| -- [License](#license) |
17 |
| - |
18 |
| -## Demo |
19 | 3 | <p align="center">
|
20 |
| - <img src="art/SpaceX-Dark.gif" width="49%"> |
21 |
| - <img src="art/SpaceX-Light.gif" width="49%"> |
| 4 | + <a href="https://opensource.org/licenses/Apache-2.0"><img alt="License" src="https://img.shields.io/badge/License-Apache%202.0-blue.svg"/></a> |
| 5 | + <a href="https://android-developers.googleblog.com/2021/07/android-studio-arctic-fox-202031-stable.html"><img alt="Android Studio Arctic Fox" src="https://img.shields.io/badge/AS%20Arctic%20Fox-2020.3.1-9cf.svg"/></a> |
| 6 | + <a href="https://developer.android.com/reference"><img alt="Platform" src="https://img.shields.io/badge/platform-android-brightgreen.svg"/></a> |
| 7 | + <a href="https://app.bitrise.io/app/64cd2ed600a14151"><img alt="Build Status" src="https://app.bitrise.io/app/64cd2ed600a14151/status.svg?token=9eYCKzT6HcFJeAGeZmEH6g&branch=master"/></a> |
22 | 8 | </p>
|
23 | 9 |
|
24 |
| -## Introduction |
25 |
| -The purpose of this project is to consolidate some of the learned insights throughout the years about the `Clean Architecture` principles and reflect those lesson on Android, taking advantage of the Kotlin programming language features too. |
26 |
| -This project summarises some of the general use cases and needs that could be demanded on a production project using:`Jetpack Compose`, `Functional Programming`,`MVVM` setup, `Coroutines`, `Kotlin Flows` and `LiveData` (I've kept a branch using `RxJava` too). |
27 |
| - |
28 |
| - |
29 |
| - |
30 |
| -## Modules |
31 |
| -* **app** - The application module with access to **all the application** |
32 |
| -* **data** - Android module that **can only access domain module** |
33 |
| -* **data-api** - Android module that **can only access data module** |
34 |
| -* **domain** - Kotlin module that **cannot access any other module** |
35 |
| - |
36 |
| -And two extra modules: |
37 |
| -* **core** - Base classes module (factories, events, etc.) that **cannot access any other module** |
38 |
| -* **core-android-test** - Tests classes module (rules, date builders,etc.) that **cannot access any other module** |
39 |
| - |
40 |
| -## Testing |
41 |
| - |
42 |
| -### Unit Testing |
| 10 | +<p align="center"> |
| 11 | +SpaceX prepare for Clean Architecture liftoff:rocket: is a small demo application based on modern Android application tech-stacks and MVVM architecture.<br>The purpose of this project is to consolidate some of the learned insights throughout the years about the `Clean Architecture` principles and reflect those lesson on Android, taking advantage of the Kotlin programming language features too. |
| 12 | +<br>This project summarises some of the general use cases and needs that could be demanded on a production project using:`Jetpack Compose`, `Functional Programming`,`MVVM` setup, `Coroutines`, `Kotlin Flows` and `LiveData` (I've kept a branch using `RxJava` too). |
43 | 13 |
|
44 |
| -There are some highlights: |
45 |
| -* Every layer in the architecture has been tested with its mapper|transformer|provider. |
46 |
| -* Mockito has been used for mocking|stubbing. |
47 |
| -* `Given|When|Then` steps have been followed, in order to give a more structured overview. |
48 |
| -* No comments in the tests because the tests functions are already concise and clear. |
| 14 | +</p> |
| 15 | +</br> |
49 | 16 |
|
50 |
| -### UI Testing (Compose) |
| 17 | +<p align="center"> |
| 18 | +<img src="/art/SpaceX-Latest-Banner"/> |
| 19 | +</p> |
51 | 20 |
|
52 |
| -I opted to use two types of approaches: |
53 |
| -- One using MockWebserver, where I recreate a real scenario where the app connects to an endpoint and I test the cases. |
54 |
| -- Another one, that I consider `Isolated Compose Tests`, where it's possible to mock and set any content, UI state, etc. Which is to emulate very specific cases. |
55 |
| - |
56 |
| -This section is still evolving. |
57 | 21 |
|
| 22 | +<img src="/art/SpaceX-Demo.gif" align="right" width="32%"/> |
58 | 23 |
|
59 | 24 | ## Libraries Used
|
60 | 25 | * [Compose][0] for building native UI (declarative way using Kotlin).
|
@@ -85,6 +50,60 @@ This section is still evolving.
|
85 | 50 | [11]: https://airbnb.io/lottie/#/android-compose
|
86 | 51 | [12]: https://github.com/JodaOrg/joda-time
|
87 | 52 |
|
| 53 | +## Modules |
| 54 | +* **app** - The application module with access to **all the application** |
| 55 | +* **data** - Android module that **can only access domain module** |
| 56 | +* **data-api** - Android module that **can only access data module** |
| 57 | +* **domain** - Kotlin module that **cannot access any other module** |
| 58 | + |
| 59 | +And two extra modules: |
| 60 | +* **core** - Base classes module (factories, events, etc.) that **cannot access any other module** |
| 61 | +* **core-android-test** - Tests classes module (rules, date builders,etc.) that **cannot access any other module** |
| 62 | + |
| 63 | +## Branches |
| 64 | +There are three options depending on different tech-stack desired. The latest codebase will be updated in master. |
| 65 | +These are the three options available (all of them maintained): |
| 66 | + |
| 67 | +- master |
| 68 | + - Jetpack Compose (declarative UI) |
| 69 | + - Dagger Hilt |
| 70 | + - VM approach using UI States and Effects |
| 71 | + - Kotlin Flows (removed LiveData) |
| 72 | + - Modules simplification |
| 73 | + - The rest of modules remain the same (Tests) |
| 74 | + |
| 75 | +- SpaceX-Coroutines-Flows |
| 76 | + - Imperative UI |
| 77 | + - Dagger2 |
| 78 | + - Kotlin Coroutines and Flows |
| 79 | + - Granular modularisation (CleanArchitecture approach) |
| 80 | + - Unit Tests + UI Tests + MockWebServer + Robot Pattern |
| 81 | + |
| 82 | +- SpaceX-RxJava |
| 83 | + - VMs and Fragments communication via RxJava |
| 84 | + - Dagger2 |
| 85 | + - Granular modularisation (CleanArchitecture approach) |
| 86 | + - Unit Tests + UI Tests + MockWebServer + Robot Pattern |
| 87 | + |
| 88 | +## Testing |
| 89 | + |
| 90 | +### Unit Testing |
| 91 | + |
| 92 | +There are some highlights: |
| 93 | +* Every layer in the architecture has been tested with its mapper|transformer|provider. |
| 94 | +* Mockito has been used for mocking|stubbing. |
| 95 | +* `Given|When|Then` steps have been followed, in order to give a more structured overview. |
| 96 | +* No comments in the tests because the tests functions are already concise and clear. |
| 97 | + |
| 98 | +### UI Testing (Compose) |
| 99 | + |
| 100 | +I opted to use two types of approaches: |
| 101 | +- One using MockWebserver, where I recreate a real scenario where the app connects to an endpoint and I test the cases. |
| 102 | +- Another one, that I consider `Isolated Compose Tests`, where it's possible to mock and set any content, UI state, etc. Which is to emulate very specific cases. |
| 103 | + |
| 104 | +This section is still evolving. |
| 105 | + |
| 106 | + |
88 | 107 | ## License
|
89 | 108 | Copyright 2021 Fernando Prieto Moyano
|
90 | 109 |
|
|
0 commit comments