{"id":19710473,"url":"https://github.com/rootstrap/android-base-compose","last_synced_at":"2025-04-29T17:31:17.676Z","repository":{"id":228438447,"uuid":"618116994","full_name":"rootstrap/android-base-compose","owner":"rootstrap","description":null,"archived":false,"fork":false,"pushed_at":"2024-10-30T15:04:37.000Z","size":393,"stargazers_count":9,"open_issues_count":15,"forks_count":3,"subscribers_count":12,"default_branch":"main","last_synced_at":"2025-04-05T18:50:36.967Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/rootstrap.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-03-23T19:38:22.000Z","updated_at":"2025-03-29T16:34:19.000Z","dependencies_parsed_at":"2024-03-18T21:12:19.573Z","dependency_job_id":"f976e487-b974-4a1b-903d-ed96baeb5aec","html_url":"https://github.com/rootstrap/android-base-compose","commit_stats":null,"previous_names":["rootstrap/android-base-compose"],"tags_count":0,"template":true,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rootstrap%2Fandroid-base-compose","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rootstrap%2Fandroid-base-compose/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rootstrap%2Fandroid-base-compose/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rootstrap%2Fandroid-base-compose/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rootstrap","download_url":"https://codeload.github.com/rootstrap/android-base-compose/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251549192,"owners_count":21607367,"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":[],"created_at":"2024-11-11T22:07:29.232Z","updated_at":"2025-04-29T17:31:16.002Z","avatar_url":"https://github.com/rootstrap.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"# android-base-compose\n\nAndroid Compose Base is a boilerplate project created by Rootstrap for new projects using Kotlin and Jetpack Compose. \nThe main objective is helping any new projects jump-start into feature development by providing a solid foundation.\n\n## How to use this template\nYou can use this open-source project as a template of your new Android projects. Steps:\n\n1. **Clone**: Clone the repository to your local machine.\n\n2. **Build with Android Studio**: Open the project in Android Studio and build it.\n\nUse Example module as an example of how to setup your project (see the login/sign up examples).\n\n## Tech Stack\n\n- Minimum SDK level 24\n- [Jetpack Compose](https://developer.android.com/jetpack/compose) for UI\n- [Navigation Compose](https://developer.android.com/jetpack/compose/navigation) for in-app navigation\n- [ViewModel](https://developer.android.com/topic/libraries/architecture/viewmodel) from Architecture Components\n- [Retrofit](https://square.github.io/retrofit/) for network requests\n- [Coil](https://coil-kt.github.io/coil/) for image loading\n- [Koin](https://insert-koin.io/) for dependency injection\n\n## Architecture\n\nThe app uses MVVM architecture and Clean Architecture principles with a separation of concerns between:\n\n- **Presentation Layer**: ViewModels and Compose UI. ViewModels retrieve data from use-cases and expose it to Compose UI.\n- **Domain Layer**: Models\n- **Use-cases**: Business logic\n- **Data Layer**: Repositories, network, local data sources\n\n## Error handling \nWe use the `ErrorHandler` class that extends `AbstractCoroutineContextElement` and implements `CoroutineExceptionHandler` to handle errors in coroutines.\nTo listen to those errors we use the `ErrorNotifier` singleton that exposes a flow of errors. Usually you will only need to listen to it in your app's main activity. In this template it is being listened in the `AppActivity` class\n\n## Lint\n\nTo check lint issues, use `ktlintCheck` and `ktlintFormat`.\n\n## State management\n\nUI package contains a base ViewModel, `BaseViewModel`, designed for use in Android applications developed in Kotlin.\nIt extends `ViewModel` and is designed to be used with Jetpack Compose UI components.\nThis base ViewModel facilitates state and navigation event management within Android UI components.\n\n- **State Management**: Utilizes `MutableStateFlow` for managing UI state, providing a thread-safe way to observe and update the UI state reactively.\n- **Navigation Events**: Uses a `Channel` to handle one-time navigation events, ensuring that events are handled once and state management is decoupled from event handling.\n- Ensure your UI state classes implement the UiState interface provided in this package for type safety.\n\n## Navigation and Deep Links\n\n- Add nav config and deep link example with a guide for it.\n  [Issue](https://github.com/rootstrap/android-base-compose/issues/9)\n\n**Note**: To add deep links:\nAdd the `.well-known/assetlinks.json` file to your server to register the app\nCheck the documentation: [Docs](https://developer.android.com/training/app-links/verify-android-applinks)\n\nTo test deep link locally call with adb:\n```\n adb shell am start -a android.intent.action.VIEW \\\n                -c android.intent.category.BROWSABLE \\\n                -d \"http://awesomewebpage.com\"\n```\n\nNote: Once you upload the app to Google Play Store you will find the .well-known/assetlinks.json file config in the signature menu\n\nTo verify the assetlinks.json was registered with the app use:\n```\n- adb shell pm verify-app-links --re-verify PACKAGE_NAME'\n- adb shell pm get-app-links PACKAGE_NAME\n```\nWhen verified, you should see the following output:\n```\n            com.rs.androidcomposebase\n                ID: 01234567-89ab-cdef-0123-456789abcdef\n                Signatures: [***]\n                Domain verification state:\n                    awesomewebpage.com: verified\n```\n\nNavigation:\nExample of nav with arguments:\n```\n        composable(\n             route = NavRoutes.BusinessDetails.route,\n             arguments = listOf(navArgument(\"id\") { type = NavType.StringType })\n         ) { backStackEntry -\u003e\n             backStackEntry.arguments?.getString(\"id\")?.run {\n              BusinessDetailPage(this)\n \t\t\t   } ?: run {\n \t\t\t\t ErrorPage(message = \"404\")\n \t\t\t   }\n         }\n```\n\nExample of calling a route with arguments:\n ```\n        AppData.mainNavController.navigate(\n             NavRoutes.BusinessDetailPage.withArg(\n                 business.id\n             )\n         )\n```\n\nTo set deep links:\n```\n       composable(\n            route = NavRoutes.BusinessDetailPage.route,\n            arguments = listOf(navArgument(\"id\") { type = NavType.StringType }),\n            // URI is your page deeplink in this case \"awesomewebpage.com\",\n \t    // get your uri from your desired configuration: const var, env, gradle, etc..\n            deepLinks = listOf(navDeepLink { uriPattern = \"https://awesomewebpage.com/business/{id}\"}),\n         ) { backStackEntry -\u003e\n              backStackEntry.arguments?.getString(\"id\")?.run {\n                  BusinessDetailPage(this)\n              } ?: run {\n                  ErrorPage(message = \"404\")\n              }\n         }\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frootstrap%2Fandroid-base-compose","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frootstrap%2Fandroid-base-compose","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frootstrap%2Fandroid-base-compose/lists"}