Flamebase is a Kotlin-first library that provides a thin and powerful wrapper for the Firebase SDK on Android. Designed to hide Data layer complexity, it leverages Coroutines/Flow and adheres to Clean Architecture principles.
Add it in your settings.gradle.kts at the end of repositories:
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
google()
mavenCentral()
maven { url = uri("https://jitpack.io") }
}
}Add the library to your app module's build.gradle.kts:
dependencies {
// Flamebase Core & Auth Modules (Current Version: 1.0.0)
implementation("com.github.NhuHuy-79.FlameBase:core:1.0.0")
implementation("com.github.NhuHuy-79.FlameBase:auth:1.0.0")
// Firebase BoM is required as Flamebase operates as a thin wrapper
implementation(platform("com.google.firebase:firebase-bom:33.1.2"))
}viewModelScope.launch {
FlameAuth.signIn(email, password)
.onSuccess { user ->
// 'user' is FlameAuth.User class, not FirebaseUser
println("Welcome ${user.displayName}")
}
.onError { error ->
// Error handling mapped to FlameAuthError
}
}FlameAuth.authenticatedFlow
.collect { state ->
when (state) {
is AuthenticatedState.Authenticated -> // Navigate to Home
is AuthenticatedState.Unauthenticated -> // Navigate to Login
}
}- Domain-Driven: Firebase SDK classes are hidden behind domain models.
- Coroutines First: No more callbacks, just
suspendandFlow. - Fail-safe: Centralized error handling via
FlameResult.
Licensed under the Apache License, Version 2.0. See LICENSE for more information.