{"id":18026578,"url":"https://github.com/hadilq/cleanarchitecture","last_synced_at":"2025-03-27T01:31:19.455Z","repository":{"id":49251318,"uuid":"149859939","full_name":"hadilq/CleanArchitecture","owner":"hadilq","description":"A sample app for clean architecture.","archived":false,"fork":false,"pushed_at":"2021-06-26T04:39:51.000Z","size":4688,"stargazers_count":35,"open_issues_count":0,"forks_count":5,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-03-22T21:06:14.895Z","etag":null,"topics":["android","android-architecture","clean-architecture","mvvm","mvvm-android","mvvm-architecture"],"latest_commit_sha":null,"homepage":"","language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hadilq.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-09-22T08:41:34.000Z","updated_at":"2024-01-14T13:21:28.000Z","dependencies_parsed_at":"2022-09-21T19:51:39.993Z","dependency_job_id":null,"html_url":"https://github.com/hadilq/CleanArchitecture","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hadilq%2FCleanArchitecture","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hadilq%2FCleanArchitecture/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hadilq%2FCleanArchitecture/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hadilq%2FCleanArchitecture/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hadilq","download_url":"https://codeload.github.com/hadilq/CleanArchitecture/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245764662,"owners_count":20668456,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["android","android-architecture","clean-architecture","mvvm","mvvm-android","mvvm-architecture"],"created_at":"2024-10-30T08:07:23.606Z","updated_at":"2025-03-27T01:31:15.375Z","avatar_url":"https://github.com/hadilq.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Clean Architecture\n\nThis is a sample app to show best practices up to author's knowledge by trying to\nstay close to standard technologies for a highly scalable, maintainable, and testable\nAndroid app.\n\n## Technologies\n\n - Clean Architecture\n - Public/Impl modules to handle Dependency Inversion Principle on module level\n - Anvil to handle Inversion of Control\n - Compile time feature flags\n - Dagger to handle Dependency Injection\n - Single Activity for faster initialization of pages\n - AndroidX\n - MVVM\n - Kotlin Coroutines\n - KotlinX Serialization\n - Room database\n - JUnit 5\n - Mockk\n\n### Dependency Inversion Principle\n\nAll modules are depending on each other only by `:public` interfaces, except the `:app`\nwhere is the only user of `:impl` modules. Also by keeping the `:app` as light as possible,\nrebuilding time of any `:impl` module will be short.\n\n### Dagger\n\nDefined scopes in Dagger\n - AppScope\n - SingleActivityScope\n - FragmentScope\n - RetainScope\n\n### Modules\nHere we have one root module, which is the `:app`, and one feature module `:guidomia` that\nis following clean architecture practices.\nOther modules considered as library modules.\n\n - core\n - database\n - single-activity\n - di\n - feature-flags\n\nFor your convenient you may want to put them in separated directories, such as `features`, `libraries`, etc.\n\n### Feature Flags\nThe idea is to switch on/off modules in compile time. We call this concept compile time feature\nflags, because they use the same logic of runtime feature flags, the concept that we had before.\nHere we have switches for `:database` and `:guidomia` modules, one library module and one feature\nmodule. In this project, where you can find part of its dependency tree here\n\n![dependency tree](https://raw.githubusercontent.com/hadilq/CleanArchitecture/main/doc-image/dip-module-dependencies-switch.png)\n\nthe feature flag logic to handle switch off of `:database:impl` is in the `:guidomia:impl`, and\nfeature flag logic to handle switch off of `:guimomia:impl` is in `:single-activity:impl`.\nTo switch them on and off, we developed this sample to use \"scenario\" concept. You can put\n`scenario` variable like\n\n```properties\nscenario=\u003eguidomia\u003edatabase\n```\n\nin `local.properties` file. It will enable `guidomia` and `database` modules, and it's the default\n`scenario`, when the developer didn't provide any `scenario` variable in the `local.properties`.\nFor this project there are two different `scenario`s that developer can use to decrease the\noverall build time of the project. They are as following.\n\n```properties\nscenario=\u003eguidomia\n```\n\nor\n\n```properties\nscenario=\u003e\n```\n\nThe last one is the root scenario that switch off all plugable modules in this project. Plugable\nmodules are the one that has a switch.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhadilq%2Fcleanarchitecture","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhadilq%2Fcleanarchitecture","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhadilq%2Fcleanarchitecture/lists"}