Skip to content

Feat/102 implement authentication and onboarding logic#103

Merged
MarcelMilka merged 11 commits into
masterfrom
feat/102-implement-authentication-and-onboarding-logic
Apr 4, 2026
Merged

Feat/102 implement authentication and onboarding logic#103
MarcelMilka merged 11 commits into
masterfrom
feat/102-implement-authentication-and-onboarding-logic

Conversation

@MarcelMilka
Copy link
Copy Markdown
Owner

No description provided.

- Create a new Android library module `auth` with namespace `eu.project.auth`.
- Configure `build.gradle.kts` with `compileSdk` 36, `minSdk` 26, and Java 11 compatibility.
- Add dependencies for Hilt (using KSP), AppCompat, Material, and the internal `:common` module.
- Register the `:auth` module in `settings.gradle.kts`.
- Add standard ProGuard and gitignore configurations for the new module.
- Add `AuthnManager` and `AuthnManagerImpl` to handle Google authentication and session management via Supabase.
- Implement `GoogleCredentialManager` using Android's `CredentialManager` to retrieve Google ID tokens.
- Add `NonceGenerator` to create raw and SHA-256 hashed nonces for secure authentication.
- Configure `SupabaseClient` with authentication support using GoTrue/Auth.
- Add required dependencies for Ktor, Supabase BOM, AndroidX Credentials, and Google ID to `libs.versions.toml` and `auth/build.gradle.kts`.
- Enable `buildConfig` and define `GOOGLE_WEB_CLIENT_ID`, `SUPABASE_DATABASE_URL`, and `SUPABASE_PUBLISHABLE_KEY` fields in the `auth` module.
- Define data classes for `RawNonce`, `HashedNonce`, `NonceSet`, `GoogleIdToken`, and `AccessToken`.
- Create `User` data class with `id` (UUID) and `email` fields.
- Add `getUser()` method to the `AuthnManager` interface to retrieve the current session user.
- Implement `getUser()` in `AuthnManagerImpl` by mapping Supabase current user data to the `User` model.
- Add UUID parsing and validation logic when retrieving the user ID from the authentication client.
- Create `ApplicationViewModel` to handle session restoration and determine the initial navigation route using `AuthnManager`.
- Introduce `ApplicationStartupState` sealed class to represent `Pending` and `Ready` states.
- Update `MainActivity` to keep the splash screen visible until the startup state is `Ready`.
- Modify `ApplicationScaffold` to accept a `startRoute` and configure navigation graphs for `Authenticated`, `Unauthenticated`, and `InitializationError` destinations.
- Expand `Navigation` sealed class with nested `Authenticated` and `Unauthenticated` route structures.
- Add unit tests for `ApplicationViewModel` covering signed-in, signed-out, and initialization error scenarios.
- Create a new Android library module `feature:authenticate` with namespace `eu.project.authenticate`.
- Configure `build.gradle.kts` with `compileSdk` 36, `minSdk` 26, Java 11 compatibility, and Compose support.
- Add dependencies for Hilt (via KSP), Jetpack Compose, Navigation, and Kotlin Serialization.
- Include internal project dependencies for `:ui`, `:common`, and `:auth`.
- Register the `:feature:authenticate` module in `settings.gradle.kts`.
- Add standard ProGuard and gitignore configurations for the new module.
- Create `SignInWithGoogleResult` sealed interface to represent Success, Canceled, and Unknown failure states.
- Update `AuthnManager` interface and `AuthnManagerImpl` to handle the Google Sign-In flow internally using `GoogleCredentialManager` and `NonceGenerator`.
- Refactor `signInWithGoogle` to no longer require external parameters, returning a `SignInWithGoogleResult` instead.
- Update `AuthModule` to inject `GoogleCredentialManager` into `AuthnManagerImpl`.
- Add `ContentHolder` component to provide a consistent background and fullscreen container for screen content.
- Add `SplitContent` component to divide the screen into two equal vertically weighted sections with customizable arrangements.
- Add `LoadingContent` component utilizing `SplitContent` to display a loading indicator and supporting text.
- Integrate testing tags and theme styling across all new components.
- Implement `WelcomeScreenViewModel` using Hilt, managing state via `MutableStateFlow` and handling the `ClickContinueWithGoogle` intent.
- Integrate `AuthnManager` for Google Sign-In and `CrashlyticsManager` for error reporting within the ViewModel.
- Add comprehensive unit tests for `WelcomeScreenViewModel` using MockK, Turbine, and `kotlinx-coroutines-test`.
- Update `feature/authenticate/build.gradle.kts` with testing dependencies for MockK, Turbine, and Coroutines.
- Implement `WelcomeScreenViewModel` using Hilt, managing state via `MutableStateFlow` and handling the `ClickContinueWithGoogle` intent.
- Integrate `AuthnManager` for Google Sign-In and `CrashlyticsManager` for error reporting within the ViewModel.
- Add comprehensive unit tests for `WelcomeScreenViewModel` using MockK, Turbine, and `kotlinx-coroutines-test`.
- Update `feature/authenticate/build.gradle.kts` with testing dependencies for MockK, Turbine, and Coroutines.
- Move `HomeScreen` from the root `Navigation` object to `Navigation.Authenticated`.
- Update the `scaffold` module to include the `:feature:authenticate` dependency.
- Replace placeholder navigation blocks in `ApplicationScaffold.kt` with `welcomeImpl` and `homeImpl` extensions.
- Rename `welcomeScreenImpl` to `welcomeImpl` and update its corresponding file name.
- Update `popUpTo` references in `SavedWordsImpl.kt` and `ExportWordsImpl.kt` to point to the new `Navigation.Authenticated.HomeScreen` route.
- Remove unused imports and redundant composable declarations in `ApplicationScaffold.kt`.
- Replace `UnconfinedTestDispatcher` with `StandardTestDispatcher` as the default dispatcher in `MainDispatcherRule`.
- Update imports in `WelcomeScreenViewModelTest.kt` to reflect the change.
@MarcelMilka MarcelMilka merged commit 19c4aed into master Apr 4, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant