{"id":26915927,"url":"https://github.com/composablehorizons/jetpack-compose-app-template","last_synced_at":"2025-10-05T18:28:55.847Z","repository":{"id":194742166,"uuid":"691381779","full_name":"composablehorizons/jetpack-compose-app-template","owner":"composablehorizons","description":"A pragmatic Jetpack Compose app template to build lean apps with. It contains everything you need to get you up and running build Android apps using Jetpack Compose.","archived":false,"fork":false,"pushed_at":"2023-09-14T09:16:11.000Z","size":633,"stargazers_count":74,"open_issues_count":0,"forks_count":5,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-01T18:52:24.936Z","etag":null,"topics":["apptemplate","jetpack-android","jetpack-compose","template"],"latest_commit_sha":null,"homepage":"https://www.composables.com/","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/composablehorizons.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}},"created_at":"2023-09-14T04:19:32.000Z","updated_at":"2024-12-15T15:30:13.000Z","dependencies_parsed_at":"2023-09-14T23:54:31.541Z","dependency_job_id":"c9a218af-a051-4e2c-a436-91749affce29","html_url":"https://github.com/composablehorizons/jetpack-compose-app-template","commit_stats":null,"previous_names":["composables-co/jetpack-compose-app-template","composablehorizons/jetpack-compose-app-template"],"tags_count":0,"template":true,"template_full_name":null,"purl":"pkg:github/composablehorizons/jetpack-compose-app-template","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/composablehorizons%2Fjetpack-compose-app-template","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/composablehorizons%2Fjetpack-compose-app-template/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/composablehorizons%2Fjetpack-compose-app-template/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/composablehorizons%2Fjetpack-compose-app-template/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/composablehorizons","download_url":"https://codeload.github.com/composablehorizons/jetpack-compose-app-template/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/composablehorizons%2Fjetpack-compose-app-template/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260546197,"owners_count":23025894,"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":["apptemplate","jetpack-android","jetpack-compose","template"],"created_at":"2025-04-01T18:40:16.760Z","updated_at":"2025-10-05T18:28:50.814Z","avatar_url":"https://github.com/composablehorizons.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Jetpack Compose App Template\n\nA pragmatic Jetpack Compose app template to build lean apps with. It contains everything you need to get you up and running build Android apps using Jetpack Compose.\n\nThis template is not meant for educational purposes with best practices in mind. Instead it is meant to be a pragmatic template that you can use to build your apps with.\n\n## Overview\n\n### Dependency Injection\n\nThere is no dependency injection framework used. Instead you will need to create your dependencies manually. Do not worry it is much simpler and faster than you think.\n\nHow to inject a ViewModel:\n\nCreate your factory function (see `DependencyInjection.kt`):\n\n```kotlin\nfun homeScreenViewModel(): HomeScreenViewModel {\n    return HomeScreenViewModel(photosRepository())\n}\n```\n\nuse it in your screen level `@Composable` like this:\n\n```kotlin\nval homeViewModel = viewModel { homeScreenViewModel() }\n```\n\n### View Models\n\nThe template comes with an opinionated subclass of AndroidX' ViewModel called `AbstractViewModel`.\n\nIt setups the boilerplate you need to handle states, events and user actions in a strongly typed fashion. See `HomeScreenViewModel.kt`\n\nHere is the signature:\n```kotlin\nabstract class AbstractViewModel\u003cState : Any, Event : Any, UserAction : Any\u003e(\n    startWith: State,\n)\n```\n\nyou can use it like this:\n\n```kotlin\nclass HomeScreenViewModel(\n    private val photosRepository: PhotosRepository,\n) : AbstractViewModel\u003cHomeScreenState, Nothing, Unit\u003e(\n    startWith = HomeScreenState.Loading\n)\n```\n\nto bootstrap your `ViewModel` and start emitting states. See the `PhotoDetailsViewModel.kt` for a more complex example. \n\n### Navigation\n\nThe template uses [`Compose Destinations`](https://github.com/raamcosta/compose-destinations/) to navigate across screens.\n\nThis specific library is used as it provides a simple and type-safe way to navigate across screens, and saves you so much time from writing boilerplate code.\n\nSee the original repo for more information.\n\n### Permissions\n\nPermissions are handled for you automatically. Instead of poluting your app with permissions checks, the template guards the app's content with a permission check:\n```kotlin\nAppTheme {\n    PermissionRequired(\n        onDenyClick = { finish() },\n        guardedContent = { /* Your app's content here */ }\n    )\n}\n```\n\nSee `Permissions.kt` for more info.\n\n#### Optional permissions\n\nThe template comes with an optional permissions launcher that you can use for permissions that should not block the user experience.\n\nSee `OptionalPermission.kt`\n\n## Bring your Jetpack Compose apps to life ultra-fast\n\nWith professionally crafted components, screens and tools at [Composables.com](https://www.composables.com).","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcomposablehorizons%2Fjetpack-compose-app-template","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcomposablehorizons%2Fjetpack-compose-app-template","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcomposablehorizons%2Fjetpack-compose-app-template/lists"}