Skip to content

Commit

Permalink
revert README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
anmolvermamm committed Feb 2, 2022
1 parent f916b09 commit 13acefe
Showing 1 changed file with 39 additions and 64 deletions.
103 changes: 39 additions & 64 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,94 +1,69 @@
# Praxis Android Clone with Compose

### Status: 🚧 In progress 🚧
# Praxis
2022 Hit Refresh! Praxis now loves ❀️ Jetpack Compose

This is a jetpack compose sample app written in Kotlin following clean architecture principles.
<div align="left">
<a href = "https://developer.android.com/jetpack/androidx/versions/all-channel#may_5_2021">
<img src = "https://img.shields.io/badge/Jetpack%20Compose-1.0.0%20beta08-brightgreen" />
</a>
</div>
<br>

The purpose of this app to showcase:
This is a sample app written in Kotlin following clean architecture principles which fetches random jokes, trending Github repository and displays it.

- Implementation of Jetpack Android Architecture components with Dagger Android and Data Binding to
minimize boilerplate code
- Creation of proper components and Subcomponents using Dagger Android and their injection into
Activity, Fragment, View Models and Helper Classes
The purpose of this app to showcase:
- Implementation of Jetpack Android Architecture components with Dagger Hilt and Data Binding to minimize boilerplate code.
- Implementation of an architecture that will support both XML and the new Compose.
- Implementation of Modular Multi Module Navigation Architecture.
- Performing background task with Kotlin Coroutines

## Screenshots

| Screenshots | In Progress |
|---------------- |------------------------------ |
| <img src="art/art1.png" alt="drawing" style="width:300px;"/> | <img src="art/art2.png" alt="drawing" style="width:300px;"/> |
| <img src="art/art3.png" alt="drawing" style="width:300px;"/> | <img src="art/art4.png" alt="drawing" style="width:300px;"/> |
| <img src="art/art5.png" alt="drawing" style="width:300px;"/> | <img src="art/art6.png" alt="drawing" style="width:300px;"/> |
| <img src="art/animated_start.gif" alt="drawing" style="width:300px;"/> | <img src="art/animated_search.gif" style="width:300px;"/> |
| <img src="art/art8.gif" alt="drawing" style="width:300px;"/> | <img src="art/art9.png" alt="drawing" style="width:300px;"/> |

### TODOs and questions to self

- Rewrite the Colors and light/dark mode compatibility!
- Should we have separate theme for each UI module ?
- How to handle dynamic theme colors ?

## πŸ—οΈοΈ Built with ❀️ using Jetpack Compose 😁
# Requirements
1. Android Studio : Arctic Fox | 2020.3.1 3.1 or higher
2. Android Emulator or Physical android device

| What | How |
|---------------- |------------------------------ |
| 🎭 User Interface (Android) | [Jetpack Compose](https://developer.android.com/jetpack/compose) |
| πŸ— Architecture | [Clean](https://blog.cleancoder.com/uncle-bob/2012/08/13/the-clean-architecture.html) |
| πŸ’‰ DI (Android) | [Hilt](https://developer.android.com/training/dependency-injection/hilt-android) |
| 🌊 Async | [Coroutines](https://kotlinlang.org/docs/coroutines-overview.html) + [Flow](https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.flow/-flow/) |
| 🌐 Networking | [Retrofit](https://square.github.io/retrofit/) |
| πŸ“„ Parsing | [KotlinX](https://kotlinlang.org/docs/serialization.html) |
# Built With πŸ—

## Languages, libraries and tools used
| Tools | Link |
| :--- | :---: |
| πŸ€– Kotlin | [Kotlin](https://kotlinlang.org/) |
| πŸ› Architecture Components | [Android Architecture Components](https://developer.android.com/topic/libraries/architecture) |
| β›“ Data Binding | [Android Data Binding](https://developer.android.com/topic/libraries/data-binding) |
| πŸ’‰ Dagger Hilt | [Dagger Hilt](https://developer.android.com/training/dependency-injection/hilt-android) |
| 🌐 Retrofit | [Retrofit](http:https://square.github.io/retrofit/) |
| 🚦 OkHttp | [OkHttp](http:https://square.github.io/okhttp/) |
| πŸ“„ Gson Parsing | [Gson](https://github.com/google/gson) |
| 🌊 Coroutines | [Kotlin Coroutines](https://developer.android.com/kotlin/coroutines) |
| πŸ„πŸΌβ€β™€οΈ Flows | [Flows](https://developer.android.com/kotlin/flow) |

- [Kotlin](https://kotlinlang.org/)
- AndroidX libraries
- [Android Architecture Components](https://developer.android.com/topic/libraries/architecture)
- [Android Data Binding](https://developer.android.com/topic/libraries/data-binding)
- [Dagger 2](https://github.com/google/dagger)
- [Retrofit](http:https://square.github.io/retrofit/)
- [Kotlin Coroutines](https://developer.android.com/kotlin/coroutines)

## Architecture

PraxisClone follows the principles of Clean Architecture with Android Architecture Components.
### Praxis follows the principles of Clean Architecture with Android Architecture Components.

### Architecture's layers & boundaries:

<img src="art/architecture.jpeg" />

**UI Layer** contains _UI (Activities, Composables, Fragments)_ that are coordinated by _
ViewModels which execute 1 or multiple UseCases._ Presentation Layer depends on Domain Layer.
**Presentation Layer** contains _UI (Activities & Fragments)_ that are coordinated by _ViewModels which execute 1 or multiple UseCases._ Presentation Layer depends on Domain Layer.

**Domain Layer** is the most INNER part of the circle (no dependencies with other layers) and it
contains _Entities, Use cases & Repository Interfaces._ Use cases combine data from 1 or multiple
Repository Interfaces.
**Domain Layer** is the most INNER part of the circle (no dependencies with other layers) and it contains _Entities, Use cases & Repository Interfaces._ Use cases combine data from 1 or multiple Repository Interfaces.

**Data Layer** contains _Repository Implementations and 1 or multiple Data Sources._ Repositories
are responsible to coordinate data from the different Data Sources. Data Layer depends on Domain
Layer.
**Data Layer** contains _Repository Implementations and 1 or multiple Data Sources._ Repositories are responsible to coordinate data from the different Data Sources. Data Layer depends on Domain Layer.

**Notes:** Mapping between response models and transformed models will happen via extension
functions defined in transformed model file
**Notes:** Mapping between response models and transformed models will happen via extension functions defined in transformed model file

### When writing a new ui module
# Hybrid Architecture ( XML + Compose )

- First, Create a new android library module
- Make sure to copy build.gradle.kts from other ui module and paste it in your ui-module
- We need one fragment to host the composables, this fragment will be added to main nav graph.
- the routing within compose world is handled with Compose Navigator
- and to move out of one ui module you need to use the fragment navigator!
Praxis now supports old XML and new Compose as well.

### Conventions:
<img src = "art/hybrid_arch.jpeg" />

### Conventions:
Files are suffixed with be defined Class types.

- ViewModels are suffixed with **VM**. Ex: `LoginVM`
- UseCases are suffixed with **UseCase**. Ex: `LoginUseCase`
- Sources are suffixed with **Source**. Ex: `LoginRemoteSource`, `LoginLocalSource`
- Repositories are suffixed with **Repo**. Ex: `LoginRepo`

## Conclusion

This project can be used as a template for new apps. This project is continually evolving to
integrate other libraries and techniques to keep it up to date.
This project can be used as a template for new apps.
This project is continually evolving to integrate other libraries and techniques to keep it up to date.

0 comments on commit 13acefe

Please sign in to comment.