├── composeApp ├── mood.db ├── user.db ├── self_journal ├── sleep_quality.db ├── stress_level.db └── src │ ├── androidMain │ ├── res │ │ ├── values │ │ │ ├── strings.xml │ │ │ └── ic_launcher_background.xml │ │ ├── mipmap-hdpi │ │ │ ├── ic_launcher.webp │ │ │ └── ic_launcher_round.webp │ │ ├── mipmap-mdpi │ │ │ ├── ic_launcher.webp │ │ │ └── ic_launcher_round.webp │ │ ├── mipmap-xhdpi │ │ │ ├── ic_launcher.webp │ │ │ └── ic_launcher_round.webp │ │ ├── mipmap-xxhdpi │ │ │ ├── ic_launcher.webp │ │ │ └── ic_launcher_round.webp │ │ ├── mipmap-xxxhdpi │ │ │ ├── ic_launcher.webp │ │ │ └── ic_launcher_round.webp │ │ ├── values-pt-rBR │ │ │ └── strings.xml │ │ └── mipmap-anydpi-v26 │ │ │ ├── ic_launcher.xml │ │ │ └── ic_launcher_round.xml │ ├── ic_launcher-playstore.png │ └── kotlin │ │ └── com │ │ └── joohnq │ │ └── moodapp │ │ ├── AndroidApp.kt │ │ └── MainActivity.kt │ ├── commonMain │ └── kotlin │ │ └── com │ │ └── joohnq │ │ └── moodapp │ │ └── di │ │ └── KoinInitializer.kt │ └── jvmMain │ └── kotlin │ └── com │ └── joohnq │ └── moodapp │ └── Main.kt ├── assets └── principal.png ├── iosApp ├── Configuration │ └── Config.xcconfig ├── iosApp │ ├── Assets.xcassets │ │ ├── Contents.json │ │ ├── AppIcon.appiconset │ │ │ ├── Group 6.png │ │ │ └── Contents.json │ │ └── AccentColor.colorset │ │ │ └── Contents.json │ ├── Preview Content │ │ └── Preview Assets.xcassets │ │ │ └── Contents.json │ ├── iOSApp.swift │ └── ContentView.swift └── iosApp.xcodeproj │ └── project.xcworkspace │ └── contents.xcworkspacedata ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── core ├── domain │ ├── src │ │ └── commonMain │ │ │ └── kotlin │ │ │ └── com │ │ │ └── joohnq │ │ │ └── api │ │ │ ├── entity │ │ │ ├── Year.kt │ │ │ ├── Minutes.kt │ │ │ ├── Time.kt │ │ │ ├── CurvedCanvasPosition.kt │ │ │ ├── Quad.kt │ │ │ └── DaySection.kt │ │ │ ├── mapper │ │ │ ├── IntMapper.kt │ │ │ ├── MinutesMapper.kt │ │ │ ├── ListMapper.kt │ │ │ ├── YearMapper.kt │ │ │ ├── FloatMapper.kt │ │ │ ├── StringMapper.kt │ │ │ └── DoubleMapper.kt │ │ │ ├── FilterBy.kt │ │ │ └── GetNow.kt │ └── build.gradle.kts ├── storage │ ├── api │ │ ├── build.gradle.kts │ │ └── src │ │ │ └── commonMain │ │ │ └── kotlin │ │ │ └── com │ │ │ └── joohnq │ │ │ └── storage │ │ │ └── api │ │ │ └── FileStorage.kt │ └── impl │ │ ├── src │ │ ├── commonMain │ │ │ └── kotlin │ │ │ │ └── com │ │ │ │ └── joohnq │ │ │ │ └── storage │ │ │ │ └── impl │ │ │ │ ├── di │ │ │ │ └── CoreStorageModule.kt │ │ │ │ └── FileStorageImpl.kt │ │ ├── jvmMain │ │ │ └── kotlin │ │ │ │ └── com │ │ │ │ └── joohnq │ │ │ │ └── storage │ │ │ │ └── impl │ │ │ │ └── di │ │ │ │ └── CoreStorageModule.jvm.kt │ │ ├── nativeMain │ │ │ └── kotlin │ │ │ │ └── com │ │ │ │ └── joohnq │ │ │ │ └── storage │ │ │ │ └── impl │ │ │ │ └── di │ │ │ │ └── CoreStorageModule.native.kt │ │ └── androidMain │ │ │ └── kotlin │ │ │ └── com │ │ │ └── joohnq │ │ │ └── storage │ │ │ └── impl │ │ │ └── di │ │ │ └── CoreStorageModule.android.kt │ │ └── build.gradle.kts ├── ui │ ├── src │ │ ├── commonMain │ │ │ └── kotlin │ │ │ │ └── com │ │ │ │ └── joohnq │ │ │ │ └── ui │ │ │ │ ├── entity │ │ │ │ ├── ImageFormat.kt │ │ │ │ ├── StateDispatch.kt │ │ │ │ ├── BottomItem.kt │ │ │ │ ├── CentralAction.kt │ │ │ │ ├── CalendarInfo.kt │ │ │ │ ├── Assets.kt │ │ │ │ ├── TextRadioButtonColors.kt │ │ │ │ └── IconResource.kt │ │ │ │ ├── event │ │ │ │ └── PanelEvent.kt │ │ │ │ ├── mapper │ │ │ │ └── ImageBitmapMapper.kt │ │ │ │ ├── SharedViewModel.kt │ │ │ │ ├── UnidirectionalViewModelWithoutState.kt │ │ │ │ └── DisposableEffect.kt │ │ ├── jvmMain │ │ │ └── kotlin │ │ │ │ └── com │ │ │ │ └── joohnq │ │ │ │ └── ui │ │ │ │ ├── entity │ │ │ │ └── ImageFormat.kt │ │ │ │ └── mapper │ │ │ │ └── ImageBitmapMapper.native.kt │ │ ├── androidMain │ │ │ └── kotlin │ │ │ │ └── com │ │ │ │ └── joohnq │ │ │ │ └── ui │ │ │ │ ├── entity │ │ │ │ └── ImageFormat.android.kt │ │ │ │ └── mapper │ │ │ │ └── ImageBitmapMapper.android.kt │ │ └── nativeMain │ │ │ └── kotlin │ │ │ └── com │ │ │ └── joohnq │ │ │ └── ui │ │ │ ├── entity │ │ │ └── ImageFormat.kt │ │ │ └── mapper │ │ │ └── ImageBitmapMapper.native.kt │ └── build.gradle.kts ├── permission │ ├── src │ │ ├── commonMain │ │ │ └── kotlin │ │ │ │ └── com │ │ │ │ └── joohnq │ │ │ │ └── permission │ │ │ │ ├── PermissionType.kt │ │ │ │ ├── PermissionStatus.kt │ │ │ │ ├── PermissionCallback.kt │ │ │ │ ├── SharedImage.kt │ │ │ │ ├── CameraManager.kt │ │ │ │ ├── GalleryManager.kt │ │ │ │ ├── PermissionsManager.kt │ │ │ │ └── PermissionHandler.kt │ │ ├── androidMain │ │ │ └── res │ │ │ │ └── xml │ │ │ │ └── provider_paths.xml │ │ └── jvmMain │ │ │ └── kotlin │ │ │ └── com │ │ │ └── joohnq │ │ │ └── permission │ │ │ ├── CameraManager.jvm.kt │ │ │ └── GalleryManager.jvm.kt │ └── build.gradle.kts ├── datastore │ ├── src │ │ ├── commonMain │ │ │ └── kotlin │ │ │ │ └── com │ │ │ │ └── joohnq │ │ │ │ └── datastore │ │ │ │ ├── di │ │ │ │ └── DataStoreModule.kt │ │ │ │ ├── PreferencesDataStore.kt │ │ │ │ └── CreateDataStore.kt │ │ ├── jvmMain │ │ │ └── kotlin │ │ │ │ └── com │ │ │ │ └── joohnq │ │ │ │ └── datastore │ │ │ │ ├── di │ │ │ │ └── DataStoreModule.jvm.kt │ │ │ │ └── PreferencesDataStore.jvm.kt │ │ ├── androidMain │ │ │ └── kotlin │ │ │ │ └── com │ │ │ │ └── joohnq │ │ │ │ └── datastore │ │ │ │ ├── di │ │ │ │ └── DataStoreModule.android.kt │ │ │ │ └── PreferencesDataStore.android.kt │ │ └── nativeMain │ │ │ └── kotlin │ │ │ └── com │ │ │ └── joohnq │ │ │ └── datastore │ │ │ └── di │ │ │ └── DataStoreModule.native.kt │ └── build.gradle.kts ├── database │ └── src │ │ ├── commonMain │ │ └── kotlin │ │ │ └── com │ │ │ └── joohnq │ │ │ └── database │ │ │ ├── di │ │ │ ├── AppDatabaseModule.kt │ │ │ └── AppDatabaseDriverFactoryModule.kt │ │ │ ├── Database.kt │ │ │ ├── driver │ │ │ └── AppDatabaseDriverFactory.kt │ │ │ ├── mapper │ │ │ ├── LocalDateMapper.kt │ │ │ └── LocalDateTimeMapper.kt │ │ │ └── LocalDateTimeConverter.kt │ │ ├── jvmMain │ │ └── kotlin │ │ │ └── com │ │ │ └── joohnq │ │ │ └── database │ │ │ ├── di │ │ │ ├── AppDatabaseModule.jvm.kt │ │ │ └── AppDatabaseDriverFactoryModule.jvm.kt │ │ │ ├── SqliteException.jvm.kt │ │ │ ├── AppDatabase.kt │ │ │ └── driver │ │ │ └── AppDatabaseDriverFactory.jvm.kt │ │ ├── nativeMain │ │ └── kotlin │ │ │ └── com │ │ │ └── joohnq │ │ │ └── database │ │ │ └── di │ │ │ ├── AppDatabaseModule.native.kt │ │ │ └── AppDatabaseDriverFactoryModule.native.kt │ │ └── androidMain │ │ └── kotlin │ │ └── com │ │ └── joohnq │ │ └── database │ │ ├── di │ │ ├── AppDatabaseDriverFactoryModule.android.kt │ │ └── AppDatabaseModule.android.kt │ │ └── AppDatabase.kt └── navigation │ ├── build.gradle.kts │ └── src │ └── commonMain │ └── kotlin │ └── com │ └── joohnq │ └── navigation │ └── NavigationGraph.kt ├── shared-resources └── src │ ├── commonMain │ ├── kotlin │ │ └── com │ │ │ └── joohnq │ │ │ └── shared_resources │ │ │ ├── theme │ │ │ └── Shadow.kt │ │ │ ├── remember │ │ │ ├── RememberPainter.kt │ │ │ ├── RememberGetNow.kt │ │ │ ├── RememberSnackBarHostState.kt │ │ │ ├── RememberAvatars.kt │ │ │ └── RememberFocusRequester.kt │ │ │ ├── ResourceFiles.kt │ │ │ └── components │ │ │ ├── modifier │ │ │ ├── TakeIf.kt │ │ │ └── DpOffset.kt │ │ │ ├── spacer │ │ │ ├── HorizontalSpacer.kt │ │ │ └── VerticalSpacer.kt │ │ │ └── IconResource.kt │ └── composeResources │ │ ├── font │ │ ├── urbanist_black.ttf │ │ ├── urbanist_bold.ttf │ │ ├── urbanist_light.ttf │ │ ├── urbanist_thin.ttf │ │ ├── urbanist_medium.ttf │ │ ├── urbanist_regular.ttf │ │ ├── urbanist_extra_bold.ttf │ │ ├── urbanist_semi_bold.ttf │ │ └── urbanist_extra_light.ttf │ │ └── drawable │ │ ├── ic_add_outlined.xml │ │ ├── ic_flag_outlined.xml │ │ ├── ic_arrow_open_outlined.xml │ │ ├── ic_close_outlined.xml │ │ ├── ic_nothing_outlined.xml │ │ ├── ic_heart_outlined.xml │ │ ├── ic_clock.xml │ │ ├── ic_target.xml │ │ ├── ic_check_outlined.xml │ │ ├── ic_circle_outlined.xml │ │ └── ic_warning.xml │ ├── androidDebug │ └── kotlin │ │ └── com │ │ └── joohnq │ │ └── shared_resources │ │ ├── components │ │ ├── AppSnackBarPreview.kt │ │ ├── view │ │ │ ├── EmptyViewPreview.kt │ │ │ ├── LoadingViewPreview.kt │ │ │ └── ErrorViewPreview.kt │ │ ├── LogoWithBackgroundPreview.kt │ │ ├── button │ │ │ ├── DeleteButtonPreview.kt │ │ │ ├── SmallAddButtonPreview.kt │ │ │ ├── AppDarkBackButtonPreview.kt │ │ │ ├── AppLightBackButtonPreview.kt │ │ │ ├── PrimaryButtonPreview.kt │ │ │ ├── SecondaryButtonPreview.kt │ │ │ ├── TextAndCheckButtonPreview.kt │ │ │ └── BottomNavigationButtonPreview.kt │ │ ├── parameter │ │ │ ├── BooleanParameterProvider.kt │ │ │ └── ShapeParameterProvider.kt │ │ ├── input_field │ │ │ ├── ExpressionAnalysisTextFieldPreview.kt │ │ │ └── PinInputFieldPreview.kt │ │ ├── text │ │ │ ├── TitlePreview.kt │ │ │ ├── MediumTitlePreview.kt │ │ │ ├── SectionHeaderPreview.kt │ │ │ ├── TextEllipsisPreview.kt │ │ │ ├── HeadingWithSpanPreview.kt │ │ │ └── BubbleTextPreview.kt │ │ ├── dialog │ │ │ └── AppTimePickerDialogPreview.kt │ │ ├── image │ │ │ └── ProfileImagePreview.kt │ │ ├── time_picker │ │ │ └── AppTimePickerPreview.kt │ │ └── chart │ │ │ └── LineChartPreview.kt │ │ └── icons │ │ ├── MoodSadPreview.kt │ │ ├── MoodHappyPreview.kt │ │ ├── MoodNeutralPreview.kt │ │ ├── MoodDepressedPreview.kt │ │ ├── MoodOverjoyedPreview.kt │ │ └── RouletteTargetPreview.kt │ ├── androidMain │ └── kotlin │ │ └── com │ │ └── joohnq │ │ └── shared_resources │ │ └── remember │ │ └── RememberPainter.android.kt │ ├── jvmMain │ └── kotlin │ │ └── com │ │ └── joohnq │ │ └── shared_resources │ │ └── remember │ │ └── RememberPainter.jvm.kt │ └── nativeMain │ └── kotlin │ └── com │ └── joohnq │ └── shared_resources │ └── remember │ └── RememberPainter.native.kt ├── feature ├── user │ ├── api │ │ ├── src │ │ │ └── commonMain │ │ │ │ └── kotlin │ │ │ │ └── com │ │ │ │ └── joohnq │ │ │ │ └── api │ │ │ │ ├── entity │ │ │ │ ├── ImageType.kt │ │ │ │ ├── DPhysicalSymptomsProperties.kt │ │ │ │ ├── DMedicationsSupplementsProperties.kt │ │ │ │ ├── DProfessionalHelpProperties.kt │ │ │ │ ├── ProfessionalHelp.kt │ │ │ │ ├── User.kt │ │ │ │ └── PhysicalSymptoms.kt │ │ │ │ ├── property │ │ │ │ ├── PhysicalSymptomsProperties.kt │ │ │ │ ├── MedicationsSupplementsProperties.kt │ │ │ │ └── ProfessionalHelpProperties.kt │ │ │ │ ├── constant │ │ │ │ └── UserFileStorageConstants.kt │ │ │ │ ├── mapper │ │ │ │ ├── ImageTypeMapper.kt │ │ │ │ └── ProfessionalHelpMapper.kt │ │ │ │ ├── exception │ │ │ │ └── UserNameException.kt │ │ │ │ ├── validator │ │ │ │ └── UserNameValidator.kt │ │ │ │ └── use_case │ │ │ │ ├── GetUserUseCase.kt │ │ │ │ ├── UpdateUserNameUseCase.kt │ │ │ │ ├── AddUserUseCase.kt │ │ │ │ ├── UpdateUserUseCase.kt │ │ │ │ ├── UpdateSoughtHelpUseCase.kt │ │ │ │ ├── UpdatePhysicalSymptomsUseCase.kt │ │ │ │ ├── UpdateMedicationsSupplementsUseCase.kt │ │ │ │ └── UpdateUserImageDrawableUseCase.kt │ │ └── build.gradle.kts │ └── impl │ │ └── src │ │ ├── commonMain │ │ ├── kotlin │ │ │ └── com │ │ │ │ └── joohnq │ │ │ │ └── user │ │ │ │ └── impl │ │ │ │ ├── di │ │ │ │ └── UserDriverFactoryModule.kt │ │ │ │ └── data │ │ │ │ ├── driver │ │ │ │ └── UserDriverFactory.kt │ │ │ │ └── database │ │ │ │ └── UserDatabase.kt │ │ └── sqldelight │ │ │ └── com │ │ │ └── joohnq │ │ │ └── user │ │ │ └── database │ │ │ └── User.sq │ │ ├── jvmMain │ │ └── kotlin │ │ │ └── com │ │ │ └── joohnq │ │ │ └── user │ │ │ └── impl │ │ │ ├── di │ │ │ └── UserDriverFactoryModule.jvm.kt │ │ │ └── data │ │ │ └── driver │ │ │ └── UserDriverFactory.jvm.kt │ │ ├── androidMain │ │ └── kotlin │ │ │ └── com │ │ │ └── joohnq │ │ │ └── user │ │ │ └── impl │ │ │ └── di │ │ │ └── UserDriverFactoryModule.android.kt │ │ ├── nativeMain │ │ └── kotlin │ │ │ └── com │ │ │ └── joohnq │ │ │ └── user │ │ │ └── impl │ │ │ └── di │ │ │ └── UserDriverFactoryModule.native.kt │ │ └── androidDebug │ │ └── kotlin │ │ └── com │ │ └── joohnq │ │ └── user │ │ └── impl │ │ └── ui │ │ └── parameter │ │ ├── ProfessionalHelpResourceParameterProvider.kt │ │ └── PhysicalSymptomsResourceParameterProvider.kt ├── welcome │ ├── api │ │ ├── build.gradle.kts │ │ └── src │ │ │ └── commonMain │ │ │ └── kotlin │ │ │ └── com │ │ │ └── joohnq │ │ │ └── welcome │ │ │ └── api │ │ │ └── entity │ │ │ └── Welcome.kt │ └── impl │ │ └── src │ │ ├── commonMain │ │ └── kotlin │ │ │ └── com │ │ │ └── joohnq │ │ │ └── welcome │ │ │ └── impl │ │ │ ├── ui │ │ │ └── presentation │ │ │ │ └── first │ │ │ │ └── FirstScreen.kt │ │ │ └── di │ │ │ └── WelcomImplModule.kt │ │ └── androidDebug │ │ └── kotlin │ │ └── com │ │ └── joohnq │ │ └── welcome │ │ └── impl │ │ └── presentation │ │ ├── first │ │ └── FirstContentPreview.kt │ │ └── WelcomeParameterProvider.kt ├── security │ ├── api │ │ ├── src │ │ │ └── commonMain │ │ │ │ └── kotlin │ │ │ │ └── com │ │ │ │ └── joohnq │ │ │ │ └── security │ │ │ │ └── api │ │ │ │ ├── SecurityType.kt │ │ │ │ ├── SecurityAuthentication.kt │ │ │ │ ├── SecurityPreference.kt │ │ │ │ ├── di │ │ │ │ └── SecurityApiModule.kt │ │ │ │ ├── SecurityResult.kt │ │ │ │ ├── use_case │ │ │ │ ├── GetSecurityUseCase.kt │ │ │ │ └── UpdateSecurityUseCase.kt │ │ │ │ └── Security.kt │ │ └── build.gradle.kts │ └── impl │ │ └── src │ │ ├── commonMain │ │ └── kotlin │ │ │ └── com │ │ │ └── joohnq │ │ │ └── security │ │ │ └── impl │ │ │ ├── di │ │ │ └── SecurityAuthenticationModule.kt │ │ │ ├── ui │ │ │ ├── SecurityAuthentication.kt │ │ │ └── presentation │ │ │ │ └── security_confirmed │ │ │ │ └── SecurityConfirmedContract.kt │ │ │ └── data │ │ │ └── SecurityAuthenticationImpl.kt │ │ ├── jvmMain │ │ └── kotlin │ │ │ └── com │ │ │ └── joohnq │ │ │ └── security │ │ │ └── impl │ │ │ ├── ui │ │ │ └── SecurityAuthentication.jvm.kt │ │ │ ├── data │ │ │ └── SecurityAuthenticationImpl.jvm.kt │ │ │ └── di │ │ │ └── SecurityAuthenticationModule.jvm.kt │ │ ├── nativeMain │ │ └── kotlin │ │ │ └── com │ │ │ └── joohnq │ │ │ └── security │ │ │ └── impl │ │ │ ├── ui │ │ │ └── SecurityAuthentication.native.kt │ │ │ └── di │ │ │ └── SecurityAuthenticationModule.native.kt │ │ ├── androidDebug │ │ └── kotlin │ │ │ └── com │ │ │ └── joohnq │ │ │ └── security │ │ │ └── impl │ │ │ └── ui │ │ │ ├── presentation │ │ │ ├── security │ │ │ │ └── SecurityContentPreview.kt │ │ │ ├── security_confirmed │ │ │ │ └── SecurityConfirmedContentPreview.kt │ │ │ └── unlock │ │ │ │ └── UnLockContentPreview.kt │ │ │ └── components │ │ │ └── PinCodePreview.kt │ │ └── androidMain │ │ └── kotlin │ │ └── com │ │ └── joohnq │ │ └── security │ │ └── impl │ │ ├── ui │ │ └── SecurityAuthentication.android.kt │ │ └── di │ │ └── SecurityAuthenticationModule.android.kt ├── mood │ ├── api │ │ ├── src │ │ │ └── commonMain │ │ │ │ └── kotlin │ │ │ │ └── com │ │ │ │ └── joohnq │ │ │ │ └── mood │ │ │ │ └── api │ │ │ │ ├── property │ │ │ │ └── MoodProperties.kt │ │ │ │ ├── entity │ │ │ │ ├── DMoodProperties.kt │ │ │ │ ├── MoodAverage.kt │ │ │ │ ├── MoodRecord.kt │ │ │ │ └── MoodPalette.kt │ │ │ │ ├── repository │ │ │ │ └── MoodRepository.kt │ │ │ │ ├── use_case │ │ │ │ ├── GetMoodsUseCase.kt │ │ │ │ ├── DeleteMoodUseCase.kt │ │ │ │ └── AddMoodUseCase.kt │ │ │ │ ├── di │ │ │ │ └── MoodApiModule.kt │ │ │ │ └── mapper │ │ │ │ └── MoodAverageMapper.kt │ │ └── build.gradle.kts │ ├── impl │ │ └── src │ │ │ ├── commonMain │ │ │ ├── kotlin │ │ │ │ └── com │ │ │ │ │ └── joohnq │ │ │ │ │ └── mood │ │ │ │ │ └── add │ │ │ │ │ ├── di │ │ │ │ │ └── MoodDriverFactoryModule.kt │ │ │ │ │ ├── data │ │ │ │ │ ├── driver │ │ │ │ │ │ └── MoodDriverFactory.kt │ │ │ │ │ └── database │ │ │ │ │ │ └── MoodDatabase.kt │ │ │ │ │ └── ui │ │ │ │ │ └── mapper │ │ │ │ │ └── MoodAverageResourceMapper.kt │ │ │ └── sqldelight │ │ │ │ └── com │ │ │ │ └── joohnq │ │ │ │ └── mood │ │ │ │ └── database │ │ │ │ └── MoodRecord.sq │ │ │ ├── androidDebug │ │ │ └── kotlin │ │ │ │ └── com │ │ │ │ └── joohnq │ │ │ │ └── mood │ │ │ │ └── impl │ │ │ │ └── ui │ │ │ │ ├── components │ │ │ │ └── MoodRouletteWheelPreview.kt │ │ │ │ └── parameter │ │ │ │ ├── ListMoodRecordResourceParameterProvider.kt │ │ │ │ ├── MoodResourceParameterProvider.kt │ │ │ │ └── MoodAverageResourceParameterProvider.kt │ │ │ ├── jvmMain │ │ │ └── kotlin │ │ │ │ └── com │ │ │ │ └── joohnq │ │ │ │ └── mood │ │ │ │ └── add │ │ │ │ ├── di │ │ │ │ └── StatsDriverFactoryModule.native.kt │ │ │ │ └── data │ │ │ │ └── driver │ │ │ │ └── MoodDriverFactory.jvm.kt │ │ │ ├── nativeMain │ │ │ └── kotlin │ │ │ │ └── com │ │ │ │ └── joohnq │ │ │ │ └── mood │ │ │ │ └── add │ │ │ │ └── di │ │ │ │ └── StatsDriverFactoryModule.native.kt │ │ │ └── androidMain │ │ │ └── kotlin │ │ │ └── com │ │ │ └── joohnq │ │ │ └── mood │ │ │ └── add │ │ │ └── di │ │ │ └── MoodDriverFactoryModule.android.kt │ ├── overview │ │ └── src │ │ │ ├── androidDebug │ │ │ └── kotlin │ │ │ │ └── com │ │ │ │ └── joohnq │ │ │ │ └── mood │ │ │ │ └── overview │ │ │ │ └── component │ │ │ │ └── MoodOverviewMonthHeaderPreview.kt │ │ │ └── commonMain │ │ │ └── kotlin │ │ │ └── com │ │ │ └── joohnq │ │ │ └── overview │ │ │ └── di │ │ │ └── MoodOverviewModule.kt │ ├── add │ │ └── src │ │ │ ├── commonMain │ │ │ └── kotlin │ │ │ │ └── com │ │ │ │ └── joohnq │ │ │ │ └── add │ │ │ │ └── di │ │ │ │ └── MoodAddModule.kt │ │ │ └── androidDebug │ │ │ └── kotlin │ │ │ └── com │ │ │ └── joohnq │ │ │ └── mood │ │ │ └── add │ │ │ └── presentation │ │ │ └── ExpressionAnalysisContentPreview.kt │ └── history │ │ └── src │ │ └── commonMain │ │ └── kotlin │ │ └── com │ │ └── joohnq │ │ └── history │ │ └── di │ │ └── MoodHistoryModule.kt ├── stress-level │ ├── api │ │ ├── src │ │ │ └── commonMain │ │ │ │ └── kotlin │ │ │ │ └── com │ │ │ │ └── joohnq │ │ │ │ └── stress_level │ │ │ │ └── api │ │ │ │ ├── property │ │ │ │ ├── StressorProperties.kt │ │ │ │ └── StressLevelProperties.kt │ │ │ │ ├── entity │ │ │ │ ├── DStressorProperties.kt │ │ │ │ ├── StressLevelPalette.kt │ │ │ │ ├── DStressLevelProperties.kt │ │ │ │ └── StressLevelRecord.kt │ │ │ │ ├── repository │ │ │ │ └── StressLevelRepository.kt │ │ │ │ ├── use_case │ │ │ │ ├── GetAllStressLevelUseCase.kt │ │ │ │ ├── DeleteStressLevelUseCase.kt │ │ │ │ └── AddStressLevelUseCase.kt │ │ │ │ └── di │ │ │ │ └── StressLevelApiModule.kt │ │ └── build.gradle.kts │ ├── impl │ │ └── src │ │ │ ├── commonMain │ │ │ ├── kotlin │ │ │ │ └── com │ │ │ │ │ └── joohnq │ │ │ │ │ └── stress_level │ │ │ │ │ └── impl │ │ │ │ │ ├── di │ │ │ │ │ └── StressLevelDriverFactoryModule.kt │ │ │ │ │ └── data │ │ │ │ │ └── driver │ │ │ │ │ └── StressLevelDriverFactory.kt │ │ │ └── sqldelight │ │ │ │ └── com │ │ │ │ └── joohnq │ │ │ │ └── stress_level │ │ │ │ └── database │ │ │ │ └── StressLevelRecord.sq │ │ │ ├── jvmMain │ │ │ └── kotlin │ │ │ │ └── com │ │ │ │ └── joohnq │ │ │ │ └── stress_level │ │ │ │ └── impl │ │ │ │ └── di │ │ │ │ └── StressLevelDriverFactoryModule.jvm.kt │ │ │ ├── androidMain │ │ │ └── kotlin │ │ │ │ └── com │ │ │ │ └── joohnq │ │ │ │ └── stress_level │ │ │ │ └── impl │ │ │ │ └── di │ │ │ │ └── StressLevelDriverFactoryModule.android.kt │ │ │ ├── nativeMain │ │ │ └── kotlin │ │ │ │ └── com │ │ │ │ └── joohnq │ │ │ │ └── stress_level │ │ │ │ └── impl │ │ │ │ └── di │ │ │ │ └── StressLevelDriverFactoryModule.native.kt │ │ │ └── androidDebug │ │ │ └── kotlin │ │ │ └── com │ │ │ └── joohnq │ │ │ └── stress_level │ │ │ └── impl │ │ │ └── ui │ │ │ └── parameter │ │ │ └── ListStressLevelRecordResourceParameterProvider.kt │ ├── add │ │ └── src │ │ │ └── commonMain │ │ │ └── kotlin │ │ │ └── com │ │ │ └── joohnq │ │ │ └── stress_level │ │ │ └── add │ │ │ └── di │ │ │ └── StressLevelAddModule.kt │ ├── overview │ │ └── src │ │ │ ├── androidDebug │ │ │ └── kotlin │ │ │ │ └── com │ │ │ │ └── joohnq │ │ │ │ └── stress_level │ │ │ │ └── impl │ │ │ │ └── ui │ │ │ │ └── component │ │ │ │ └── TriggerIconPreview.kt │ │ │ └── commonMain │ │ │ └── kotlin │ │ │ └── com │ │ │ └── joohnq │ │ │ └── stress_level │ │ │ └── overview │ │ │ └── di │ │ │ └── StressLevelOverviewModule.kt │ └── history │ │ └── src │ │ └── commonMain │ │ └── kotlin │ │ └── com │ │ └── joohnq │ │ └── stress_level │ │ └── history │ │ └── di │ │ └── StressLevelHistoryModule.kt ├── freud-score │ ├── api │ │ ├── src │ │ │ └── commonMain │ │ │ │ └── kotlin │ │ │ │ └── com │ │ │ │ └── joohnq │ │ │ │ └── freud_score │ │ │ │ └── api │ │ │ │ └── property │ │ │ │ └── FreudScoreProperties.kt │ │ └── build.gradle.kts │ └── impl │ │ └── src │ │ └── commonMain │ │ └── kotlin │ │ └── com │ │ └── joohnq │ │ └── freud_score │ │ └── impl │ │ ├── ui │ │ └── entity │ │ │ └── FreudScorePalette.kt │ │ └── di │ │ └── FreudScoreImplModule.kt ├── gratefulness │ ├── api │ │ ├── src │ │ │ └── commonMain │ │ │ │ └── kotlin │ │ │ │ └── com │ │ │ │ └── joohnq │ │ │ │ └── gratefulness │ │ │ │ └── api │ │ │ │ ├── entity │ │ │ │ ├── Quote.kt │ │ │ │ ├── GratefulnessInsight.kt │ │ │ │ ├── Gratefulness.kt │ │ │ │ └── dto │ │ │ │ │ └── GratefulnessDTO.kt │ │ │ │ ├── mapper │ │ │ │ ├── DTODomainMapper.kt │ │ │ │ └── ListDTODomainMapper.kt │ │ │ │ ├── repository │ │ │ │ └── GratefulnessRepository.kt │ │ │ │ ├── use_case │ │ │ │ ├── GetGratefulnessUseCase.kt │ │ │ │ ├── DeleteGratefulnessUseCase.kt │ │ │ │ └── AddGratefulnessUseCase.kt │ │ │ │ └── di │ │ │ │ └── GratefulnessApiModule.kt │ │ └── build.gradle.kts │ ├── add │ │ └── src │ │ │ └── commonMain │ │ │ └── kotlin │ │ │ └── com │ │ │ └── joohnq │ │ │ └── gratefulness │ │ │ └── add │ │ │ └── di │ │ │ └── GratefulnessAddModule.kt │ ├── impl │ │ └── src │ │ │ └── commonMain │ │ │ └── kotlin │ │ │ └── com │ │ │ └── joohnq │ │ │ └── gratefulness │ │ │ └── impl │ │ │ └── di │ │ │ └── GratefulnessImplModule.kt │ ├── overview │ │ └── src │ │ │ └── commonMain │ │ │ └── kotlin │ │ │ └── com │ │ │ └── joohnq │ │ │ └── gratefulness │ │ │ └── overview │ │ │ └── di │ │ │ └── GratefulnessOverviewModule.kt │ └── history │ │ └── src │ │ └── commonMain │ │ └── kotlin │ │ └── com │ │ └── joohnq │ │ └── gratefulness │ │ └── history │ │ └── di │ │ └── GratefulnessHistoryModule.kt ├── sleep-quality │ ├── api │ │ └── src │ │ │ └── commonMain │ │ │ └── kotlin │ │ │ └── com │ │ │ └── joohnq │ │ │ └── sleep_quality │ │ │ └── api │ │ │ ├── property │ │ │ ├── SleepInfluencesProperties.kt │ │ │ └── SleepQualityProperties.kt │ │ │ ├── entity │ │ │ ├── DSleepInfluencesProperties.kt │ │ │ ├── DSleepQualityProperties.kt │ │ │ └── SleepQualityRecord.kt │ │ │ ├── exception │ │ │ └── SleepQualityException.kt │ │ │ ├── repository │ │ │ └── SleepQualityRepository.kt │ │ │ ├── use_case │ │ │ ├── GetSleepQualitiesUseCase.kt │ │ │ └── DeleteSleepQualityUseCase.kt │ │ │ └── di │ │ │ └── SleepQualityApiModule.kt │ ├── impl │ │ └── src │ │ │ ├── commonMain │ │ │ ├── kotlin │ │ │ │ └── com │ │ │ │ │ └── joohnq │ │ │ │ │ └── sleep_quality │ │ │ │ │ └── impl │ │ │ │ │ ├── di │ │ │ │ │ └── SleepQualityDriverFactoryModule.kt │ │ │ │ │ ├── data │ │ │ │ │ └── driver │ │ │ │ │ │ └── SleepQualityDriverFactory.kt │ │ │ │ │ └── ui │ │ │ │ │ └── entity │ │ │ │ │ ├── SleepQualityPalette.kt │ │ │ │ │ └── SleepStatsItem.kt │ │ │ └── sqldelight │ │ │ │ └── com │ │ │ │ └── joohnq │ │ │ │ └── sleep_quality │ │ │ │ └── database │ │ │ │ └── SleepQualityRecord.sq │ │ │ ├── jvmMain │ │ │ └── kotlin │ │ │ │ └── com │ │ │ │ └── joohnq │ │ │ │ └── sleep_quality │ │ │ │ └── impl │ │ │ │ └── di │ │ │ │ └── SleepQualityDriverFactoryModule.jvm.kt │ │ │ ├── nativeMain │ │ │ └── kotlin │ │ │ │ └── com │ │ │ │ └── joohnq │ │ │ │ └── sleep_quality │ │ │ │ └── impl │ │ │ │ └── di │ │ │ │ └── SleepQualityDriverFactoryModule.native.kt │ │ │ ├── androidMain │ │ │ └── kotlin │ │ │ │ └── com │ │ │ │ └── joohnq │ │ │ │ └── sleep_quality │ │ │ │ └── impl │ │ │ │ └── di │ │ │ │ └── SleepQualityDriverFactoryModule.android.kt │ │ │ └── androidDebug │ │ │ └── kotlin │ │ │ └── com │ │ │ └── joohnq │ │ │ └── sleep_quality │ │ │ └── impl │ │ │ └── ui │ │ │ └── parameter │ │ │ └── ListSleepQualityRecordResourceParameterProvider.kt │ ├── add │ │ └── src │ │ │ └── commonMain │ │ │ └── kotlin │ │ │ └── com │ │ │ └── joohnq │ │ │ └── sleep_quality │ │ │ └── add │ │ │ └── di │ │ │ └── SleepQualityAddModule.kt │ ├── history │ │ └── src │ │ │ └── commonMain │ │ │ └── kotlin │ │ │ └── com │ │ │ └── joohnq │ │ │ └── sleep_quality │ │ │ └── history │ │ │ └── di │ │ │ └── SleepQualityHistoryModule.kt │ └── overview │ │ └── src │ │ ├── commonMain │ │ └── kotlin │ │ │ └── com │ │ │ └── joohnq │ │ │ └── sleep_quality │ │ │ └── overview │ │ │ └── di │ │ │ └── SleepQualityOverviewModule.kt │ │ └── androidDebug │ │ └── kotlin │ │ └── com │ │ └── joohnq │ │ └── sleep_quality │ │ └── overview │ │ └── component │ │ ├── SleepQualityOverviewPanelInfoPreview.kt │ │ └── SleepQualityOverviewPanelInfoInvertedPreview.kt ├── self-journal │ ├── impl │ │ └── src │ │ │ ├── commonMain │ │ │ ├── kotlin │ │ │ │ └── com │ │ │ │ │ └── joohnq │ │ │ │ │ └── self_journal │ │ │ │ │ └── impl │ │ │ │ │ ├── di │ │ │ │ │ └── SelfJournalDriverFactoryModule.kt │ │ │ │ │ └── data │ │ │ │ │ └── driver │ │ │ │ │ └── SelfJournalDriverFactory.kt │ │ │ └── sqldelight │ │ │ │ └── com │ │ │ │ └── joohnq │ │ │ │ └── self_journal │ │ │ │ └── database │ │ │ │ └── SelfJournalRecord.sq │ │ │ ├── jvmMain │ │ │ └── kotlin │ │ │ │ └── com │ │ │ │ └── joohnq │ │ │ │ └── self_journal │ │ │ │ └── impl │ │ │ │ └── di │ │ │ │ └── SelfJournalDriverFactoryModule.jvm.kt │ │ │ ├── androidMain │ │ │ └── kotlin │ │ │ │ └── com │ │ │ │ └── joohnq │ │ │ │ └── self_journal │ │ │ │ └── impl │ │ │ │ └── di │ │ │ │ └── SelfJournalDriverFactoryModule.android.kt │ │ │ ├── nativeMain │ │ │ └── kotlin │ │ │ │ └── com │ │ │ │ └── joohnq │ │ │ │ └── self_journal │ │ │ │ └── impl │ │ │ │ └── di │ │ │ │ └── SelfJournalDriverFactoryModule.native.kt │ │ │ └── androidDebug │ │ │ └── kotlin │ │ │ └── com │ │ │ └── joohnq │ │ │ └── self_journal │ │ │ └── impl │ │ │ └── parameter │ │ │ └── ListSelfJournalRecordResourceParameterProvider.kt │ ├── api │ │ ├── src │ │ │ └── commonMain │ │ │ │ └── kotlin │ │ │ │ └── com │ │ │ │ └── joohnq │ │ │ │ └── self_journal │ │ │ │ └── api │ │ │ │ ├── use_case │ │ │ │ ├── GetSelfJournalsUseCase.kt │ │ │ │ ├── DeleteSelfJournalsUseCase.kt │ │ │ │ ├── AddSelfJournalsUseCase.kt │ │ │ │ ├── UpdateSelfJournalsUseCase.kt │ │ │ │ └── GetSelfJournalByIdUseCase.kt │ │ │ │ └── repository │ │ │ │ └── SelfJournalRepository.kt │ │ └── build.gradle.kts │ ├── overview │ │ └── src │ │ │ ├── androidDebug │ │ │ └── kotlin │ │ │ │ └── com │ │ │ │ └── joohnq │ │ │ │ └── self_journal │ │ │ │ └── overview │ │ │ │ └── component │ │ │ │ ├── SelfJournalOverviewCalendarContentFooterPreview.kt │ │ │ │ ├── SelfJournalOverviewCalendarContentMonthHeaderPreview.kt │ │ │ │ ├── CalendarInfoCardPreview.kt │ │ │ │ ├── SelfJournalPanelPreview.kt │ │ │ │ ├── SelfJournalOverviewHistoryPreview.kt │ │ │ │ └── SelfJournalInsightItemPreview.kt │ │ │ └── commonMain │ │ │ └── kotlin │ │ │ └── com │ │ │ └── joohnq │ │ │ └── self_journal │ │ │ └── di │ │ │ └── SelfJournalOverviewModule.kt │ ├── add │ │ └── src │ │ │ └── commonMain │ │ │ └── kotlin │ │ │ └── com │ │ │ └── joohnq │ │ │ └── self_journal │ │ │ └── di │ │ │ └── SelfJournalAddModule.kt │ ├── history │ │ └── src │ │ │ └── commonMain │ │ │ └── kotlin │ │ │ └── com │ │ │ └── joohnq │ │ │ └── self_journal │ │ │ └── di │ │ │ └── SelfJournalHistoryModule.kt │ └── edit │ │ └── src │ │ └── commonMain │ │ └── kotlin │ │ └── com │ │ └── joohnq │ │ └── self_journal │ │ └── di │ │ └── SelfJournalEditModule.kt ├── onboarding │ └── impl │ │ └── src │ │ └── commonMain │ │ └── kotlin │ │ └── com │ │ └── joohnq │ │ └── onboarding │ │ └── impl │ │ └── ui │ │ └── event │ │ └── OnboardingEvent.kt ├── preferences │ ├── api │ │ ├── build.gradle.kts │ │ └── src │ │ │ └── commonMain │ │ │ └── kotlin │ │ │ └── com │ │ │ └── joohnq │ │ │ └── preferences │ │ │ └── api │ │ │ ├── entity │ │ │ └── AppPreferences.kt │ │ │ ├── use_case │ │ │ ├── UpdateSkipAuthUseCase.kt │ │ │ ├── UpdateSkipSecurityUseCase.kt │ │ │ ├── UpdateSkipOnboardingUseCase.kt │ │ │ ├── UpdateSkipWelcomeUseCase.kt │ │ │ └── GetPreferencesUseCase.kt │ │ │ └── repository │ │ │ └── PreferencesRepository.kt │ └── impl │ │ ├── src │ │ └── commonMain │ │ │ └── kotlin │ │ │ └── com │ │ │ └── joohnq │ │ │ └── preferences │ │ │ └── impl │ │ │ └── di │ │ │ └── PreferencesImplModule.kt │ │ └── build.gradle.kts ├── home │ └── impl │ │ └── src │ │ ├── androidDebug │ │ └── kotlin │ │ │ └── com │ │ │ └── joohnq │ │ │ └── home │ │ │ └── impl │ │ │ └── components │ │ │ ├── DashboardCentralPreview.kt │ │ │ ├── DashboardBottomNavigationPreview.kt │ │ │ └── HomeTopBarPreview.kt │ │ └── commonMain │ │ └── kotlin │ │ └── com │ │ └── joohnq │ │ └── home │ │ └── impl │ │ ├── ui │ │ └── components │ │ │ └── CreateTabItem.kt │ │ └── di │ │ └── HomeImplModule.kt ├── auth │ └── impl │ │ └── src │ │ └── androidDebug │ │ └── kotlin │ │ └── com │ │ └── joohnq │ │ └── auth │ │ └── impl │ │ ├── components │ │ ├── ImageSourcePickerPreview.kt │ │ └── AvatarImagesHorizontalPagerPreview.kt │ │ └── presentation │ │ └── avatar │ │ └── AvatarContentPreview.kt └── splash │ └── impl │ └── src │ ├── androidDebug │ └── kotlin │ │ └── com │ │ └── joohnq │ │ └── splash │ │ └── impl │ │ └── presentation │ │ └── splash │ │ └── SplashScreenContentPreview.kt │ └── commonMain │ └── kotlin │ └── com │ └── joohnq │ └── splash │ └── impl │ └── di │ └── SplashImplModule.kt ├── gradle.properties └── .gitignore /composeApp/mood.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/joohnq/moodly/HEAD/composeApp/mood.db -------------------------------------------------------------------------------- /composeApp/user.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/joohnq/moodly/HEAD/composeApp/user.db -------------------------------------------------------------------------------- /assets/principal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/joohnq/moodly/HEAD/assets/principal.png -------------------------------------------------------------------------------- /composeApp/self_journal: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/joohnq/moodly/HEAD/composeApp/self_journal -------------------------------------------------------------------------------- /composeApp/sleep_quality.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/joohnq/moodly/HEAD/composeApp/sleep_quality.db -------------------------------------------------------------------------------- /composeApp/stress_level.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/joohnq/moodly/HEAD/composeApp/stress_level.db -------------------------------------------------------------------------------- /iosApp/Configuration/Config.xcconfig: -------------------------------------------------------------------------------- 1 | TEAM_ID= 2 | BUNDLE_ID=com.joohnq.moodapp.Moodly 3 | APP_NAME=Moodly -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/joohnq/moodly/HEAD/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /composeApp/src/androidMain/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | Moodly 3 | -------------------------------------------------------------------------------- /core/domain/src/commonMain/kotlin/com/joohnq/api/entity/Year.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.api.entity 2 | 3 | typealias Year = Int 4 | -------------------------------------------------------------------------------- /iosApp/iosApp/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "author" : "xcode", 4 | "version" : 1 5 | } 6 | } -------------------------------------------------------------------------------- /core/domain/src/commonMain/kotlin/com/joohnq/api/entity/Minutes.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.api.entity 2 | 3 | typealias Minutes = Int 4 | -------------------------------------------------------------------------------- /composeApp/src/androidMain/ic_launcher-playstore.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/joohnq/moodly/HEAD/composeApp/src/androidMain/ic_launcher-playstore.png -------------------------------------------------------------------------------- /core/storage/api/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | id("moodly.android.library") 3 | id("moodly.multiplatform.library") 4 | } 5 | 6 | kotlin {} 7 | -------------------------------------------------------------------------------- /iosApp/iosApp/Preview Content/Preview Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "author" : "xcode", 4 | "version" : 1 5 | } 6 | } -------------------------------------------------------------------------------- /shared-resources/src/commonMain/kotlin/com/joohnq/shared_resources/theme/Shadow.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.shared_resources.theme 2 | 3 | object Shadow 4 | -------------------------------------------------------------------------------- /composeApp/src/androidMain/res/mipmap-hdpi/ic_launcher.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/joohnq/moodly/HEAD/composeApp/src/androidMain/res/mipmap-hdpi/ic_launcher.webp -------------------------------------------------------------------------------- /composeApp/src/androidMain/res/mipmap-mdpi/ic_launcher.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/joohnq/moodly/HEAD/composeApp/src/androidMain/res/mipmap-mdpi/ic_launcher.webp -------------------------------------------------------------------------------- /composeApp/src/androidMain/res/mipmap-xhdpi/ic_launcher.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/joohnq/moodly/HEAD/composeApp/src/androidMain/res/mipmap-xhdpi/ic_launcher.webp -------------------------------------------------------------------------------- /composeApp/src/androidMain/res/mipmap-xxhdpi/ic_launcher.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/joohnq/moodly/HEAD/composeApp/src/androidMain/res/mipmap-xxhdpi/ic_launcher.webp -------------------------------------------------------------------------------- /composeApp/src/androidMain/res/mipmap-xxxhdpi/ic_launcher.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/joohnq/moodly/HEAD/composeApp/src/androidMain/res/mipmap-xxxhdpi/ic_launcher.webp -------------------------------------------------------------------------------- /core/ui/src/commonMain/kotlin/com/joohnq/ui/entity/ImageFormat.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.ui.entity 2 | 3 | expect enum class ImageFormat { 4 | PNG, 5 | JPEG, 6 | } 7 | -------------------------------------------------------------------------------- /iosApp/iosApp/Assets.xcassets/AppIcon.appiconset/Group 6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/joohnq/moodly/HEAD/iosApp/iosApp/Assets.xcassets/AppIcon.appiconset/Group 6.png -------------------------------------------------------------------------------- /composeApp/src/androidMain/res/values-pt-rBR/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Moodly 4 | -------------------------------------------------------------------------------- /core/domain/src/commonMain/kotlin/com/joohnq/api/entity/Time.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.api.entity 2 | 3 | data class Time( 4 | val hour: Int, 5 | val minute: Int, 6 | ) 7 | -------------------------------------------------------------------------------- /composeApp/src/androidMain/res/mipmap-hdpi/ic_launcher_round.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/joohnq/moodly/HEAD/composeApp/src/androidMain/res/mipmap-hdpi/ic_launcher_round.webp -------------------------------------------------------------------------------- /composeApp/src/androidMain/res/mipmap-mdpi/ic_launcher_round.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/joohnq/moodly/HEAD/composeApp/src/androidMain/res/mipmap-mdpi/ic_launcher_round.webp -------------------------------------------------------------------------------- /composeApp/src/androidMain/res/mipmap-xhdpi/ic_launcher_round.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/joohnq/moodly/HEAD/composeApp/src/androidMain/res/mipmap-xhdpi/ic_launcher_round.webp -------------------------------------------------------------------------------- /composeApp/src/androidMain/res/mipmap-xxhdpi/ic_launcher_round.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/joohnq/moodly/HEAD/composeApp/src/androidMain/res/mipmap-xxhdpi/ic_launcher_round.webp -------------------------------------------------------------------------------- /feature/user/api/src/commonMain/kotlin/com/joohnq/api/entity/ImageType.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.api.entity 2 | 3 | enum class ImageType { 4 | DEVICE, 5 | DRAWABLE, 6 | } 7 | -------------------------------------------------------------------------------- /composeApp/src/androidMain/res/mipmap-xxxhdpi/ic_launcher_round.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/joohnq/moodly/HEAD/composeApp/src/androidMain/res/mipmap-xxxhdpi/ic_launcher_round.webp -------------------------------------------------------------------------------- /core/permission/src/commonMain/kotlin/com/joohnq/permission/PermissionType.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.permission 2 | 3 | enum class PermissionType { 4 | CAMERA, 5 | GALLERY, 6 | } 7 | -------------------------------------------------------------------------------- /feature/welcome/api/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | id("moodly.android.library") 3 | id("moodly.multiplatform.library") 4 | id("moodly.compose") 5 | } 6 | 7 | kotlin {} 8 | -------------------------------------------------------------------------------- /core/domain/src/commonMain/kotlin/com/joohnq/api/entity/CurvedCanvasPosition.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.api.entity 2 | 3 | enum class CurvedCanvasPosition { 4 | TOP, 5 | BOTTOM, 6 | } 7 | -------------------------------------------------------------------------------- /shared-resources/src/commonMain/composeResources/font/urbanist_black.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/joohnq/moodly/HEAD/shared-resources/src/commonMain/composeResources/font/urbanist_black.ttf -------------------------------------------------------------------------------- /shared-resources/src/commonMain/composeResources/font/urbanist_bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/joohnq/moodly/HEAD/shared-resources/src/commonMain/composeResources/font/urbanist_bold.ttf -------------------------------------------------------------------------------- /shared-resources/src/commonMain/composeResources/font/urbanist_light.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/joohnq/moodly/HEAD/shared-resources/src/commonMain/composeResources/font/urbanist_light.ttf -------------------------------------------------------------------------------- /shared-resources/src/commonMain/composeResources/font/urbanist_thin.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/joohnq/moodly/HEAD/shared-resources/src/commonMain/composeResources/font/urbanist_thin.ttf -------------------------------------------------------------------------------- /composeApp/src/androidMain/res/values/ic_launcher_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #FFFFFF 4 | -------------------------------------------------------------------------------- /feature/security/api/src/commonMain/kotlin/com/joohnq/security/api/SecurityType.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.security.api 2 | 3 | enum class SecurityType { 4 | PIN, 5 | DEVICE_SECURITY, 6 | } 7 | -------------------------------------------------------------------------------- /shared-resources/src/commonMain/composeResources/font/urbanist_medium.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/joohnq/moodly/HEAD/shared-resources/src/commonMain/composeResources/font/urbanist_medium.ttf -------------------------------------------------------------------------------- /shared-resources/src/commonMain/composeResources/font/urbanist_regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/joohnq/moodly/HEAD/shared-resources/src/commonMain/composeResources/font/urbanist_regular.ttf -------------------------------------------------------------------------------- /core/datastore/src/commonMain/kotlin/com/joohnq/datastore/di/DataStoreModule.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.datastore.di 2 | 3 | import org.koin.core.module.Module 4 | 5 | expect val dataStoreModule: Module 6 | -------------------------------------------------------------------------------- /feature/user/api/src/commonMain/kotlin/com/joohnq/api/property/PhysicalSymptomsProperties.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.api.property 2 | 3 | interface PhysicalSymptomsProperties { 4 | val id: Long 5 | } 6 | -------------------------------------------------------------------------------- /shared-resources/src/commonMain/composeResources/font/urbanist_extra_bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/joohnq/moodly/HEAD/shared-resources/src/commonMain/composeResources/font/urbanist_extra_bold.ttf -------------------------------------------------------------------------------- /shared-resources/src/commonMain/composeResources/font/urbanist_semi_bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/joohnq/moodly/HEAD/shared-resources/src/commonMain/composeResources/font/urbanist_semi_bold.ttf -------------------------------------------------------------------------------- /core/database/src/commonMain/kotlin/com/joohnq/database/di/AppDatabaseModule.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.database.di 2 | 3 | import org.koin.core.module.Module 4 | 5 | expect val appDatabaseModule: Module 6 | -------------------------------------------------------------------------------- /core/ui/src/jvmMain/kotlin/com/joohnq/ui/entity/ImageFormat.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.ui.entity 2 | 3 | import org.jetbrains.skia.EncodedImageFormat 4 | 5 | actual typealias ImageFormat = EncodedImageFormat 6 | -------------------------------------------------------------------------------- /shared-resources/src/commonMain/composeResources/font/urbanist_extra_light.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/joohnq/moodly/HEAD/shared-resources/src/commonMain/composeResources/font/urbanist_extra_light.ttf -------------------------------------------------------------------------------- /core/ui/src/androidMain/kotlin/com/joohnq/ui/entity/ImageFormat.android.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.ui.entity 2 | 3 | import android.graphics.Bitmap 4 | 5 | actual typealias ImageFormat = Bitmap.CompressFormat 6 | -------------------------------------------------------------------------------- /core/ui/src/nativeMain/kotlin/com/joohnq/ui/entity/ImageFormat.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.ui.entity 2 | 3 | import org.jetbrains.skia.EncodedImageFormat 4 | 5 | actual typealias ImageFormat = EncodedImageFormat 6 | -------------------------------------------------------------------------------- /core/database/src/commonMain/kotlin/com/joohnq/database/Database.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.database 2 | 3 | abstract class Database { 4 | abstract operator fun invoke(): T 5 | 6 | abstract fun drop() 7 | } 8 | -------------------------------------------------------------------------------- /core/domain/src/commonMain/kotlin/com/joohnq/api/mapper/IntMapper.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.api.mapper 2 | 3 | object IntMapper { 4 | fun Int.toPaddedString(): String = if (this < 10) "0$this" else "$this" 5 | } 6 | -------------------------------------------------------------------------------- /core/permission/src/commonMain/kotlin/com/joohnq/permission/PermissionStatus.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.permission 2 | 3 | enum class PermissionStatus { 4 | GRANTED, 5 | DENIED, 6 | SHOW_RATIONAL, 7 | } 8 | -------------------------------------------------------------------------------- /core/storage/impl/src/commonMain/kotlin/com/joohnq/storage/impl/di/CoreStorageModule.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.storage.impl.di 2 | 3 | import org.koin.core.module.Module 4 | 5 | expect val coreStorageModule: Module 6 | -------------------------------------------------------------------------------- /feature/mood/api/src/commonMain/kotlin/com/joohnq/mood/api/property/MoodProperties.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.mood.api.property 2 | 3 | interface MoodProperties { 4 | val id: Long 5 | val healthLevel: Int 6 | } 7 | -------------------------------------------------------------------------------- /feature/user/api/src/commonMain/kotlin/com/joohnq/api/property/MedicationsSupplementsProperties.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.api.property 2 | 3 | interface MedicationsSupplementsProperties { 4 | val id: Long 5 | } 6 | -------------------------------------------------------------------------------- /core/ui/src/commonMain/kotlin/com/joohnq/ui/entity/StateDispatch.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.ui.entity 2 | 3 | data class StateDispatch( 4 | val state: STATE, 5 | val dispatch: (EVENT) -> Unit, 6 | ) 7 | -------------------------------------------------------------------------------- /feature/mood/impl/src/commonMain/kotlin/com/joohnq/mood/add/di/MoodDriverFactoryModule.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.mood.add.di 2 | 3 | import org.koin.core.module.Module 4 | 5 | expect val moodDriverFactoryModule: Module 6 | -------------------------------------------------------------------------------- /feature/stress-level/api/src/commonMain/kotlin/com/joohnq/stress_level/api/property/StressorProperties.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.stress_level.api.property 2 | 3 | interface StressorProperties { 4 | val id: Long 5 | } 6 | -------------------------------------------------------------------------------- /feature/user/impl/src/commonMain/kotlin/com/joohnq/user/impl/di/UserDriverFactoryModule.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.user.impl.di 2 | 3 | import org.koin.core.module.Module 4 | 5 | expect val userDriverFactoryModule: Module 6 | -------------------------------------------------------------------------------- /core/ui/src/commonMain/kotlin/com/joohnq/ui/event/PanelEvent.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.ui.event 2 | 3 | sealed interface PanelEvent { 4 | data object OnGoBack : PanelEvent 5 | 6 | data object OnAdd : PanelEvent 7 | } 8 | -------------------------------------------------------------------------------- /feature/freud-score/api/src/commonMain/kotlin/com/joohnq/freud_score/api/property/FreudScoreProperties.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.freud_score.api.property 2 | 3 | interface FreudScoreProperties { 4 | val score: Int 5 | } 6 | -------------------------------------------------------------------------------- /feature/gratefulness/api/src/commonMain/kotlin/com/joohnq/gratefulness/api/entity/Quote.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.gratefulness.api.entity 2 | 3 | data class Quote( 4 | val content: String, 5 | val author: String, 6 | ) 7 | -------------------------------------------------------------------------------- /core/database/src/commonMain/kotlin/com/joohnq/database/di/AppDatabaseDriverFactoryModule.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.database.di 2 | 3 | import org.koin.core.module.Module 4 | 5 | expect val appDatabaseDriverFactoryModule: Module 6 | -------------------------------------------------------------------------------- /feature/user/api/src/commonMain/kotlin/com/joohnq/api/property/ProfessionalHelpProperties.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.api.property 2 | 3 | interface ProfessionalHelpProperties { 4 | val id: Long 5 | val value: Boolean 6 | } 7 | -------------------------------------------------------------------------------- /iosApp/iosApp.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /feature/sleep-quality/api/src/commonMain/kotlin/com/joohnq/sleep_quality/api/property/SleepInfluencesProperties.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.sleep_quality.api.property 2 | 3 | interface SleepInfluencesProperties { 4 | val id: Long 5 | } 6 | -------------------------------------------------------------------------------- /iosApp/iosApp/Assets.xcassets/AccentColor.colorset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "colors" : [ 3 | { 4 | "idiom" : "universal" 5 | } 6 | ], 7 | "info" : { 8 | "author" : "xcode", 9 | "version" : 1 10 | } 11 | } -------------------------------------------------------------------------------- /core/domain/src/commonMain/kotlin/com/joohnq/api/entity/Quad.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.api.entity 2 | 3 | data class Quad( 4 | val first: A, 5 | val second: B, 6 | val third: C, 7 | val fourth: D, 8 | ) 9 | -------------------------------------------------------------------------------- /feature/security/impl/src/commonMain/kotlin/com/joohnq/security/impl/di/SecurityAuthenticationModule.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.security.impl.di 2 | 3 | import org.koin.core.module.Module 4 | 5 | expect val securityAuthenticationModule: Module 6 | -------------------------------------------------------------------------------- /feature/stress-level/api/src/commonMain/kotlin/com/joohnq/stress_level/api/property/StressLevelProperties.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.stress_level.api.property 2 | 3 | interface StressLevelProperties { 4 | val id: Long 5 | val level: Int 6 | } 7 | -------------------------------------------------------------------------------- /feature/self-journal/impl/src/commonMain/kotlin/com/joohnq/self_journal/impl/di/SelfJournalDriverFactoryModule.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.self_journal.impl.di 2 | 3 | import org.koin.core.module.Module 4 | 5 | expect val selfJournalDriverFactory: Module 6 | -------------------------------------------------------------------------------- /feature/sleep-quality/api/src/commonMain/kotlin/com/joohnq/sleep_quality/api/property/SleepQualityProperties.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.sleep_quality.api.property 2 | 3 | interface SleepQualityProperties { 4 | val id: Long 5 | val level: Int 6 | } 7 | -------------------------------------------------------------------------------- /core/domain/src/commonMain/kotlin/com/joohnq/api/entity/DaySection.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.api.entity 2 | 3 | enum class DaySection( 4 | val text: String, 5 | ) { 6 | Morning("Mor"), 7 | Evening("Even"), 8 | Afternoon("Aft"), 9 | } 10 | -------------------------------------------------------------------------------- /feature/stress-level/impl/src/commonMain/kotlin/com/joohnq/stress_level/impl/di/StressLevelDriverFactoryModule.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.stress_level.impl.di 2 | 3 | import org.koin.core.module.Module 4 | 5 | expect val stressLevelDriverFactoryModule: Module 6 | -------------------------------------------------------------------------------- /feature/sleep-quality/impl/src/commonMain/kotlin/com/joohnq/sleep_quality/impl/di/SleepQualityDriverFactoryModule.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.sleep_quality.impl.di 2 | 3 | import org.koin.core.module.Module 4 | 5 | expect val sleepQualityDriverFactoryModule: Module 6 | -------------------------------------------------------------------------------- /core/database/src/commonMain/kotlin/com/joohnq/database/driver/AppDatabaseDriverFactory.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.database.driver 2 | 3 | import app.cash.sqldelight.db.SqlDriver 4 | 5 | expect class AppDatabaseDriverFactory { 6 | fun createDriver(): SqlDriver 7 | } 8 | -------------------------------------------------------------------------------- /core/database/src/commonMain/kotlin/com/joohnq/database/mapper/LocalDateMapper.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.database.mapper 2 | 3 | import kotlinx.datetime.LocalDate 4 | 5 | object LocalDateMapper { 6 | fun String.toLocalDate(): LocalDate = LocalDate.parse(this) 7 | } 8 | -------------------------------------------------------------------------------- /feature/mood/impl/src/commonMain/kotlin/com/joohnq/mood/add/data/driver/MoodDriverFactory.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.mood.add.data.driver 2 | 3 | import app.cash.sqldelight.db.SqlDriver 4 | 5 | expect class MoodDriverFactory { 6 | fun createDriver(): SqlDriver 7 | } 8 | -------------------------------------------------------------------------------- /feature/user/api/src/commonMain/kotlin/com/joohnq/api/constant/UserFileStorageConstants.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.api.constant 2 | 3 | object UserFileStorageConstants { 4 | const val AVATAR_DIRECTORY = "avatar" 5 | const val AVATAR_FILE_NAME = "avatar.png" 6 | } 7 | -------------------------------------------------------------------------------- /feature/user/api/src/commonMain/kotlin/com/joohnq/api/mapper/ImageTypeMapper.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.api.mapper 2 | 3 | import com.joohnq.api.entity.ImageType 4 | 5 | object ImageTypeMapper { 6 | fun String.toImageType(): ImageType = ImageType.valueOf(this) 7 | } 8 | -------------------------------------------------------------------------------- /feature/user/impl/src/commonMain/kotlin/com/joohnq/user/impl/data/driver/UserDriverFactory.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.user.impl.data.driver 2 | 3 | import app.cash.sqldelight.db.SqlDriver 4 | 5 | expect class UserDriverFactory { 6 | fun createDriver(): SqlDriver 7 | } 8 | -------------------------------------------------------------------------------- /feature/gratefulness/api/src/commonMain/kotlin/com/joohnq/gratefulness/api/mapper/DTODomainMapper.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.gratefulness.api.mapper 2 | 3 | interface DTODomainMapper { 4 | fun DTO.toDomain(): DOMAIN 5 | 6 | fun DOMAIN.toDto(): DTO 7 | } 8 | -------------------------------------------------------------------------------- /core/permission/src/commonMain/kotlin/com/joohnq/permission/PermissionCallback.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.permission 2 | 3 | interface PermissionCallback { 4 | fun onPermissionStatus( 5 | permissionType: PermissionType, 6 | status: PermissionStatus, 7 | ) 8 | } 9 | -------------------------------------------------------------------------------- /feature/security/api/src/commonMain/kotlin/com/joohnq/security/api/SecurityAuthentication.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.security.api 2 | 3 | interface SecurityAuthentication { 4 | fun isDeviceHasBiometric(): Boolean 5 | 6 | fun authenticateWithFace(callback: (Boolean) -> Unit) 7 | } 8 | -------------------------------------------------------------------------------- /core/domain/src/commonMain/kotlin/com/joohnq/api/mapper/MinutesMapper.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.api.mapper 2 | 3 | import com.joohnq.api.entity.Minutes 4 | import com.joohnq.api.entity.Time 5 | 6 | object MinutesMapper { 7 | fun Minutes.toTimeFromMinutes(): Time = Time(this / 60, this % 60) 8 | } 9 | -------------------------------------------------------------------------------- /core/permission/src/commonMain/kotlin/com/joohnq/permission/SharedImage.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.permission 2 | 3 | import androidx.compose.ui.graphics.ImageBitmap 4 | 5 | expect class SharedImage { 6 | fun toByteArray(): ByteArray? 7 | 8 | fun toImageBitmap(): ImageBitmap? 9 | } 10 | -------------------------------------------------------------------------------- /core/ui/src/commonMain/kotlin/com/joohnq/ui/entity/BottomItem.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.ui.entity 2 | 3 | import org.jetbrains.compose.resources.StringResource 4 | 5 | data class BottomItem( 6 | val icon: IconResource, 7 | val title: StringResource, 8 | val route: T, 9 | ) 10 | -------------------------------------------------------------------------------- /core/ui/src/commonMain/kotlin/com/joohnq/ui/mapper/ImageBitmapMapper.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.ui.mapper 2 | 3 | import androidx.compose.ui.graphics.ImageBitmap 4 | import com.joohnq.ui.entity.ImageFormat 5 | 6 | expect fun ImageBitmap.toByteArray(format: ImageFormat = ImageFormat.PNG): ByteArray 7 | -------------------------------------------------------------------------------- /feature/onboarding/impl/src/commonMain/kotlin/com/joohnq/onboarding/impl/ui/event/OnboardingEvent.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.onboarding.impl.ui.event 2 | 3 | sealed interface OnboardingEvent { 4 | data object OnGoBack : OnboardingEvent 5 | 6 | data object NavigateNext : OnboardingEvent 7 | } 8 | -------------------------------------------------------------------------------- /feature/security/api/src/commonMain/kotlin/com/joohnq/security/api/SecurityPreference.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.security.api 2 | 3 | interface SecurityPreference { 4 | suspend fun update(security: Security) 5 | 6 | suspend fun get(): Security 7 | 8 | suspend fun init() 9 | } 10 | -------------------------------------------------------------------------------- /core/domain/src/commonMain/kotlin/com/joohnq/api/mapper/ListMapper.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.api.mapper 2 | 3 | object ListMapper { 4 | fun List.toggle(item: T): List = if (contains(item)) minus(item) else plus(item) 5 | 6 | fun List.itemsNotNull(): List = map { it!! } 7 | } 8 | -------------------------------------------------------------------------------- /feature/gratefulness/api/src/commonMain/kotlin/com/joohnq/gratefulness/api/entity/GratefulnessInsight.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.gratefulness.api.entity 2 | 3 | data class GratefulnessInsight( 4 | val items: List, 5 | val principal: String? = null, 6 | val principalCount: Int = 0, 7 | ) 8 | -------------------------------------------------------------------------------- /feature/gratefulness/api/src/commonMain/kotlin/com/joohnq/gratefulness/api/mapper/ListDTODomainMapper.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.gratefulness.api.mapper 2 | 3 | interface ListDTODomainMapper { 4 | fun List.toDomain(): List 5 | 6 | fun List.toDto(): List 7 | } 8 | -------------------------------------------------------------------------------- /feature/user/api/src/commonMain/kotlin/com/joohnq/api/entity/DPhysicalSymptomsProperties.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.api.entity 2 | 3 | import com.joohnq.api.property.PhysicalSymptomsProperties 4 | 5 | data class DPhysicalSymptomsProperties( 6 | override val id: Long, 7 | ) : PhysicalSymptomsProperties 8 | -------------------------------------------------------------------------------- /feature/user/api/src/commonMain/kotlin/com/joohnq/api/exception/UserNameException.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.api.exception 2 | 3 | sealed class UserNameException( 4 | override val message: String, 5 | ) : Exception(message) { 6 | data object EmptyName : UserNameException("Name can't be empty") 7 | } 8 | -------------------------------------------------------------------------------- /core/database/src/commonMain/kotlin/com/joohnq/database/mapper/LocalDateTimeMapper.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.database.mapper 2 | 3 | import kotlinx.datetime.LocalDateTime 4 | 5 | object LocalDateTimeMapper { 6 | fun String.toLocalDateTime(): LocalDateTime = LocalDateTime.parse(this.replace(" ", "T")) 7 | } 8 | -------------------------------------------------------------------------------- /core/ui/src/commonMain/kotlin/com/joohnq/ui/entity/CentralAction.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.ui.entity 2 | 3 | import org.jetbrains.compose.resources.DrawableResource 4 | 5 | data class CentralAction( 6 | val title: String, 7 | val icon: DrawableResource, 8 | val destination: T, 9 | ) 10 | -------------------------------------------------------------------------------- /feature/freud-score/api/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | id("moodly.android.library") 3 | id("moodly.multiplatform.library") 4 | } 5 | 6 | kotlin { 7 | sourceSets { 8 | commonMain.dependencies { 9 | implementation(projects.core.domain) 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /feature/mood/api/src/commonMain/kotlin/com/joohnq/mood/api/entity/DMoodProperties.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.mood.api.entity 2 | 3 | import com.joohnq.mood.api.property.MoodProperties 4 | 5 | data class DMoodProperties( 6 | override val id: Long, 7 | override val healthLevel: Int, 8 | ) : MoodProperties 9 | -------------------------------------------------------------------------------- /feature/preferences/api/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | id("moodly.android.library") 3 | id("moodly.multiplatform.library") 4 | } 5 | 6 | kotlin { 7 | sourceSets { 8 | commonMain.dependencies { 9 | implementation(libs.bundles.koin) 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /feature/self-journal/impl/src/commonMain/kotlin/com/joohnq/self_journal/impl/data/driver/SelfJournalDriverFactory.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.self_journal.impl.data.driver 2 | 3 | import app.cash.sqldelight.db.SqlDriver 4 | 5 | expect class SelfJournalDriverFactory { 6 | fun createDriver(): SqlDriver 7 | } 8 | -------------------------------------------------------------------------------- /feature/stress-level/impl/src/commonMain/kotlin/com/joohnq/stress_level/impl/data/driver/StressLevelDriverFactory.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.stress_level.impl.data.driver 2 | 3 | import app.cash.sqldelight.db.SqlDriver 4 | 5 | expect class StressLevelDriverFactory { 6 | fun createDriver(): SqlDriver 7 | } 8 | -------------------------------------------------------------------------------- /iosApp/iosApp/iOSApp.swift: -------------------------------------------------------------------------------- 1 | import SwiftUI 2 | import ComposeApp 3 | 4 | @main 5 | struct iOSApp: App { 6 | init() { 7 | MainViewControllerKt.initialize() 8 | } 9 | 10 | var body: some Scene { 11 | WindowGroup { 12 | ContentView() 13 | } 14 | } 15 | } -------------------------------------------------------------------------------- /core/datastore/src/commonMain/kotlin/com/joohnq/datastore/PreferencesDataStore.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.datastore 2 | 3 | import androidx.datastore.core.DataStore 4 | import androidx.datastore.preferences.core.Preferences 5 | 6 | expect class PreferencesDataStore { 7 | fun init(): DataStore 8 | } 9 | -------------------------------------------------------------------------------- /core/ui/src/commonMain/kotlin/com/joohnq/ui/SharedViewModel.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.ui 2 | 3 | import androidx.compose.runtime.Composable 4 | import androidx.lifecycle.ViewModel 5 | import org.koin.compose.koinInject 6 | 7 | @Composable 8 | inline fun sharedViewModel(): T = koinInject() 9 | -------------------------------------------------------------------------------- /feature/sleep-quality/impl/src/commonMain/kotlin/com/joohnq/sleep_quality/impl/data/driver/SleepQualityDriverFactory.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.sleep_quality.impl.data.driver 2 | 3 | import app.cash.sqldelight.db.SqlDriver 4 | 5 | expect class SleepQualityDriverFactory { 6 | fun createDriver(): SqlDriver 7 | } 8 | -------------------------------------------------------------------------------- /feature/stress-level/api/src/commonMain/kotlin/com/joohnq/stress_level/api/entity/DStressorProperties.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.stress_level.api.entity 2 | 3 | import com.joohnq.stress_level.api.property.StressorProperties 4 | 5 | data class DStressorProperties( 6 | override val id: Long, 7 | ) : StressorProperties 8 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.3-bin.zip 4 | networkTimeout=10000 5 | validateDistributionUrl=true 6 | zipStoreBase=GRADLE_USER_HOME 7 | zipStorePath=wrapper/dists 8 | -------------------------------------------------------------------------------- /core/domain/src/commonMain/kotlin/com/joohnq/api/FilterBy.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.api 2 | 3 | fun Map>.filterBy(condition: (S) -> Boolean): Map> = 4 | mapValues { (_, list) -> list.filterNot { item -> condition(item) } } 5 | .filterValues { itemFilter -> itemFilter.isNotEmpty() } 6 | -------------------------------------------------------------------------------- /shared-resources/src/commonMain/kotlin/com/joohnq/shared_resources/remember/RememberPainter.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.shared_resources.remember 2 | 3 | import androidx.compose.runtime.Composable 4 | import androidx.compose.ui.graphics.painter.Painter 5 | 6 | @Composable 7 | expect fun rememberPainter(data: String?): Painter 8 | -------------------------------------------------------------------------------- /core/ui/src/commonMain/kotlin/com/joohnq/ui/UnidirectionalViewModelWithoutState.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.ui 2 | 3 | import kotlinx.coroutines.flow.SharedFlow 4 | 5 | interface UnidirectionalViewModelWithoutState { 6 | val sideEffect: SharedFlow 7 | 8 | fun onIntent(intent: INTENT) 9 | } 10 | -------------------------------------------------------------------------------- /feature/security/impl/src/commonMain/kotlin/com/joohnq/security/impl/ui/SecurityAuthentication.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.security.impl.ui 2 | 3 | import androidx.compose.runtime.Composable 4 | import com.joohnq.security.api.SecurityAuthentication 5 | 6 | @Composable 7 | expect fun securityAuthentication(): SecurityAuthentication 8 | -------------------------------------------------------------------------------- /feature/user/api/src/commonMain/kotlin/com/joohnq/api/entity/DMedicationsSupplementsProperties.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.api.entity 2 | 3 | import com.joohnq.api.property.MedicationsSupplementsProperties 4 | 5 | data class DMedicationsSupplementsProperties( 6 | override val id: Long, 7 | ) : MedicationsSupplementsProperties 8 | -------------------------------------------------------------------------------- /composeApp/src/androidMain/res/mipmap-anydpi-v26/ic_launcher.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /feature/user/api/src/commonMain/kotlin/com/joohnq/api/entity/DProfessionalHelpProperties.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.api.entity 2 | 3 | import com.joohnq.api.property.ProfessionalHelpProperties 4 | 5 | data class DProfessionalHelpProperties( 6 | override val id: Long, 7 | override val value: Boolean, 8 | ) : ProfessionalHelpProperties 9 | -------------------------------------------------------------------------------- /iosApp/iosApp/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "filename" : "Group 6.png", 5 | "idiom" : "universal", 6 | "platform" : "ios", 7 | "size" : "1024x1024" 8 | } 9 | ], 10 | "info" : { 11 | "author" : "xcode", 12 | "version" : 1 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /composeApp/src/androidMain/res/mipmap-anydpi-v26/ic_launcher_round.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /core/domain/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | id("moodly.android.library") 3 | id("moodly.multiplatform.library") 4 | 5 | alias(libs.plugins.serialization) 6 | } 7 | 8 | kotlin { 9 | sourceSets { 10 | commonMain.dependencies { 11 | implementation(libs.kotlin.datetime) 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /core/permission/src/androidMain/res/xml/provider_paths.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 7 | 10 | 11 | -------------------------------------------------------------------------------- /feature/stress-level/api/src/commonMain/kotlin/com/joohnq/stress_level/api/entity/StressLevelPalette.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.stress_level.api.entity 2 | 3 | import androidx.compose.ui.graphics.Color 4 | 5 | data class StressLevelPalette( 6 | val color: Color, 7 | val backgroundColor: Color, 8 | val imageColor: Color, 9 | ) 10 | -------------------------------------------------------------------------------- /feature/welcome/impl/src/commonMain/kotlin/com/joohnq/welcome/impl/ui/presentation/first/FirstScreen.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.welcome.impl.ui.presentation.first 2 | 3 | import androidx.compose.runtime.Composable 4 | 5 | @Composable 6 | fun FirstScreen(onNext: () -> Unit) { 7 | FirstContent( 8 | onNext = onNext 9 | ) 10 | } 11 | -------------------------------------------------------------------------------- /feature/sleep-quality/api/src/commonMain/kotlin/com/joohnq/sleep_quality/api/entity/DSleepInfluencesProperties.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.sleep_quality.api.entity 2 | 3 | import com.joohnq.sleep_quality.api.property.SleepInfluencesProperties 4 | 5 | data class DSleepInfluencesProperties( 6 | override val id: Long, 7 | ) : SleepInfluencesProperties 8 | -------------------------------------------------------------------------------- /core/domain/src/commonMain/kotlin/com/joohnq/api/mapper/YearMapper.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.api.mapper 2 | 3 | import com.joohnq.api.entity.Year 4 | 5 | object YearMapper { 6 | fun Year.isYearLeap(): Boolean = (this % 4 == 0 && this % 100 != 0) || (this % 400 == 0) 7 | 8 | fun Year.getTotalDays(): Int = if (isYearLeap()) 366 else 365 9 | } 10 | -------------------------------------------------------------------------------- /core/ui/src/commonMain/kotlin/com/joohnq/ui/entity/CalendarInfo.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.ui.entity 2 | 3 | import androidx.compose.ui.graphics.Color 4 | import org.jetbrains.compose.resources.StringResource 5 | 6 | data class CalendarInfo( 7 | val borderColor: Color, 8 | val backgroundColor: Color, 9 | val text: StringResource, 10 | ) 11 | -------------------------------------------------------------------------------- /feature/mood/api/src/commonMain/kotlin/com/joohnq/mood/api/entity/MoodAverage.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.mood.api.entity 2 | 3 | sealed interface MoodAverage { 4 | data object Positive : MoodAverage 5 | 6 | data object Neutral : MoodAverage 7 | 8 | data object Negative : MoodAverage 9 | 10 | data object Skipped : MoodAverage 11 | } 12 | -------------------------------------------------------------------------------- /feature/stress-level/api/src/commonMain/kotlin/com/joohnq/stress_level/api/entity/DStressLevelProperties.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.stress_level.api.entity 2 | 3 | import com.joohnq.stress_level.api.property.StressLevelProperties 4 | 5 | data class DStressLevelProperties( 6 | override val id: Long, 7 | override val level: Int, 8 | ) : StressLevelProperties 9 | -------------------------------------------------------------------------------- /shared-resources/src/androidDebug/kotlin/com/joohnq/shared_resources/components/AppSnackBarPreview.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.shared_resources.components 2 | 3 | import androidx.compose.runtime.Composable 4 | import org.jetbrains.compose.ui.tooling.preview.Preview 5 | 6 | @Preview 7 | @Composable 8 | private fun Preview() { 9 | AppSnackBar() 10 | } 11 | -------------------------------------------------------------------------------- /shared-resources/src/androidDebug/kotlin/com/joohnq/shared_resources/components/view/EmptyViewPreview.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.shared_resources.components.view 2 | 3 | import androidx.compose.runtime.Composable 4 | import org.jetbrains.compose.ui.tooling.preview.Preview 5 | 6 | @Preview 7 | @Composable 8 | private fun Preview() { 9 | EmptyView() 10 | } 11 | -------------------------------------------------------------------------------- /feature/sleep-quality/api/src/commonMain/kotlin/com/joohnq/sleep_quality/api/entity/DSleepQualityProperties.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.sleep_quality.api.entity 2 | 3 | import com.joohnq.sleep_quality.api.property.SleepQualityProperties 4 | 5 | data class DSleepQualityProperties( 6 | override val id: Long, 7 | override val level: Int, 8 | ) : SleepQualityProperties 9 | -------------------------------------------------------------------------------- /shared-resources/src/androidDebug/kotlin/com/joohnq/shared_resources/components/view/LoadingViewPreview.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.shared_resources.components.view 2 | 3 | import androidx.compose.runtime.Composable 4 | import org.jetbrains.compose.ui.tooling.preview.Preview 5 | 6 | @Preview 7 | @Composable 8 | private fun Preview() { 9 | LoadingView() 10 | } 11 | -------------------------------------------------------------------------------- /core/ui/src/commonMain/kotlin/com/joohnq/ui/entity/Assets.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.ui.entity 2 | 3 | import androidx.compose.ui.graphics.vector.ImageVector 4 | import org.jetbrains.compose.resources.DrawableResource 5 | 6 | data class Assets( 7 | val imageVector: ImageVector, 8 | val icon: DrawableResource, 9 | val secondaryIcon: DrawableResource, 10 | ) 11 | -------------------------------------------------------------------------------- /shared-resources/src/androidDebug/kotlin/com/joohnq/shared_resources/components/LogoWithBackgroundPreview.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.shared_resources.components 2 | 3 | import androidx.compose.runtime.Composable 4 | import org.jetbrains.compose.ui.tooling.preview.Preview 5 | 6 | @Preview 7 | @Composable 8 | private fun Preview() { 9 | LogoWithBackground() 10 | } 11 | -------------------------------------------------------------------------------- /shared-resources/src/androidDebug/kotlin/com/joohnq/shared_resources/components/button/DeleteButtonPreview.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.shared_resources.components.button 2 | 3 | import androidx.compose.runtime.Composable 4 | import org.jetbrains.compose.ui.tooling.preview.Preview 5 | 6 | @Preview 7 | @Composable 8 | private fun Preview() { 9 | DeleteButton() 10 | } 11 | -------------------------------------------------------------------------------- /shared-resources/src/commonMain/composeResources/drawable/ic_add_outlined.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /core/permission/src/commonMain/kotlin/com/joohnq/permission/CameraManager.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.permission 2 | 3 | import androidx.compose.runtime.Composable 4 | 5 | @Composable 6 | expect fun rememberCameraManager(onResult: (SharedImage?) -> Unit): CameraManager 7 | 8 | expect class CameraManager( 9 | onLaunch: () -> Unit, 10 | ) { 11 | fun launch() 12 | } 13 | -------------------------------------------------------------------------------- /core/permission/src/commonMain/kotlin/com/joohnq/permission/GalleryManager.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.permission 2 | 3 | import androidx.compose.runtime.Composable 4 | 5 | @Composable 6 | expect fun rememberGalleryManager(onResult: (SharedImage?) -> Unit): GalleryManager 7 | 8 | expect class GalleryManager( 9 | onLaunch: () -> Unit, 10 | ) { 11 | fun launch() 12 | } 13 | -------------------------------------------------------------------------------- /feature/freud-score/impl/src/commonMain/kotlin/com/joohnq/freud_score/impl/ui/entity/FreudScorePalette.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.freud_score.impl.ui.entity 2 | 3 | import androidx.compose.ui.graphics.Color 4 | 5 | data class FreudScorePalette( 6 | val color: Color, 7 | val subColor: Color, 8 | val backgroundColor: Color, 9 | val imageColor: Color, 10 | ) 11 | -------------------------------------------------------------------------------- /feature/security/impl/src/jvmMain/kotlin/com/joohnq/security/impl/ui/SecurityAuthentication.jvm.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.security.impl.ui 2 | 3 | import androidx.compose.runtime.Composable 4 | import com.joohnq.security.api.SecurityAuthentication 5 | import org.koin.compose.koinInject 6 | 7 | @Composable 8 | actual fun securityAuthentication(): SecurityAuthentication = koinInject() 9 | -------------------------------------------------------------------------------- /shared-resources/src/androidDebug/kotlin/com/joohnq/shared_resources/components/button/SmallAddButtonPreview.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.shared_resources.components.button 2 | 3 | import androidx.compose.runtime.Composable 4 | import org.jetbrains.compose.ui.tooling.preview.Preview 5 | 6 | @Preview 7 | @Composable 8 | private fun Preview() { 9 | SmallAddButton() 10 | } 11 | -------------------------------------------------------------------------------- /feature/security/impl/src/nativeMain/kotlin/com/joohnq/security/impl/ui/SecurityAuthentication.native.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.security.impl.ui 2 | 3 | import androidx.compose.runtime.Composable 4 | import com.joohnq.security.api.SecurityAuthentication 5 | import org.koin.compose.koinInject 6 | 7 | @Composable 8 | actual fun securityAuthentication(): SecurityAuthentication = koinInject() 9 | -------------------------------------------------------------------------------- /feature/user/api/src/commonMain/kotlin/com/joohnq/api/validator/UserNameValidator.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.api.validator 2 | 3 | import com.joohnq.api.exception.UserNameException 4 | 5 | object UserNameValidator { 6 | operator fun invoke(name: String): Boolean { 7 | if (name.trim().isEmpty()) throw UserNameException.EmptyName 8 | return true 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /shared-resources/src/androidDebug/kotlin/com/joohnq/shared_resources/components/button/AppDarkBackButtonPreview.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.shared_resources.components.button 2 | 3 | import androidx.compose.runtime.Composable 4 | import org.jetbrains.compose.ui.tooling.preview.Preview 5 | 6 | @Preview 7 | @Composable 8 | private fun Preview() { 9 | AppDarkBackButton() 10 | } 11 | -------------------------------------------------------------------------------- /shared-resources/src/androidDebug/kotlin/com/joohnq/shared_resources/components/button/AppLightBackButtonPreview.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.shared_resources.components.button 2 | 3 | import androidx.compose.runtime.Composable 4 | import org.jetbrains.compose.ui.tooling.preview.Preview 5 | 6 | @Preview 7 | @Composable 8 | private fun Preview() { 9 | AppLightBackButton() 10 | } 11 | -------------------------------------------------------------------------------- /feature/mood/impl/src/commonMain/sqldelight/com/joohnq/mood/database/MoodRecord.sq: -------------------------------------------------------------------------------- 1 | CREATE TABLE IF NOT EXISTS MoodRecord ( 2 | id INTEGER PRIMARY KEY NOT NULL, 3 | mood INTEGER NOT NULL, 4 | description TEXT NOT NULL, 5 | createdAt TEXT DEFAULT (datetime('now')) NOT NULL UNIQUE 6 | ); 7 | 8 | getMoodRecords: 9 | SELECT * FROM MoodRecord ORDER BY createdAt DESC; 10 | -------------------------------------------------------------------------------- /feature/mood/api/src/commonMain/kotlin/com/joohnq/mood/api/entity/MoodRecord.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.mood.api.entity 2 | 3 | import com.joohnq.api.getNow 4 | import kotlinx.datetime.LocalDateTime 5 | 6 | data class MoodRecord( 7 | val id: Long = -1, 8 | val mood: Mood = Mood.Neutral, 9 | val description: String = "", 10 | val createdAt: LocalDateTime = getNow(), 11 | ) 12 | -------------------------------------------------------------------------------- /feature/security/impl/src/androidDebug/kotlin/com/joohnq/security/impl/ui/presentation/security/SecurityContentPreview.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.security.impl.ui.presentation.security 2 | 3 | import androidx.compose.runtime.Composable 4 | import org.jetbrains.compose.ui.tooling.preview.Preview 5 | 6 | @Preview 7 | @Composable 8 | private fun Preview() { 9 | SecurityContent() 10 | } 11 | -------------------------------------------------------------------------------- /core/datastore/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | id("moodly.android.library") 3 | id("moodly.multiplatform.library") 4 | 5 | alias(libs.plugins.serialization) 6 | } 7 | 8 | kotlin { 9 | sourceSets { 10 | commonMain.dependencies { 11 | implementation(libs.bundles.dataStore) 12 | implementation(libs.bundles.koin) 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /core/domain/src/commonMain/kotlin/com/joohnq/api/mapper/FloatMapper.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.api.mapper 2 | 3 | import com.joohnq.api.mapper.DoubleMapper.toDegrees 4 | import com.joohnq.api.mapper.DoubleMapper.toRadians 5 | 6 | object FloatMapper { 7 | fun Float.toRadians(): Double = this.toDouble().toRadians() 8 | 9 | fun Float.toDegrees(): Double = this.toDouble().toDegrees() 10 | } 11 | -------------------------------------------------------------------------------- /core/ui/src/commonMain/kotlin/com/joohnq/ui/DisposableEffect.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.ui 2 | 3 | import androidx.compose.runtime.Composable 4 | import androidx.compose.runtime.DisposableEffect 5 | 6 | @Composable 7 | fun DisposableEffect( 8 | onDispose: () -> Unit, 9 | ) { 10 | DisposableEffect(Unit) { 11 | onDispose { 12 | onDispose() 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /feature/preferences/api/src/commonMain/kotlin/com/joohnq/preferences/api/entity/AppPreferences.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.preferences.api.entity 2 | 3 | data class AppPreferences( 4 | val skipWelcome: Boolean = false, 5 | val skipOnboarding: Boolean = false, 6 | val skipAuth: Boolean = false, 7 | val skipSecurity: Boolean = false, 8 | val skipSqlMigration: Boolean = false, 9 | ) 10 | -------------------------------------------------------------------------------- /feature/sleep-quality/impl/src/commonMain/kotlin/com/joohnq/sleep_quality/impl/ui/entity/SleepQualityPalette.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.sleep_quality.impl.ui.entity 2 | 3 | import androidx.compose.ui.graphics.Color 4 | 5 | data class SleepQualityPalette( 6 | val secondaryBackgroundColor: Color, 7 | val backgroundColor: Color, 8 | val color: Color, 9 | val imageColor: Color, 10 | ) 11 | -------------------------------------------------------------------------------- /shared-resources/src/commonMain/kotlin/com/joohnq/shared_resources/remember/RememberGetNow.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.shared_resources.remember 2 | 3 | import androidx.compose.runtime.Composable 4 | import androidx.compose.runtime.remember 5 | import com.joohnq.api.getNow 6 | import kotlinx.datetime.LocalDateTime 7 | 8 | @Composable 9 | fun rememberGetNow(): LocalDateTime = remember { getNow() } 10 | -------------------------------------------------------------------------------- /shared-resources/src/commonMain/kotlin/com/joohnq/shared_resources/remember/RememberSnackBarHostState.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.shared_resources.remember 2 | 3 | import androidx.compose.material3.SnackbarHostState 4 | import androidx.compose.runtime.Composable 5 | import androidx.compose.runtime.remember 6 | 7 | @Composable fun rememberSnackBarState(): SnackbarHostState = remember { SnackbarHostState() } 8 | -------------------------------------------------------------------------------- /feature/sleep-quality/api/src/commonMain/kotlin/com/joohnq/sleep_quality/api/exception/SleepQualityException.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.sleep_quality.api.exception 2 | 3 | sealed class SleepQualityException( 4 | override val message: String, 5 | ) : Exception(message) { 6 | data object AlreadyBeenAddedToday : 7 | SleepQualityException("A sleep quality record has already been added for today.") 8 | } 9 | -------------------------------------------------------------------------------- /feature/mood/api/src/commonMain/kotlin/com/joohnq/mood/api/repository/MoodRepository.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.mood.api.repository 2 | 3 | import com.joohnq.mood.api.entity.MoodRecord 4 | import kotlinx.coroutines.flow.Flow 5 | 6 | interface MoodRepository { 7 | fun observe(): Flow> 8 | 9 | suspend fun add(record: MoodRecord) 10 | 11 | suspend fun deleteById(id: Long) 12 | } 13 | -------------------------------------------------------------------------------- /feature/user/api/src/commonMain/kotlin/com/joohnq/api/use_case/GetUserUseCase.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.api.use_case 2 | 3 | import com.joohnq.api.entity.User 4 | import com.joohnq.api.repository.UserRepository 5 | import kotlinx.coroutines.flow.Flow 6 | 7 | class GetUserUseCase( 8 | private val repository: UserRepository, 9 | ) { 10 | operator fun invoke(): Flow = repository.observe() 11 | } 12 | -------------------------------------------------------------------------------- /shared-resources/src/androidMain/kotlin/com/joohnq/shared_resources/remember/RememberPainter.android.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.shared_resources.remember 2 | 3 | import androidx.compose.runtime.Composable 4 | import androidx.compose.ui.graphics.painter.Painter 5 | import coil3.compose.rememberAsyncImagePainter 6 | 7 | @Composable 8 | actual fun rememberPainter(data: String?): Painter = rememberAsyncImagePainter(data) 9 | -------------------------------------------------------------------------------- /feature/home/impl/src/androidDebug/kotlin/com/joohnq/home/impl/components/DashboardCentralPreview.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.home.impl.components 2 | 3 | import androidx.compose.runtime.Composable 4 | import com.joohnq.home.impl.ui.components.DashboardCentral 5 | import org.jetbrains.compose.ui.tooling.preview.Preview 6 | 7 | @Preview 8 | @Composable 9 | private fun Preview() { 10 | DashboardCentral() 11 | } 12 | -------------------------------------------------------------------------------- /feature/auth/impl/src/androidDebug/kotlin/com/joohnq/auth/impl/components/ImageSourcePickerPreview.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.auth.impl.components 2 | 3 | import androidx.compose.runtime.Composable 4 | import com.joohnq.auth.impl.ui.components.ImageSourcePicker 5 | import org.jetbrains.compose.ui.tooling.preview.Preview 6 | 7 | @Preview 8 | @Composable 9 | private fun Preview() { 10 | ImageSourcePicker() 11 | } 12 | -------------------------------------------------------------------------------- /feature/security/impl/src/commonMain/kotlin/com/joohnq/security/impl/data/SecurityAuthenticationImpl.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.security.impl.data 2 | 3 | import com.joohnq.security.api.SecurityAuthentication 4 | 5 | expect class SecurityAuthenticationImpl : SecurityAuthentication { 6 | override fun isDeviceHasBiometric(): Boolean 7 | 8 | override fun authenticateWithFace(callback: (Boolean) -> Unit) 9 | } 10 | -------------------------------------------------------------------------------- /shared-resources/src/androidDebug/kotlin/com/joohnq/shared_resources/components/view/ErrorViewPreview.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.shared_resources.components.view 2 | 3 | import androidx.compose.runtime.Composable 4 | import org.jetbrains.compose.ui.tooling.preview.Preview 5 | 6 | @Preview 7 | @Composable 8 | private fun Preview() { 9 | ErrorView( 10 | errorText = "Something went wrong" 11 | ) 12 | } 13 | -------------------------------------------------------------------------------- /core/domain/src/commonMain/kotlin/com/joohnq/api/GetNow.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.api 2 | 3 | import kotlinx.datetime.LocalDateTime 4 | import kotlinx.datetime.TimeZone 5 | import kotlinx.datetime.toLocalDateTime 6 | import kotlin.time.Clock 7 | import kotlin.time.ExperimentalTime 8 | 9 | @OptIn(ExperimentalTime::class) 10 | fun getNow(): LocalDateTime = Clock.System.now().toLocalDateTime(TimeZone.currentSystemDefault()) 11 | -------------------------------------------------------------------------------- /core/ui/src/commonMain/kotlin/com/joohnq/ui/entity/TextRadioButtonColors.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.ui.entity 2 | 3 | import androidx.compose.ui.graphics.Color 4 | 5 | data class TextRadioButtonColors( 6 | val selectedBackgroundColor: Color, 7 | val selectedContentColor: Color, 8 | val selectedBorderColor: Color, 9 | val unSelectedBackgroundColor: Color, 10 | val unSelectedContentColor: Color, 11 | ) 12 | -------------------------------------------------------------------------------- /feature/mood/impl/src/androidDebug/kotlin/com/joohnq/mood/impl/ui/components/MoodRouletteWheelPreview.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.mood.impl.ui.components 2 | 3 | import androidx.compose.runtime.Composable 4 | import com.joohnq.mood.add.ui.components.MoodRouletteWheel 5 | import org.jetbrains.compose.ui.tooling.preview.Preview 6 | 7 | @Preview 8 | @Composable 9 | private fun Preview() { 10 | MoodRouletteWheel() 11 | } 12 | -------------------------------------------------------------------------------- /feature/security/impl/src/androidDebug/kotlin/com/joohnq/security/impl/ui/presentation/security_confirmed/SecurityConfirmedContentPreview.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.security.impl.ui.presentation.security_confirmed 2 | 3 | import androidx.compose.runtime.Composable 4 | import org.jetbrains.compose.ui.tooling.preview.Preview 5 | 6 | @Preview 7 | @Composable 8 | private fun Preview() { 9 | SecurityConfirmedContent() 10 | } 11 | -------------------------------------------------------------------------------- /feature/stress-level/impl/src/commonMain/sqldelight/com/joohnq/stress_level/database/StressLevelRecord.sq: -------------------------------------------------------------------------------- 1 | CREATE TABLE IF NOT EXISTS StressLevelRecord ( 2 | id INTEGER PRIMARY KEY NOT NULL, 3 | stressLevel INTEGER NOT NULL, 4 | stressors TEXT NOT NULL, 5 | createdAt TEXT DEFAULT (datetime('now')) NOT NULL UNIQUE 6 | ); 7 | 8 | getStressLevels: 9 | SELECT * FROM StressLevelRecord ORDER BY createdAt DESC; 10 | -------------------------------------------------------------------------------- /shared-resources/src/jvmMain/kotlin/com/joohnq/shared_resources/remember/RememberPainter.jvm.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.shared_resources.remember 2 | 3 | import androidx.compose.runtime.Composable 4 | import androidx.compose.ui.graphics.painter.Painter 5 | import coil3.compose.rememberAsyncImagePainter 6 | 7 | @Composable 8 | actual fun rememberPainter(data: String?): Painter = rememberAsyncImagePainter(data?.replace("file://", "")) 9 | -------------------------------------------------------------------------------- /feature/security/impl/src/androidDebug/kotlin/com/joohnq/security/impl/ui/components/PinCodePreview.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.security.impl.ui.components 2 | 3 | import androidx.compose.runtime.Composable 4 | import org.jetbrains.compose.ui.tooling.preview.Preview 5 | 6 | @Preview 7 | @Composable 8 | private fun Preview() { 9 | PinCode( 10 | code = listOf(1, 2, 3, 4), 11 | focusedIndex = 1 12 | ) 13 | } 14 | -------------------------------------------------------------------------------- /shared-resources/src/nativeMain/kotlin/com/joohnq/shared_resources/remember/RememberPainter.native.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.shared_resources.remember 2 | 3 | import androidx.compose.runtime.Composable 4 | import androidx.compose.ui.graphics.painter.Painter 5 | import coil3.compose.rememberAsyncImagePainter 6 | 7 | @Composable 8 | actual fun rememberPainter(data: String?): Painter = rememberAsyncImagePainter(data?.replace("file://", "")) 9 | -------------------------------------------------------------------------------- /core/database/src/commonMain/kotlin/com/joohnq/database/LocalDateTimeConverter.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.database 2 | 3 | import androidx.room.TypeConverter 4 | import kotlinx.datetime.LocalDateTime 5 | 6 | object LocalDateTimeConverter { 7 | @TypeConverter 8 | fun from(value: String): LocalDateTime = LocalDateTime.parse(value) 9 | 10 | @TypeConverter 11 | fun to(date: LocalDateTime): String = date.toString() 12 | } 13 | -------------------------------------------------------------------------------- /feature/mood/impl/src/jvmMain/kotlin/com/joohnq/mood/add/di/StatsDriverFactoryModule.native.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.mood.add.di 2 | 3 | import com.joohnq.mood.add.data.driver.MoodDriverFactory 4 | import org.koin.core.module.Module 5 | import org.koin.core.module.dsl.singleOf 6 | import org.koin.dsl.module 7 | 8 | actual val moodDriverFactoryModule: Module = 9 | module { 10 | singleOf(::MoodDriverFactory) 11 | } 12 | -------------------------------------------------------------------------------- /feature/mood/impl/src/nativeMain/kotlin/com/joohnq/mood/add/di/StatsDriverFactoryModule.native.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.mood.add.di 2 | 3 | import com.joohnq.mood.add.data.driver.MoodDriverFactory 4 | import org.koin.core.module.Module 5 | import org.koin.core.module.dsl.singleOf 6 | import org.koin.dsl.module 7 | 8 | actual val moodDriverFactoryModule: Module = 9 | module { 10 | singleOf(::MoodDriverFactory) 11 | } 12 | -------------------------------------------------------------------------------- /feature/user/impl/src/jvmMain/kotlin/com/joohnq/user/impl/di/UserDriverFactoryModule.jvm.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.user.impl.di 2 | 3 | import com.joohnq.user.impl.data.driver.UserDriverFactory 4 | import org.koin.core.module.Module 5 | import org.koin.core.module.dsl.singleOf 6 | import org.koin.dsl.module 7 | 8 | actual val userDriverFactoryModule: Module = 9 | module { 10 | singleOf(::UserDriverFactory) 11 | } 12 | -------------------------------------------------------------------------------- /feature/mood/impl/src/androidMain/kotlin/com/joohnq/mood/add/di/MoodDriverFactoryModule.android.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.mood.add.di 2 | 3 | import com.joohnq.mood.add.data.driver.MoodDriverFactory 4 | import org.koin.core.module.Module 5 | import org.koin.core.module.dsl.singleOf 6 | import org.koin.dsl.module 7 | 8 | actual val moodDriverFactoryModule: Module = 9 | module { 10 | singleOf(::MoodDriverFactory) 11 | } 12 | -------------------------------------------------------------------------------- /feature/mood/overview/src/androidDebug/kotlin/com/joohnq/mood/overview/component/MoodOverviewMonthHeaderPreview.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.mood.overview.component 2 | 3 | import androidx.compose.runtime.Composable 4 | import com.joohnq.overview.component.MoodOverviewMonthHeader 5 | import org.jetbrains.compose.ui.tooling.preview.Preview 6 | 7 | @Preview 8 | @Composable 9 | private fun Preview() { 10 | MoodOverviewMonthHeader() 11 | } 12 | -------------------------------------------------------------------------------- /feature/user/impl/src/androidMain/kotlin/com/joohnq/user/impl/di/UserDriverFactoryModule.android.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.user.impl.di 2 | 3 | import com.joohnq.user.impl.data.driver.UserDriverFactory 4 | import org.koin.core.module.Module 5 | import org.koin.core.module.dsl.singleOf 6 | import org.koin.dsl.module 7 | 8 | actual val userDriverFactoryModule: Module = 9 | module { 10 | singleOf(::UserDriverFactory) 11 | } 12 | -------------------------------------------------------------------------------- /feature/user/impl/src/nativeMain/kotlin/com/joohnq/user/impl/di/UserDriverFactoryModule.native.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.user.impl.di 2 | 3 | import com.joohnq.user.impl.data.driver.UserDriverFactory 4 | import org.koin.core.module.Module 5 | import org.koin.core.module.dsl.singleOf 6 | import org.koin.dsl.module 7 | 8 | actual val userDriverFactoryModule: Module = 9 | module { 10 | singleOf(::UserDriverFactory) 11 | } 12 | -------------------------------------------------------------------------------- /feature/welcome/impl/src/androidDebug/kotlin/com/joohnq/welcome/impl/presentation/first/FirstContentPreview.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.welcome.impl.presentation.first 2 | 3 | import androidx.compose.runtime.Composable 4 | import com.joohnq.welcome.impl.ui.presentation.first.FirstContent 5 | import org.jetbrains.compose.ui.tooling.preview.Preview 6 | 7 | @Preview 8 | @Composable 9 | private fun Preview() { 10 | FirstContent() 11 | } 12 | -------------------------------------------------------------------------------- /composeApp/src/commonMain/kotlin/com/joohnq/moodapp/di/KoinInitializer.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.moodapp.di 2 | 3 | import org.koin.core.context.startKoin 4 | import org.koin.dsl.KoinAppDeclaration 5 | 6 | class KoinInitializer { 7 | fun init(config: KoinAppDeclaration? = null) = 8 | startKoin { 9 | modules( 10 | appModule 11 | ) 12 | config?.invoke(this) 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /core/database/src/jvmMain/kotlin/com/joohnq/database/di/AppDatabaseModule.jvm.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.database.di 2 | 3 | import com.joohnq.database.AppDatabase 4 | import com.joohnq.database.getDatabaseBuilder 5 | import org.koin.core.module.Module 6 | import org.koin.dsl.module 7 | 8 | actual val appDatabaseModule: Module = 9 | module { 10 | single { 11 | getDatabaseBuilder() 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /feature/splash/impl/src/androidDebug/kotlin/com/joohnq/splash/impl/presentation/splash/SplashScreenContentPreview.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.splash.impl.presentation.splash 2 | 3 | import androidx.compose.runtime.Composable 4 | import com.joohnq.splash.impl.ui.presentation.splash.SplashContent 5 | import org.jetbrains.compose.ui.tooling.preview.Preview 6 | 7 | @Preview 8 | @Composable 9 | private fun Preview() { 10 | SplashContent() 11 | } 12 | -------------------------------------------------------------------------------- /core/database/src/jvmMain/kotlin/com/joohnq/database/di/AppDatabaseDriverFactoryModule.jvm.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.database.di 2 | 3 | import com.joohnq.database.driver.AppDatabaseDriverFactory 4 | import org.koin.core.module.Module 5 | import org.koin.core.module.dsl.singleOf 6 | import org.koin.dsl.module 7 | 8 | actual val appDatabaseDriverFactoryModule: Module = 9 | module { 10 | singleOf(::AppDatabaseDriverFactory) 11 | } 12 | -------------------------------------------------------------------------------- /core/database/src/nativeMain/kotlin/com/joohnq/database/di/AppDatabaseModule.native.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.database.di 2 | 3 | import com.joohnq.database.AppDatabase 4 | import com.joohnq.database.getDatabaseBuilder 5 | import org.koin.core.module.Module 6 | import org.koin.dsl.module 7 | 8 | actual val appDatabaseModule: Module = 9 | module { 10 | single { 11 | getDatabaseBuilder() 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /core/navigation/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | id("moodly.android.library") 3 | id("moodly.multiplatform.library") 4 | 5 | alias(libs.plugins.serialization) 6 | } 7 | 8 | kotlin { 9 | sourceSets { 10 | commonMain.dependencies { 11 | implementation(libs.serialization) 12 | implementation(libs.compose.navigation) 13 | implementation(libs.kotlin.datetime) 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /feature/mood/add/src/commonMain/kotlin/com/joohnq/add/di/MoodAddModule.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.add.di 2 | 3 | import com.joohnq.add.presentation.AddMoodViewModel 4 | import org.koin.core.module.Module 5 | import org.koin.dsl.module 6 | 7 | val moodAddModule: Module = 8 | module { 9 | single { 10 | AddMoodViewModel( 11 | addMoodUseCase = get() 12 | ) 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /feature/mood/api/src/commonMain/kotlin/com/joohnq/mood/api/use_case/GetMoodsUseCase.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.mood.api.use_case 2 | 3 | import com.joohnq.mood.api.entity.MoodRecord 4 | import com.joohnq.mood.api.repository.MoodRepository 5 | import kotlinx.coroutines.flow.Flow 6 | 7 | class GetMoodsUseCase( 8 | private val repository: MoodRepository, 9 | ) { 10 | operator fun invoke(): Flow> = repository.observe() 11 | } 12 | -------------------------------------------------------------------------------- /shared-resources/src/androidDebug/kotlin/com/joohnq/shared_resources/components/parameter/BooleanParameterProvider.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.shared_resources.components.parameter 2 | 3 | import androidx.compose.ui.tooling.preview.PreviewParameterProvider 4 | 5 | class BooleanParameterProvider : PreviewParameterProvider { 6 | override val values = 7 | sequenceOf( 8 | true, 9 | false 10 | ) 11 | } 12 | -------------------------------------------------------------------------------- /shared-resources/src/commonMain/kotlin/com/joohnq/shared_resources/remember/RememberAvatars.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.shared_resources.remember 2 | 3 | import androidx.compose.runtime.Composable 4 | import androidx.compose.runtime.remember 5 | import com.joohnq.shared_resources.theme.Drawables 6 | import org.jetbrains.compose.resources.DrawableResource 7 | 8 | @Composable fun rememberAvatars(): List = remember { Drawables.Avatar.avatars } 9 | -------------------------------------------------------------------------------- /core/database/src/androidMain/kotlin/com/joohnq/database/di/AppDatabaseDriverFactoryModule.android.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.database.di 2 | 3 | import com.joohnq.database.driver.AppDatabaseDriverFactory 4 | import org.koin.core.module.Module 5 | import org.koin.core.module.dsl.singleOf 6 | import org.koin.dsl.module 7 | 8 | actual val appDatabaseDriverFactoryModule: Module = 9 | module { 10 | singleOf(::AppDatabaseDriverFactory) 11 | } 12 | -------------------------------------------------------------------------------- /core/database/src/nativeMain/kotlin/com/joohnq/database/di/AppDatabaseDriverFactoryModule.native.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.database.di 2 | 3 | import com.joohnq.database.driver.AppDatabaseDriverFactory 4 | import org.koin.core.module.Module 5 | import org.koin.core.module.dsl.singleOf 6 | import org.koin.dsl.module 7 | 8 | actual val appDatabaseDriverFactoryModule: Module = 9 | module { 10 | singleOf(::AppDatabaseDriverFactory) 11 | } 12 | -------------------------------------------------------------------------------- /feature/security/api/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | id("moodly.android.library") 3 | id("moodly.multiplatform.library") 4 | 5 | alias(libs.plugins.serialization) 6 | } 7 | 8 | kotlin { 9 | sourceSets { 10 | commonMain.dependencies { 11 | implementation(libs.serialization) 12 | implementation(libs.coroutines.core) 13 | 14 | implementation(libs.bundles.koin) 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /feature/self-journal/impl/src/commonMain/sqldelight/com/joohnq/self_journal/database/SelfJournalRecord.sq: -------------------------------------------------------------------------------- 1 | CREATE TABLE IF NOT EXISTS SelfJournalRecord ( 2 | id INTEGER PRIMARY KEY NOT NULL, 3 | mood INTEGER NOT NULL, 4 | title TEXT NOT NULL, 5 | description TEXT NOT NULL, 6 | createdAt TEXT DEFAULT (datetime('now')) NOT NULL UNIQUE 7 | ); 8 | 9 | getSelfJournalRecords: 10 | SELECT * FROM SelfJournalRecord ORDER BY createdAt DESC; 11 | -------------------------------------------------------------------------------- /feature/stress-level/api/src/commonMain/kotlin/com/joohnq/stress_level/api/entity/StressLevelRecord.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.stress_level.api.entity 2 | 3 | import com.joohnq.api.getNow 4 | import kotlinx.datetime.LocalDateTime 5 | 6 | data class StressLevelRecord( 7 | val id: Long = -1, 8 | val level: StressLevel = StressLevel.Three, 9 | val stressors: List = emptyList(), 10 | val createdAt: LocalDateTime = getNow(), 11 | ) 12 | -------------------------------------------------------------------------------- /shared-resources/src/androidDebug/kotlin/com/joohnq/shared_resources/components/input_field/ExpressionAnalysisTextFieldPreview.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.shared_resources.components.input_field 2 | 3 | import androidx.compose.runtime.Composable 4 | import org.jetbrains.compose.ui.tooling.preview.Preview 5 | 6 | @Preview 7 | @Composable 8 | private fun Preview() { 9 | ExpressionAnalysisTextField( 10 | text = "Description" 11 | ) 12 | } 13 | -------------------------------------------------------------------------------- /core/database/src/androidMain/kotlin/com/joohnq/database/di/AppDatabaseModule.android.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.database.di 2 | 3 | import com.joohnq.database.AppDatabase 4 | import com.joohnq.database.getDatabaseBuilder 5 | import org.koin.core.module.Module 6 | import org.koin.dsl.module 7 | 8 | actual val appDatabaseModule: Module = 9 | module { 10 | single { 11 | getDatabaseBuilder(get()) 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /core/database/src/jvmMain/kotlin/com/joohnq/database/SqliteException.jvm.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.database 2 | 3 | actual val sqliteExceptionMapper: SqliteExceptionMapper = DesktopSqliteExceptionMapper() 4 | 5 | private class DesktopSqliteExceptionMapper : SqliteExceptionMapper { 6 | override fun map(t: Throwable): SqliteException { 7 | val opResult = SqliteOperationResult.UNKNOWN 8 | return SqliteException(opResult, t) 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /core/datastore/src/jvmMain/kotlin/com/joohnq/datastore/di/DataStoreModule.jvm.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.datastore.di 2 | 3 | import com.joohnq.datastore.PreferencesDataStore 4 | import org.koin.core.module.Module 5 | import org.koin.core.module.dsl.singleOf 6 | import org.koin.dsl.module 7 | 8 | actual val dataStoreModule: Module = 9 | module { 10 | singleOf(::PreferencesDataStore) 11 | singleOf(PreferencesDataStore::init) 12 | } 13 | -------------------------------------------------------------------------------- /feature/gratefulness/api/src/commonMain/kotlin/com/joohnq/gratefulness/api/repository/GratefulnessRepository.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.gratefulness.api.repository 2 | 3 | import com.joohnq.gratefulness.api.entity.Gratefulness 4 | import kotlinx.coroutines.flow.Flow 5 | 6 | interface GratefulnessRepository { 7 | fun observe(): Flow> 8 | 9 | suspend fun add(item: Gratefulness) 10 | 11 | suspend fun deleteById(id: Long) 12 | } 13 | -------------------------------------------------------------------------------- /shared-resources/src/androidDebug/kotlin/com/joohnq/shared_resources/icons/MoodSadPreview.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.shared_resources.icons 2 | 3 | import androidx.compose.material3.Icon 4 | import androidx.compose.runtime.Composable 5 | import org.jetbrains.compose.ui.tooling.preview.Preview 6 | 7 | @Preview 8 | @Composable 9 | fun MoodSadPreview() { 10 | Icon( 11 | imageVector = MoodSad, 12 | contentDescription = null 13 | ) 14 | } 15 | -------------------------------------------------------------------------------- /composeApp/src/androidMain/kotlin/com/joohnq/moodapp/AndroidApp.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.moodapp 2 | 3 | import android.app.Application 4 | import com.joohnq.moodapp.di.KoinInitializer 5 | import org.koin.android.ext.koin.androidContext 6 | 7 | class AndroidApp : Application() { 8 | override fun onCreate() { 9 | super.onCreate() 10 | KoinInitializer().init { 11 | androidContext(this@AndroidApp) 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /core/datastore/src/androidMain/kotlin/com/joohnq/datastore/di/DataStoreModule.android.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.datastore.di 2 | 3 | import com.joohnq.datastore.PreferencesDataStore 4 | import org.koin.core.module.Module 5 | import org.koin.core.module.dsl.singleOf 6 | import org.koin.dsl.module 7 | 8 | actual val dataStoreModule: Module = 9 | module { 10 | singleOf(::PreferencesDataStore) 11 | singleOf(PreferencesDataStore::init) 12 | } 13 | -------------------------------------------------------------------------------- /core/datastore/src/nativeMain/kotlin/com/joohnq/datastore/di/DataStoreModule.native.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.datastore.di 2 | 3 | import com.joohnq.datastore.PreferencesDataStore 4 | import org.koin.core.module.Module 5 | import org.koin.core.module.dsl.singleOf 6 | import org.koin.dsl.module 7 | 8 | actual val dataStoreModule: Module = 9 | module { 10 | singleOf(::PreferencesDataStore) 11 | singleOf(PreferencesDataStore::init) 12 | } 13 | -------------------------------------------------------------------------------- /core/permission/src/commonMain/kotlin/com/joohnq/permission/PermissionsManager.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.permission 2 | 3 | import androidx.compose.runtime.Composable 4 | 5 | /* 6 | * Implement to handle specific permission in both platform 7 | * */ 8 | expect class PermissionsManager( 9 | callback: PermissionCallback, 10 | ) : PermissionHandler 11 | 12 | @Composable 13 | expect fun createPermissionsManager(callback: PermissionCallback): PermissionsManager 14 | -------------------------------------------------------------------------------- /shared-resources/src/androidDebug/kotlin/com/joohnq/shared_resources/icons/MoodHappyPreview.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.shared_resources.icons 2 | 3 | import androidx.compose.material3.Icon 4 | import androidx.compose.runtime.Composable 5 | import org.jetbrains.compose.ui.tooling.preview.Preview 6 | 7 | @Preview 8 | @Composable 9 | fun MoodHappyPreview() { 10 | Icon( 11 | imageVector = MoodHappy, 12 | contentDescription = null 13 | ) 14 | } 15 | -------------------------------------------------------------------------------- /core/storage/impl/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | id("moodly.android.library") 3 | id("moodly.multiplatform.library") 4 | } 5 | 6 | kotlin { 7 | sourceSets { 8 | commonMain.dependencies { 9 | implementation(projects.core.storage.api) 10 | 11 | implementation(projects.core.domain) 12 | 13 | implementation(libs.squareup.okio) 14 | implementation(libs.bundles.koin) 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /feature/gratefulness/api/src/commonMain/kotlin/com/joohnq/gratefulness/api/entity/Gratefulness.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.gratefulness.api.entity 2 | 3 | import com.joohnq.api.getNow 4 | import kotlinx.datetime.LocalDateTime 5 | 6 | data class Gratefulness( 7 | val id: Long = -1, 8 | val iAmGratefulFor: String = "", 9 | val smallThingIAppreciate: String = "", 10 | val description: String = "", 11 | val createdAt: LocalDateTime = getNow(), 12 | ) 13 | -------------------------------------------------------------------------------- /shared-resources/src/androidDebug/kotlin/com/joohnq/shared_resources/icons/MoodNeutralPreview.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.shared_resources.icons 2 | 3 | import androidx.compose.material3.Icon 4 | import androidx.compose.runtime.Composable 5 | import org.jetbrains.compose.ui.tooling.preview.Preview 6 | 7 | @Preview 8 | @Composable 9 | fun MoodNeutralPreview() { 10 | Icon( 11 | imageVector = MoodNeutral, 12 | contentDescription = null 13 | ) 14 | } 15 | -------------------------------------------------------------------------------- /feature/sleep-quality/api/src/commonMain/kotlin/com/joohnq/sleep_quality/api/repository/SleepQualityRepository.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.sleep_quality.api.repository 2 | 3 | import com.joohnq.sleep_quality.api.entity.SleepQualityRecord 4 | import kotlinx.coroutines.flow.Flow 5 | 6 | interface SleepQualityRepository { 7 | fun observe(): Flow> 8 | 9 | suspend fun add(record: SleepQualityRecord) 10 | 11 | suspend fun delete(id: Long) 12 | } 13 | -------------------------------------------------------------------------------- /feature/user/impl/src/commonMain/sqldelight/com/joohnq/user/database/User.sq: -------------------------------------------------------------------------------- 1 | CREATE TABLE IF NOT EXISTS User( 2 | id INTEGER PRIMARY KEY NOT NULL, 3 | name TEXT NOT NULL, 4 | image TEXT, 5 | imageType TEXT NOT NULL, 6 | medicationsSupplements INTEGER NOT NULL, 7 | soughtHelp INTEGER NOT NULL, 8 | physicalSymptoms INTEGER NOT NULL, 9 | dateCreated TEXT DEFAULT CURRENT_DATE NOT NULL 10 | ); 11 | 12 | getUser: 13 | SELECT * FROM User WHERE id = 1; -------------------------------------------------------------------------------- /shared-resources/src/androidDebug/kotlin/com/joohnq/shared_resources/icons/MoodDepressedPreview.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.shared_resources.icons 2 | 3 | import androidx.compose.material3.Icon 4 | import androidx.compose.runtime.Composable 5 | import org.jetbrains.compose.ui.tooling.preview.Preview 6 | 7 | @Preview 8 | @Composable 9 | fun MoodDepressedPreview() { 10 | Icon( 11 | imageVector = MoodDepressed, 12 | contentDescription = null 13 | ) 14 | } 15 | -------------------------------------------------------------------------------- /shared-resources/src/androidDebug/kotlin/com/joohnq/shared_resources/icons/MoodOverjoyedPreview.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.shared_resources.icons 2 | 3 | import androidx.compose.material3.Icon 4 | import androidx.compose.runtime.Composable 5 | import org.jetbrains.compose.ui.tooling.preview.Preview 6 | 7 | @Preview 8 | @Composable 9 | fun MoodOverjoyedPreview() { 10 | Icon( 11 | imageVector = MoodOverjoyed, 12 | contentDescription = null 13 | ) 14 | } 15 | -------------------------------------------------------------------------------- /feature/mood/add/src/androidDebug/kotlin/com/joohnq/mood/add/presentation/ExpressionAnalysisContentPreview.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.mood.add.presentation 2 | 3 | import androidx.compose.runtime.Composable 4 | import com.joohnq.add.presentation.ExpressionAnalysisContent 5 | import org.jetbrains.compose.ui.tooling.preview.Preview 6 | 7 | @Preview 8 | @Composable 9 | private fun Preview() { 10 | ExpressionAnalysisContent( 11 | description = "Description" 12 | ) 13 | } 14 | -------------------------------------------------------------------------------- /feature/mood/api/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | id("moodly.android.library") 3 | id("moodly.multiplatform.library") 4 | } 5 | 6 | kotlin { 7 | sourceSets { 8 | commonMain.dependencies { 9 | implementation(projects.core.domain) 10 | 11 | implementation(projects.feature.freudScore.api) 12 | 13 | implementation(libs.kotlin.datetime) 14 | 15 | implementation(libs.bundles.koin) 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /feature/security/impl/src/jvmMain/kotlin/com/joohnq/security/impl/data/SecurityAuthenticationImpl.jvm.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.security.impl.data 2 | 3 | import com.joohnq.security.api.SecurityAuthentication 4 | 5 | actual class SecurityAuthenticationImpl : SecurityAuthentication { 6 | actual override fun isDeviceHasBiometric(): Boolean = false 7 | 8 | actual override fun authenticateWithFace(callback: (Boolean) -> Unit) { 9 | callback(false) 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /feature/self-journal/impl/src/jvmMain/kotlin/com/joohnq/self_journal/impl/di/SelfJournalDriverFactoryModule.jvm.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.self_journal.impl.di 2 | 3 | import com.joohnq.self_journal.impl.data.driver.SelfJournalDriverFactory 4 | import org.koin.core.module.Module 5 | import org.koin.core.module.dsl.singleOf 6 | import org.koin.dsl.module 7 | 8 | actual val selfJournalDriverFactory: Module = 9 | module { 10 | singleOf(::SelfJournalDriverFactory) 11 | } 12 | -------------------------------------------------------------------------------- /feature/sleep-quality/impl/src/commonMain/kotlin/com/joohnq/sleep_quality/impl/ui/entity/SleepStatsItem.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.sleep_quality.impl.ui.entity 2 | 3 | import androidx.compose.runtime.Composable 4 | import org.jetbrains.compose.resources.DrawableResource 5 | import org.jetbrains.compose.resources.StringResource 6 | 7 | data class SleepStatsItem( 8 | val icon: DrawableResource, 9 | val title: StringResource, 10 | val content: @Composable () -> Unit, 11 | ) 12 | -------------------------------------------------------------------------------- /feature/stress-level/api/src/commonMain/kotlin/com/joohnq/stress_level/api/repository/StressLevelRepository.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.stress_level.api.repository 2 | 3 | import com.joohnq.stress_level.api.entity.StressLevelRecord 4 | import kotlinx.coroutines.flow.Flow 5 | 6 | interface StressLevelRepository { 7 | fun observe(): Flow> 8 | 9 | suspend fun add(stressLevelRecord: StressLevelRecord) 10 | 11 | suspend fun delete(id: Long) 12 | } 13 | -------------------------------------------------------------------------------- /shared-resources/src/commonMain/kotlin/com/joohnq/shared_resources/ResourceFiles.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.shared_resources 2 | 3 | import org.jetbrains.compose.resources.ExperimentalResourceApi 4 | 5 | object ResourceFiles { 6 | @OptIn(ExperimentalResourceApi::class) 7 | suspend fun charsets() = Res.readBytes(path = "files/charsets.json") 8 | 9 | @OptIn(ExperimentalResourceApi::class) 10 | suspend fun languages() = Res.readBytes(path = "files/languages.json") 11 | } 12 | -------------------------------------------------------------------------------- /core/storage/api/src/commonMain/kotlin/com/joohnq/storage/api/FileStorage.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.storage.api 2 | 3 | interface FileStorage { 4 | suspend fun saveImage( 5 | directory: String, 6 | fileName: String, 7 | data: ByteArray, 8 | ): String 9 | 10 | suspend fun readImage( 11 | directory: String, 12 | fileName: String, 13 | ): ByteArray? 14 | 15 | suspend fun deleteDatabase( 16 | fileName: String, 17 | ) 18 | } 19 | -------------------------------------------------------------------------------- /feature/self-journal/impl/src/androidMain/kotlin/com/joohnq/self_journal/impl/di/SelfJournalDriverFactoryModule.android.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.self_journal.impl.di 2 | 3 | import com.joohnq.self_journal.impl.data.driver.SelfJournalDriverFactory 4 | import org.koin.core.module.Module 5 | import org.koin.core.module.dsl.singleOf 6 | import org.koin.dsl.module 7 | 8 | actual val selfJournalDriverFactory: Module = 9 | module { 10 | singleOf(::SelfJournalDriverFactory) 11 | } 12 | -------------------------------------------------------------------------------- /feature/self-journal/impl/src/nativeMain/kotlin/com/joohnq/self_journal/impl/di/SelfJournalDriverFactoryModule.native.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.self_journal.impl.di 2 | 3 | import com.joohnq.self_journal.impl.data.driver.SelfJournalDriverFactory 4 | import org.koin.core.module.Module 5 | import org.koin.core.module.dsl.singleOf 6 | import org.koin.dsl.module 7 | 8 | actual val selfJournalDriverFactory: Module = 9 | module { 10 | singleOf(::SelfJournalDriverFactory) 11 | } 12 | -------------------------------------------------------------------------------- /feature/stress-level/impl/src/jvmMain/kotlin/com/joohnq/stress_level/impl/di/StressLevelDriverFactoryModule.jvm.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.stress_level.impl.di 2 | 3 | import com.joohnq.stress_level.impl.data.driver.StressLevelDriverFactory 4 | import org.koin.core.module.Module 5 | import org.koin.core.module.dsl.singleOf 6 | import org.koin.dsl.module 7 | 8 | actual val stressLevelDriverFactoryModule: Module = 9 | module { 10 | singleOf(::StressLevelDriverFactory) 11 | } 12 | -------------------------------------------------------------------------------- /shared-resources/src/androidDebug/kotlin/com/joohnq/shared_resources/components/text/TitlePreview.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.shared_resources.components.text 2 | 3 | import androidx.compose.runtime.Composable 4 | import com.joohnq.shared_resources.Res 5 | import com.joohnq.shared_resources.app_name 6 | import org.jetbrains.compose.ui.tooling.preview.Preview 7 | 8 | @Preview 9 | @Composable 10 | private fun Preview() { 11 | Title( 12 | text = Res.string.app_name 13 | ) 14 | } 15 | -------------------------------------------------------------------------------- /shared-resources/src/androidDebug/kotlin/com/joohnq/shared_resources/icons/RouletteTargetPreview.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.shared_resources.icons 2 | 3 | import androidx.compose.material3.Icon 4 | import androidx.compose.runtime.Composable 5 | import org.jetbrains.compose.ui.tooling.preview.Preview 6 | 7 | @Preview 8 | @Composable 9 | fun RouletteTargetPreview() { 10 | Icon( 11 | imageVector = RouletteTargetImageVector, 12 | contentDescription = null 13 | ) 14 | } 15 | -------------------------------------------------------------------------------- /core/permission/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | id("moodly.android.library") 3 | id("moodly.multiplatform.library") 4 | id("moodly.compose") 5 | } 6 | 7 | kotlin { 8 | sourceSets { 9 | androidMain.dependencies { 10 | implementation(libs.accompanist.permissions) 11 | implementation(libs.androidx.activity.compose) 12 | } 13 | commonMain.dependencies { 14 | implementation(libs.bundles.koin) 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /feature/sleep-quality/impl/src/jvmMain/kotlin/com/joohnq/sleep_quality/impl/di/SleepQualityDriverFactoryModule.jvm.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.sleep_quality.impl.di 2 | 3 | import com.joohnq.sleep_quality.impl.data.driver.SleepQualityDriverFactory 4 | import org.koin.core.module.Module 5 | import org.koin.core.module.dsl.singleOf 6 | import org.koin.dsl.module 7 | 8 | actual val sleepQualityDriverFactoryModule: Module = 9 | module { 10 | singleOf(::SleepQualityDriverFactory) 11 | } 12 | -------------------------------------------------------------------------------- /feature/stress-level/impl/src/androidMain/kotlin/com/joohnq/stress_level/impl/di/StressLevelDriverFactoryModule.android.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.stress_level.impl.di 2 | 3 | import com.joohnq.stress_level.impl.data.driver.StressLevelDriverFactory 4 | import org.koin.core.module.Module 5 | import org.koin.core.module.dsl.singleOf 6 | import org.koin.dsl.module 7 | 8 | actual val stressLevelDriverFactoryModule: Module = 9 | module { 10 | singleOf(::StressLevelDriverFactory) 11 | } 12 | -------------------------------------------------------------------------------- /feature/stress-level/impl/src/nativeMain/kotlin/com/joohnq/stress_level/impl/di/StressLevelDriverFactoryModule.native.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.stress_level.impl.di 2 | 3 | import com.joohnq.stress_level.impl.data.driver.StressLevelDriverFactory 4 | import org.koin.core.module.Module 5 | import org.koin.core.module.dsl.singleOf 6 | import org.koin.dsl.module 7 | 8 | actual val stressLevelDriverFactoryModule: Module = 9 | module { 10 | singleOf(::StressLevelDriverFactory) 11 | } 12 | -------------------------------------------------------------------------------- /gradle.properties: -------------------------------------------------------------------------------- 1 | kotlin.code.style=official 2 | #Gradle 3 | org.gradle.jvmargs=-Xmx4096M -Dfile.encoding=UTF-8 -Dkotlin.daemon.jvm.options\="-Xmx4096M" 4 | #Android 5 | android.nonTransitiveRClass=true 6 | android.useAndroidX=true 7 | #Kotlin Multiplatform 8 | kotlin.mpp.enableCInteropCommonization=true 9 | kotlin.native.disableCompilerDaemon=true 10 | kotlin.native.ignoreDisabledTargets=true 11 | org.gradle.caching=true 12 | org.gradle.dependency.resolution.cache=1 13 | kotlin.native.cacheKind=none -------------------------------------------------------------------------------- /feature/sleep-quality/impl/src/nativeMain/kotlin/com/joohnq/sleep_quality/impl/di/SleepQualityDriverFactoryModule.native.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.sleep_quality.impl.di 2 | 3 | import com.joohnq.sleep_quality.impl.data.driver.SleepQualityDriverFactory 4 | import org.koin.core.module.Module 5 | import org.koin.core.module.dsl.singleOf 6 | import org.koin.dsl.module 7 | 8 | actual val sleepQualityDriverFactoryModule: Module = 9 | module { 10 | singleOf(::SleepQualityDriverFactory) 11 | } 12 | -------------------------------------------------------------------------------- /shared-resources/src/androidDebug/kotlin/com/joohnq/shared_resources/components/text/MediumTitlePreview.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.shared_resources.components.text 2 | 3 | import androidx.compose.runtime.Composable 4 | import com.joohnq.shared_resources.Res 5 | import com.joohnq.shared_resources.app_name 6 | import org.jetbrains.compose.ui.tooling.preview.Preview 7 | 8 | @Preview 9 | @Composable 10 | private fun Preview() { 11 | MediumTitle( 12 | text = Res.string.app_name 13 | ) 14 | } 15 | -------------------------------------------------------------------------------- /shared-resources/src/commonMain/composeResources/drawable/ic_flag_outlined.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .kotlin 3 | .gradle 4 | **/build/ 5 | xcuserdata 6 | !src/**/build/ 7 | local.properties 8 | .idea 9 | .DS_Store 10 | captures 11 | .externalNativeBuild 12 | .cxx 13 | *.xcodeproj/* 14 | !*.xcodeproj/project.pbxproj 15 | !*.xcodeproj/xcshareddata/ 16 | !*.xcodeproj/project.xcworkspace/ 17 | !*.xcworkspace/contents.xcworkspacedata 18 | **/xcshareddata/WorkspaceSettings.xcsettings 19 | .fleet 20 | *.log 21 | google-services.json 22 | GoogleService-Info.plist 23 | release/ 24 | key/ 25 | -------------------------------------------------------------------------------- /feature/sleep-quality/impl/src/androidMain/kotlin/com/joohnq/sleep_quality/impl/di/SleepQualityDriverFactoryModule.android.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.sleep_quality.impl.di 2 | 3 | import com.joohnq.sleep_quality.impl.data.driver.SleepQualityDriverFactory 4 | import org.koin.core.module.Module 5 | import org.koin.core.module.dsl.singleOf 6 | import org.koin.dsl.module 7 | 8 | actual val sleepQualityDriverFactoryModule: Module = 9 | module { 10 | singleOf(::SleepQualityDriverFactory) 11 | } 12 | -------------------------------------------------------------------------------- /feature/sleep-quality/impl/src/commonMain/sqldelight/com/joohnq/sleep_quality/database/SleepQualityRecord.sq: -------------------------------------------------------------------------------- 1 | CREATE TABLE IF NOT EXISTS SleepQualityRecord ( 2 | id INTEGER PRIMARY KEY NOT NULL, 3 | sleepQuality INTEGER NOT NULL, 4 | startSleeping TEXT NOT NULL, 5 | endSleeping TEXT NOT NULL, 6 | sleepInfluences TEXT NOT NULL, 7 | createdAt TEXT DEFAULT CURRENT_DATE NOT NULL UNIQUE 8 | ); 9 | 10 | getSleepQualities: 11 | SELECT * FROM SleepQualityRecord ORDER BY createdAt DESC; 12 | -------------------------------------------------------------------------------- /shared-resources/src/androidDebug/kotlin/com/joohnq/shared_resources/components/text/SectionHeaderPreview.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.shared_resources.components.text 2 | 3 | import androidx.compose.runtime.Composable 4 | import com.joohnq.shared_resources.Res 5 | import com.joohnq.shared_resources.app_name 6 | import org.jetbrains.compose.ui.tooling.preview.Preview 7 | 8 | @Preview 9 | @Composable 10 | private fun Preview() { 11 | SectionHeader( 12 | title = Res.string.app_name 13 | ) 14 | } 15 | -------------------------------------------------------------------------------- /core/storage/impl/src/jvmMain/kotlin/com/joohnq/storage/impl/di/CoreStorageModule.jvm.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.storage.impl.di 2 | 3 | import com.joohnq.storage.api.FileStorage 4 | import com.joohnq.storage.impl.FileStorageImpl 5 | import org.koin.core.module.Module 6 | import org.koin.core.module.dsl.singleOf 7 | import org.koin.dsl.bind 8 | import org.koin.dsl.module 9 | 10 | actual val coreStorageModule: Module = 11 | module { 12 | singleOf(::FileStorageImpl) bind FileStorage::class 13 | } 14 | -------------------------------------------------------------------------------- /feature/stress-level/add/src/commonMain/kotlin/com/joohnq/stress_level/add/di/StressLevelAddModule.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.stress_level.add.di 2 | 3 | import com.joohnq.stress_level.add.presentation.AddStressLevelViewModel 4 | import org.koin.core.module.Module 5 | import org.koin.dsl.module 6 | 7 | val stressLevelAddModule: Module = 8 | module { 9 | single { 10 | AddStressLevelViewModel( 11 | addStressLevelUseCase = get() 12 | ) 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /shared-resources/src/androidDebug/kotlin/com/joohnq/shared_resources/components/button/PrimaryButtonPreview.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.shared_resources.components.button 2 | 3 | import androidx.compose.runtime.Composable 4 | import com.joohnq.shared_resources.Res 5 | import com.joohnq.shared_resources.app_name 6 | import org.jetbrains.compose.ui.tooling.preview.Preview 7 | 8 | @Preview 9 | @Composable 10 | private fun Preview() { 11 | PrimaryButton( 12 | text = Res.string.app_name 13 | ) 14 | } 15 | -------------------------------------------------------------------------------- /shared-resources/src/androidDebug/kotlin/com/joohnq/shared_resources/components/input_field/PinInputFieldPreview.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.shared_resources.components.input_field 2 | 3 | import androidx.compose.runtime.Composable 4 | import androidx.compose.ui.focus.FocusRequester 5 | import org.jetbrains.compose.ui.tooling.preview.Preview 6 | 7 | @Preview 8 | @Composable 9 | private fun Preview() { 10 | PinInputField( 11 | number = 1, 12 | focusRequester = FocusRequester() 13 | ) 14 | } 15 | -------------------------------------------------------------------------------- /shared-resources/src/commonMain/kotlin/com/joohnq/shared_resources/components/modifier/TakeIf.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.shared_resources.components.modifier 2 | 3 | import androidx.compose.runtime.Composable 4 | import androidx.compose.ui.Modifier 5 | 6 | @Composable 7 | fun Modifier.takeIf( 8 | condition: Boolean, 9 | thenModifier: Modifier.() -> Modifier, 10 | ): Modifier { 11 | val modifier = this 12 | return then( 13 | if (condition) thenModifier() else modifier 14 | ) 15 | } 16 | -------------------------------------------------------------------------------- /shared-resources/src/commonMain/kotlin/com/joohnq/shared_resources/components/spacer/HorizontalSpacer.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.shared_resources.components.spacer 2 | 3 | import androidx.compose.foundation.layout.Spacer 4 | import androidx.compose.foundation.layout.width 5 | import androidx.compose.runtime.Composable 6 | import androidx.compose.ui.Modifier 7 | import androidx.compose.ui.unit.Dp 8 | 9 | @Composable 10 | fun HorizontalSpacer(width: Dp) { 11 | Spacer(modifier = Modifier.width(width)) 12 | } 13 | -------------------------------------------------------------------------------- /shared-resources/src/commonMain/kotlin/com/joohnq/shared_resources/components/spacer/VerticalSpacer.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.shared_resources.components.spacer 2 | 3 | import androidx.compose.foundation.layout.Spacer 4 | import androidx.compose.foundation.layout.height 5 | import androidx.compose.runtime.Composable 6 | import androidx.compose.ui.Modifier 7 | import androidx.compose.ui.unit.Dp 8 | 9 | @Composable 10 | fun VerticalSpacer(height: Dp) { 11 | Spacer(modifier = Modifier.height(height)) 12 | } 13 | -------------------------------------------------------------------------------- /core/storage/impl/src/nativeMain/kotlin/com/joohnq/storage/impl/di/CoreStorageModule.native.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.storage.impl.di 2 | 3 | import com.joohnq.storage.api.FileStorage 4 | import com.joohnq.storage.impl.FileStorageImpl 5 | import org.koin.core.module.Module 6 | import org.koin.core.module.dsl.singleOf 7 | import org.koin.dsl.bind 8 | import org.koin.dsl.module 9 | 10 | actual val coreStorageModule: Module = 11 | module { 12 | singleOf(::FileStorageImpl) bind FileStorage::class 13 | } 14 | -------------------------------------------------------------------------------- /shared-resources/src/androidDebug/kotlin/com/joohnq/shared_resources/components/button/SecondaryButtonPreview.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.shared_resources.components.button 2 | 3 | import androidx.compose.runtime.Composable 4 | import com.joohnq.shared_resources.Res 5 | import com.joohnq.shared_resources.app_name 6 | import org.jetbrains.compose.ui.tooling.preview.Preview 7 | 8 | @Preview 9 | @Composable 10 | private fun Preview() { 11 | SecondaryButton( 12 | text = Res.string.app_name 13 | ) 14 | } 15 | -------------------------------------------------------------------------------- /core/storage/impl/src/androidMain/kotlin/com/joohnq/storage/impl/di/CoreStorageModule.android.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.storage.impl.di 2 | 3 | import com.joohnq.storage.api.FileStorage 4 | import com.joohnq.storage.impl.FileStorageImpl 5 | import org.koin.core.module.Module 6 | import org.koin.core.module.dsl.singleOf 7 | import org.koin.dsl.bind 8 | import org.koin.dsl.module 9 | 10 | actual val coreStorageModule: Module = 11 | module { 12 | singleOf(::FileStorageImpl) bind FileStorage::class 13 | } 14 | -------------------------------------------------------------------------------- /core/ui/src/androidMain/kotlin/com/joohnq/ui/mapper/ImageBitmapMapper.android.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.ui.mapper 2 | 3 | import androidx.compose.ui.graphics.ImageBitmap 4 | import androidx.compose.ui.graphics.asAndroidBitmap 5 | import com.joohnq.ui.entity.ImageFormat 6 | import java.io.ByteArrayOutputStream 7 | 8 | actual fun ImageBitmap.toByteArray(format: ImageFormat): ByteArray = 9 | ByteArrayOutputStream().use { 10 | asAndroidBitmap().compress(format, 100, it) 11 | it.toByteArray() 12 | } 13 | -------------------------------------------------------------------------------- /core/ui/src/commonMain/kotlin/com/joohnq/ui/entity/IconResource.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.ui.entity 2 | 3 | import androidx.compose.ui.Modifier 4 | import androidx.compose.ui.graphics.Color 5 | import org.jetbrains.compose.resources.DrawableResource 6 | import org.jetbrains.compose.resources.StringResource 7 | 8 | data class IconResource( 9 | val icon: DrawableResource, 10 | val tint: Color = Color.Unspecified, 11 | val modifier: Modifier = Modifier, 12 | val contentDescription: StringResource, 13 | ) 14 | -------------------------------------------------------------------------------- /feature/gratefulness/api/src/commonMain/kotlin/com/joohnq/gratefulness/api/use_case/GetGratefulnessUseCase.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.gratefulness.api.use_case 2 | 3 | import com.joohnq.gratefulness.api.entity.Gratefulness 4 | import com.joohnq.gratefulness.api.repository.GratefulnessRepository 5 | import kotlinx.coroutines.flow.Flow 6 | 7 | class GetGratefulnessUseCase( 8 | private val repository: GratefulnessRepository, 9 | ) { 10 | operator fun invoke(): Flow> = repository.observe() 11 | } 12 | -------------------------------------------------------------------------------- /feature/welcome/impl/src/androidDebug/kotlin/com/joohnq/welcome/impl/presentation/WelcomeParameterProvider.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.welcome.impl.presentation 2 | 3 | import org.jetbrains.compose.ui.tooling.preview.PreviewParameterProvider 4 | 5 | class WelcomeParameterProvider : PreviewParameterProvider { 6 | override val values = 7 | sequenceOf( 8 | 0, 9 | 1, 10 | 2, 11 | 3, 12 | 4, 13 | 5, 14 | 6 15 | ) 16 | } 17 | -------------------------------------------------------------------------------- /shared-resources/src/androidDebug/kotlin/com/joohnq/shared_resources/components/button/TextAndCheckButtonPreview.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.shared_resources.components.button 2 | 3 | import androidx.compose.runtime.Composable 4 | import com.joohnq.shared_resources.Res 5 | import com.joohnq.shared_resources.app_name 6 | import org.jetbrains.compose.ui.tooling.preview.Preview 7 | 8 | @Preview 9 | @Composable 10 | private fun Preview() { 11 | TextAndCheckButton( 12 | text = Res.string.app_name 13 | ) 14 | } 15 | -------------------------------------------------------------------------------- /shared-resources/src/commonMain/kotlin/com/joohnq/shared_resources/remember/RememberFocusRequester.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.shared_resources.remember 2 | 3 | import androidx.compose.runtime.Composable 4 | import androidx.compose.runtime.remember 5 | import androidx.compose.ui.focus.FocusRequester 6 | 7 | @Composable fun rememberFocusRequester(): FocusRequester = remember { FocusRequester() } 8 | 9 | @Composable fun rememberFocusRequester(count: Int): List = remember { List(count) { FocusRequester() } } 10 | -------------------------------------------------------------------------------- /composeApp/src/jvmMain/kotlin/com/joohnq/moodapp/Main.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.moodapp 2 | 3 | import androidx.compose.ui.window.Window 4 | import androidx.compose.ui.window.application 5 | import com.joohnq.moodapp.di.KoinInitializer 6 | 7 | fun main() { 8 | KoinInitializer().init() 9 | application { 10 | Window( 11 | onCloseRequest = ::exitApplication, 12 | alwaysOnTop = true, 13 | title = "Moodly" 14 | ) { 15 | App() 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /feature/home/impl/src/androidDebug/kotlin/com/joohnq/home/impl/components/DashboardBottomNavigationPreview.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.home.impl.components 2 | 3 | import androidx.compose.runtime.Composable 4 | import com.joohnq.home.impl.ui.components.DashboardBottomNavigation 5 | import org.jetbrains.compose.ui.tooling.preview.Preview 6 | 7 | @Preview 8 | @Composable 9 | private fun Preview() { 10 | DashboardBottomNavigation( 11 | isCurrentRoute = { true }, 12 | isCentralExpanded = false 13 | ) 14 | } 15 | -------------------------------------------------------------------------------- /feature/self-journal/api/src/commonMain/kotlin/com/joohnq/self_journal/api/use_case/GetSelfJournalsUseCase.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.self_journal.api.use_case 2 | 3 | import com.joohnq.self_journal.api.entity.SelfJournalRecord 4 | import com.joohnq.self_journal.api.repository.SelfJournalRepository 5 | import kotlinx.coroutines.flow.Flow 6 | 7 | class GetSelfJournalsUseCase( 8 | private val repository: SelfJournalRepository, 9 | ) { 10 | operator fun invoke(): Flow> = repository.observe() 11 | } 12 | -------------------------------------------------------------------------------- /shared-resources/src/androidDebug/kotlin/com/joohnq/shared_resources/components/dialog/AppTimePickerDialogPreview.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.shared_resources.components.dialog 2 | 3 | import androidx.compose.runtime.Composable 4 | import com.joohnq.shared_resources.Res 5 | import com.joohnq.shared_resources.app_name 6 | import org.jetbrains.compose.ui.tooling.preview.Preview 7 | 8 | @Preview 9 | @Composable 10 | private fun Preview() { 11 | AppTimePickerDialog( 12 | title = Res.string.app_name 13 | ) 14 | } 15 | -------------------------------------------------------------------------------- /feature/freud-score/impl/src/commonMain/kotlin/com/joohnq/freud_score/impl/di/FreudScoreImplModule.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.freud_score.impl.di 2 | 3 | import com.joohnq.freud_score.impl.ui.presentation.freud_score.FreudScoreViewModel 4 | import org.koin.core.module.Module 5 | import org.koin.dsl.module 6 | 7 | val freudScoreImplModule: Module = 8 | module { 9 | single { 10 | FreudScoreViewModel( 11 | getMoodsUseCase = get() 12 | ) 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /feature/mood/api/src/commonMain/kotlin/com/joohnq/mood/api/use_case/DeleteMoodUseCase.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.mood.api.use_case 2 | 3 | import com.joohnq.mood.api.repository.MoodRepository 4 | 5 | class DeleteMoodUseCase( 6 | private val repository: MoodRepository, 7 | ) { 8 | suspend operator fun invoke(id: Long): Result = 9 | try { 10 | repository.deleteById(id) 11 | Result.success(Unit) 12 | } catch (e: Exception) { 13 | Result.failure(e) 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /feature/self-journal/overview/src/androidDebug/kotlin/com/joohnq/self_journal/overview/component/SelfJournalOverviewCalendarContentFooterPreview.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.self_journal.overview.component 2 | 3 | import androidx.compose.runtime.Composable 4 | import com.joohnq.self_journal.presentation.components.SelfJournalOverviewCalendarContentFooter 5 | import org.jetbrains.compose.ui.tooling.preview.Preview 6 | 7 | @Preview 8 | @Composable 9 | private fun Preview() { 10 | SelfJournalOverviewCalendarContentFooter() 11 | } 12 | -------------------------------------------------------------------------------- /feature/stress-level/api/src/commonMain/kotlin/com/joohnq/stress_level/api/use_case/GetAllStressLevelUseCase.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.stress_level.api.use_case 2 | 3 | import com.joohnq.stress_level.api.entity.StressLevelRecord 4 | import com.joohnq.stress_level.api.repository.StressLevelRepository 5 | import kotlinx.coroutines.flow.Flow 6 | 7 | class GetAllStressLevelUseCase( 8 | private val repository: StressLevelRepository, 9 | ) { 10 | operator fun invoke(): Flow> = repository.observe() 11 | } 12 | -------------------------------------------------------------------------------- /core/permission/src/commonMain/kotlin/com/joohnq/permission/PermissionHandler.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.permission 2 | 3 | import androidx.compose.runtime.Composable 4 | 5 | /* 6 | * The interface to define a contract to handle permissions on android and ios 7 | * */ 8 | interface PermissionHandler { 9 | @Composable 10 | fun askPermission(permission: PermissionType) 11 | 12 | @Composable 13 | fun isPermissionGranted(permission: PermissionType): Boolean 14 | 15 | @Composable 16 | fun launchSettings() 17 | } 18 | -------------------------------------------------------------------------------- /feature/security/api/src/commonMain/kotlin/com/joohnq/security/api/di/SecurityApiModule.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.security.api.di 2 | 3 | import com.joohnq.security.api.use_case.GetSecurityUseCase 4 | import com.joohnq.security.api.use_case.UpdateSecurityUseCase 5 | import org.koin.core.module.Module 6 | import org.koin.core.module.dsl.factoryOf 7 | import org.koin.dsl.module 8 | 9 | val securityApiModule: Module = 10 | module { 11 | factoryOf(::GetSecurityUseCase) 12 | factoryOf(::UpdateSecurityUseCase) 13 | } 14 | -------------------------------------------------------------------------------- /feature/welcome/impl/src/commonMain/kotlin/com/joohnq/welcome/impl/di/WelcomImplModule.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.welcome.impl.di 2 | 3 | import com.joohnq.welcome.impl.ui.presentation.welcome.WelcomeViewModel 4 | import org.koin.core.module.Module 5 | import org.koin.core.module.dsl.viewModel 6 | import org.koin.dsl.module 7 | 8 | val welcomeImplModule: Module = 9 | module { 10 | viewModel { 11 | WelcomeViewModel( 12 | updateSkipWelcomeUseCase = get() 13 | ) 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /feature/sleep-quality/api/src/commonMain/kotlin/com/joohnq/sleep_quality/api/use_case/GetSleepQualitiesUseCase.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.sleep_quality.api.use_case 2 | 3 | import com.joohnq.sleep_quality.api.entity.SleepQualityRecord 4 | import com.joohnq.sleep_quality.api.repository.SleepQualityRepository 5 | import kotlinx.coroutines.flow.Flow 6 | 7 | class GetSleepQualitiesUseCase( 8 | private val repository: SleepQualityRepository, 9 | ) { 10 | operator fun invoke(): Flow> = repository.observe() 11 | } 12 | -------------------------------------------------------------------------------- /feature/user/api/src/commonMain/kotlin/com/joohnq/api/use_case/UpdateUserNameUseCase.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.api.use_case 2 | 3 | import com.joohnq.api.repository.UserRepository 4 | 5 | class UpdateUserNameUseCase( 6 | private val repository: UserRepository, 7 | ) { 8 | suspend operator fun invoke(name: String): Result = 9 | try { 10 | repository.updateUserName(name) 11 | 12 | Result.success(Unit) 13 | } catch (e: Exception) { 14 | Result.failure(e) 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /core/domain/src/commonMain/kotlin/com/joohnq/api/mapper/StringMapper.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.api.mapper 2 | 3 | import com.joohnq.api.entity.Time 4 | 5 | object StringMapper { 6 | fun String.isDigitsOnly(): Boolean = all { it.isDigit() } 7 | 8 | fun String.toTime(): Time { 9 | val parts = split(":") 10 | return Time(parts[0].toInt(), parts[1].toInt()) 11 | } 12 | 13 | fun String.capitalize(): String = replaceFirstChar { c -> c.uppercase() } 14 | 15 | fun String.toWordCount(): Int = split(" ").size 16 | } 17 | -------------------------------------------------------------------------------- /feature/mood/api/src/commonMain/kotlin/com/joohnq/mood/api/di/MoodApiModule.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.mood.api.di 2 | 3 | import com.joohnq.mood.api.use_case.AddMoodUseCase 4 | import com.joohnq.mood.api.use_case.DeleteMoodUseCase 5 | import com.joohnq.mood.api.use_case.GetMoodsUseCase 6 | import org.koin.core.module.dsl.factoryOf 7 | import org.koin.dsl.module 8 | 9 | val moodApiModule = 10 | module { 11 | factoryOf(::AddMoodUseCase) 12 | factoryOf(::DeleteMoodUseCase) 13 | factoryOf(::GetMoodsUseCase) 14 | } 15 | -------------------------------------------------------------------------------- /feature/self-journal/overview/src/androidDebug/kotlin/com/joohnq/self_journal/overview/component/SelfJournalOverviewCalendarContentMonthHeaderPreview.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.self_journal.overview.component 2 | 3 | import androidx.compose.runtime.Composable 4 | import com.joohnq.self_journal.presentation.components.SelfJournalOverviewCalendarContentMonthHeader 5 | import org.jetbrains.compose.ui.tooling.preview.Preview 6 | 7 | @Preview 8 | @Composable 9 | private fun Preview() { 10 | SelfJournalOverviewCalendarContentMonthHeader() 11 | } 12 | -------------------------------------------------------------------------------- /feature/user/api/src/commonMain/kotlin/com/joohnq/api/use_case/AddUserUseCase.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.api.use_case 2 | 3 | import com.joohnq.api.entity.User 4 | import com.joohnq.api.repository.UserRepository 5 | 6 | class AddUserUseCase( 7 | private val repository: UserRepository, 8 | ) { 9 | suspend operator fun invoke(user: User): Result = 10 | try { 11 | repository.add(user) 12 | Result.success(Unit) 13 | } catch (e: Exception) { 14 | Result.failure(e) 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /composeApp/src/androidMain/kotlin/com/joohnq/moodapp/MainActivity.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.moodapp 2 | 3 | import android.os.Bundle 4 | import androidx.activity.compose.setContent 5 | import androidx.activity.enableEdgeToEdge 6 | import androidx.appcompat.app.AppCompatActivity 7 | 8 | class MainActivity : AppCompatActivity() { 9 | override fun onCreate(savedInstanceState: Bundle?) { 10 | super.onCreate(savedInstanceState) 11 | enableEdgeToEdge() 12 | setContent { 13 | App() 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /core/datastore/src/androidMain/kotlin/com/joohnq/datastore/PreferencesDataStore.android.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.datastore 2 | 3 | import android.content.Context 4 | import androidx.datastore.core.DataStore 5 | import androidx.datastore.preferences.core.Preferences 6 | 7 | actual class PreferencesDataStore( 8 | private val context: Context, 9 | ) { 10 | actual fun init(): DataStore = 11 | createDataStore( 12 | producePath = { context.filesDir.resolve(DATASTORE_FILE_NAME).absolutePath } 13 | ) 14 | } 15 | -------------------------------------------------------------------------------- /feature/preferences/impl/src/commonMain/kotlin/com/joohnq/preferences/impl/di/PreferencesImplModule.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.preferences.impl.di 2 | 3 | import com.joohnq.preferences.api.repository.PreferencesRepository 4 | import com.joohnq.preferences.impl.data.repository.PreferencesRepositoryImpl 5 | import org.koin.core.module.dsl.singleOf 6 | import org.koin.dsl.bind 7 | import org.koin.dsl.module 8 | 9 | val preferencesImplModule = 10 | module { 11 | singleOf(::PreferencesRepositoryImpl) bind PreferencesRepository::class 12 | } 13 | -------------------------------------------------------------------------------- /feature/self-journal/add/src/commonMain/kotlin/com/joohnq/self_journal/di/SelfJournalAddModule.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.self_journal.di 2 | 3 | import com.joohnq.self_journal.presentation.AddSelfJournalViewModel 4 | import org.koin.core.module.Module 5 | import org.koin.core.module.dsl.viewModel 6 | import org.koin.dsl.module 7 | 8 | val selfJournalAddModule: Module = 9 | module { 10 | viewModel { 11 | AddSelfJournalViewModel( 12 | addSelfJournalsUseCase = get() 13 | ) 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /feature/self-journal/api/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | id("moodly.android.library") 3 | id("moodly.multiplatform.library") 4 | } 5 | 6 | kotlin { 7 | sourceSets { 8 | commonMain.dependencies { 9 | implementation(projects.core.domain) 10 | 11 | implementation(projects.feature.mood.api) 12 | 13 | implementation(projects.feature.freudScore.api) 14 | 15 | implementation(libs.kotlin.datetime) 16 | 17 | implementation(libs.bundles.koin) 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /feature/stress-level/overview/src/androidDebug/kotlin/com/joohnq/stress_level/impl/ui/component/TriggerIconPreview.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.stress_level.impl.ui.component 2 | 3 | import androidx.compose.runtime.Composable 4 | import com.joohnq.shared_resources.theme.Drawables 5 | import com.joohnq.stress_level.overview.component.TriggerIcon 6 | import org.jetbrains.compose.ui.tooling.preview.Preview 7 | 8 | @Preview 9 | @Composable 10 | private fun Preview() { 11 | TriggerIcon( 12 | icon = Drawables.Icons.Outlined.Logo 13 | ) 14 | } 15 | -------------------------------------------------------------------------------- /iosApp/iosApp/ContentView.swift: -------------------------------------------------------------------------------- 1 | import ComposeApp 2 | import SwiftUI 3 | import UIKit 4 | 5 | struct ComposeView: UIViewControllerRepresentable { 6 | func makeUIViewController(context: Context) -> UIViewController { 7 | MainViewControllerKt.MainViewController() 8 | } 9 | 10 | func updateUIViewController( 11 | _ uiViewController: UIViewController, context: Context 12 | ) {} 13 | } 14 | 15 | struct ContentView: View { 16 | var body: some View { 17 | ComposeView().ignoresSafeArea(edges: .all) 18 | } 19 | } -------------------------------------------------------------------------------- /core/permission/src/jvmMain/kotlin/com/joohnq/permission/CameraManager.jvm.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.permission 2 | 3 | import androidx.compose.runtime.Composable 4 | import androidx.compose.runtime.remember 5 | 6 | @Composable 7 | actual fun rememberCameraManager(onResult: (SharedImage?) -> Unit): CameraManager = 8 | remember { 9 | CameraManager { } 10 | } 11 | 12 | actual class CameraManager actual constructor( 13 | private val onLaunch: () -> Unit, 14 | ) { 15 | actual fun launch() { 16 | onLaunch() 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /feature/auth/impl/src/androidDebug/kotlin/com/joohnq/auth/impl/presentation/avatar/AvatarContentPreview.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.auth.impl.presentation.avatar 2 | 3 | import androidx.compose.runtime.Composable 4 | import com.joohnq.auth.impl.ui.presentation.avatar.AvatarContent 5 | import com.joohnq.auth.impl.ui.presentation.avatar.AvatarContract 6 | import org.jetbrains.compose.ui.tooling.preview.Preview 7 | 8 | @Preview 9 | @Composable 10 | private fun Preview() { 11 | AvatarContent( 12 | state = AvatarContract.State() 13 | ) 14 | } 15 | -------------------------------------------------------------------------------- /core/permission/src/jvmMain/kotlin/com/joohnq/permission/GalleryManager.jvm.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.permission 2 | 3 | import androidx.compose.runtime.Composable 4 | import androidx.compose.runtime.remember 5 | 6 | @Composable 7 | actual fun rememberGalleryManager(onResult: (SharedImage?) -> Unit): GalleryManager = 8 | remember { 9 | GalleryManager {} 10 | } 11 | 12 | actual class GalleryManager actual constructor( 13 | private val onLaunch: () -> Unit, 14 | ) { 15 | actual fun launch() { 16 | onLaunch() 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /feature/auth/impl/src/androidDebug/kotlin/com/joohnq/auth/impl/components/AvatarImagesHorizontalPagerPreview.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.auth.impl.components 2 | 3 | import androidx.compose.runtime.Composable 4 | import com.joohnq.auth.impl.ui.components.AvatarImagesHorizontalPager 5 | import com.joohnq.shared_resources.remember.rememberAvatars 6 | import org.jetbrains.compose.ui.tooling.preview.Preview 7 | 8 | @Preview 9 | @Composable 10 | private fun Preview() { 11 | AvatarImagesHorizontalPager( 12 | avatars = rememberAvatars() 13 | ) 14 | } 15 | -------------------------------------------------------------------------------- /feature/splash/impl/src/commonMain/kotlin/com/joohnq/splash/impl/di/SplashImplModule.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.splash.impl.di 2 | 3 | import com.joohnq.splash.impl.SqlMigration 4 | import com.joohnq.splash.impl.ui.presentation.splash.SplashViewModel 5 | import org.koin.core.module.Module 6 | import org.koin.core.module.dsl.singleOf 7 | import org.koin.core.module.dsl.viewModelOf 8 | import org.koin.dsl.module 9 | 10 | val splashImplModule: Module = 11 | module { 12 | singleOf(::SqlMigration) 13 | viewModelOf(::SplashViewModel) 14 | } 15 | -------------------------------------------------------------------------------- /feature/user/api/src/commonMain/kotlin/com/joohnq/api/use_case/UpdateUserUseCase.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.api.use_case 2 | 3 | import com.joohnq.api.entity.User 4 | import com.joohnq.api.repository.UserRepository 5 | 6 | class UpdateUserUseCase( 7 | private val repository: UserRepository, 8 | ) { 9 | suspend operator fun invoke(user: User): Result = 10 | try { 11 | repository.update(user) 12 | 13 | Result.success(Unit) 14 | } catch (e: Exception) { 15 | Result.failure(e) 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /shared-resources/src/androidDebug/kotlin/com/joohnq/shared_resources/components/image/ProfileImagePreview.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.shared_resources.components.image 2 | 3 | import androidx.compose.runtime.Composable 4 | import com.joohnq.shared_resources.theme.Drawables 5 | import org.jetbrains.compose.resources.painterResource 6 | import org.jetbrains.compose.ui.tooling.preview.Preview 7 | 8 | @Preview 9 | @Composable 10 | private fun Preview() { 11 | ProfileImage( 12 | painter = painterResource(Drawables.Icons.Outlined.Logo) 13 | ) 14 | } 15 | -------------------------------------------------------------------------------- /feature/gratefulness/add/src/commonMain/kotlin/com/joohnq/gratefulness/add/di/GratefulnessAddModule.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.gratefulness.add.di 2 | 3 | import com.joohnq.gratefulness.add.presentation.GratefulnessAddViewModel 4 | import org.koin.core.module.Module 5 | import org.koin.core.module.dsl.viewModel 6 | import org.koin.dsl.module 7 | 8 | val gratefulnessAddModule: Module = 9 | module { 10 | viewModel { 11 | GratefulnessAddViewModel( 12 | addGratefulnessUseCase = get() 13 | ) 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /feature/sleep-quality/add/src/commonMain/kotlin/com/joohnq/sleep_quality/add/di/SleepQualityAddModule.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.sleep_quality.add.di 2 | 3 | import com.joohnq.sleep_quality.add.presentation.AddSleepQualityViewModel 4 | import org.koin.core.module.Module 5 | import org.koin.core.module.dsl.viewModel 6 | import org.koin.dsl.module 7 | 8 | val sleepQualityAddModule: Module = 9 | module { 10 | viewModel { 11 | AddSleepQualityViewModel( 12 | addSleepQualityUseCase = get() 13 | ) 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /feature/user/api/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | id("moodly.android.library") 3 | id("moodly.multiplatform.library") 4 | 5 | alias(libs.plugins.mokkery) 6 | } 7 | 8 | kotlin { 9 | sourceSets { 10 | commonMain.dependencies { 11 | implementation(projects.core.domain) 12 | 13 | implementation(projects.core.storage.api) 14 | 15 | implementation(projects.core.ui) 16 | 17 | implementation(libs.kotlin.datetime) 18 | 19 | implementation(libs.bundles.koin) 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /core/datastore/src/jvmMain/kotlin/com/joohnq/datastore/PreferencesDataStore.jvm.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.datastore 2 | 3 | import androidx.datastore.core.DataStore 4 | import androidx.datastore.preferences.core.Preferences 5 | import java.io.File 6 | 7 | actual class PreferencesDataStore { 8 | actual fun init(): DataStore = 9 | createDataStore( 10 | producePath = { 11 | val file = File(System.getProperty("java.io.tmpdir"), DATASTORE_FILE_NAME) 12 | file.absolutePath 13 | } 14 | ) 15 | } 16 | -------------------------------------------------------------------------------- /core/storage/impl/src/commonMain/kotlin/com/joohnq/storage/impl/FileStorageImpl.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.storage.impl 2 | 3 | import com.joohnq.storage.api.FileStorage 4 | 5 | expect class FileStorageImpl : FileStorage { 6 | override suspend fun saveImage( 7 | directory: String, 8 | fileName: String, 9 | data: ByteArray, 10 | ): String 11 | 12 | override suspend fun readImage( 13 | directory: String, 14 | fileName: String, 15 | ): ByteArray? 16 | 17 | override suspend fun deleteDatabase(fileName: String) 18 | } 19 | -------------------------------------------------------------------------------- /feature/gratefulness/api/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | id("moodly.android.library") 3 | id("moodly.multiplatform.library") 4 | 5 | alias(libs.plugins.serialization) 6 | } 7 | 8 | kotlin { 9 | sourceSets { 10 | commonMain.dependencies { 11 | implementation(projects.core.domain) 12 | 13 | implementation(libs.kotlin.datetime) 14 | 15 | implementation(libs.bundles.koin) 16 | 17 | implementation(libs.room.runtime) 18 | implementation(libs.sqlite.bundled) 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /feature/mood/impl/src/androidDebug/kotlin/com/joohnq/mood/impl/ui/parameter/ListMoodRecordResourceParameterProvider.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.mood.impl.ui.parameter 2 | 3 | import androidx.compose.ui.tooling.preview.PreviewParameterProvider 4 | import com.joohnq.mood.add.ui.resource.MoodRecordResource 5 | 6 | class ListMoodRecordResourceParameterProvider : PreviewParameterProvider> { 7 | override val values = 8 | sequenceOf( 9 | MoodRecordResource.allMoodRecordResourcePreview, 10 | emptyList() 11 | ) 12 | } 13 | -------------------------------------------------------------------------------- /shared-resources/src/commonMain/composeResources/drawable/ic_arrow_open_outlined.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /feature/mood/api/src/commonMain/kotlin/com/joohnq/mood/api/use_case/AddMoodUseCase.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.mood.api.use_case 2 | 3 | import com.joohnq.mood.api.entity.MoodRecord 4 | import com.joohnq.mood.api.repository.MoodRepository 5 | 6 | class AddMoodUseCase( 7 | private val repository: MoodRepository, 8 | ) { 9 | suspend operator fun invoke(record: MoodRecord): Result = 10 | try { 11 | repository.add(record) 12 | Result.success(Unit) 13 | } catch (e: Exception) { 14 | Result.failure(e) 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /feature/mood/history/src/commonMain/kotlin/com/joohnq/history/di/MoodHistoryModule.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.history.di 2 | 3 | import com.joohnq.history.presentation.MoodHistoryViewModel 4 | import org.koin.core.module.Module 5 | import org.koin.core.module.dsl.viewModel 6 | import org.koin.dsl.module 7 | 8 | val moodHistoryModule: Module = 9 | module { 10 | viewModel { 11 | MoodHistoryViewModel( 12 | getMoodsUseCase = get(), 13 | deleteMoodUseCase = get() 14 | ) 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /feature/security/api/src/commonMain/kotlin/com/joohnq/security/api/SecurityResult.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.security.api 2 | 3 | sealed interface SecurityResult { 4 | data object HardwareUnavailable : SecurityResult 5 | 6 | data object FeatureUnavailable : SecurityResult 7 | 8 | data class AuthenticationError( 9 | val error: String, 10 | ) : SecurityResult 11 | 12 | data object AuthenticationFailed : SecurityResult 13 | 14 | data object AuthenticationSuccess : SecurityResult 15 | 16 | data object AuthenticationNotSet : SecurityResult 17 | } 18 | -------------------------------------------------------------------------------- /feature/sleep-quality/api/src/commonMain/kotlin/com/joohnq/sleep_quality/api/entity/SleepQualityRecord.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.sleep_quality.api.entity 2 | 3 | import com.joohnq.api.entity.Time 4 | import com.joohnq.api.getNow 5 | import kotlinx.datetime.LocalDate 6 | 7 | data class SleepQualityRecord( 8 | val id: Long = -1, 9 | val quality: SleepQuality = SleepQuality.Fair, 10 | val start: Time = Time(0, 0), 11 | val end: Time = Time(0, 0), 12 | val influences: List = emptyList(), 13 | val createdAt: LocalDate = getNow().date, 14 | ) 15 | -------------------------------------------------------------------------------- /feature/user/impl/src/androidDebug/kotlin/com/joohnq/user/impl/ui/parameter/ProfessionalHelpResourceParameterProvider.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.user.impl.ui.parameter 2 | 3 | import androidx.compose.ui.tooling.preview.PreviewParameterProvider 4 | import com.joohnq.user.impl.ui.resource.ProfessionalHelpResource 5 | 6 | class ProfessionalHelpResourceParameterProvider : PreviewParameterProvider { 7 | override val values = 8 | sequenceOf( 9 | ProfessionalHelpResource.No, 10 | ProfessionalHelpResource.Yes 11 | ) 12 | } 13 | -------------------------------------------------------------------------------- /core/ui/src/jvmMain/kotlin/com/joohnq/ui/mapper/ImageBitmapMapper.native.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.ui.mapper 2 | 3 | import androidx.compose.ui.graphics.ImageBitmap 4 | import androidx.compose.ui.graphics.asSkiaBitmap 5 | import com.joohnq.ui.entity.ImageFormat 6 | import org.jetbrains.skia.Image 7 | 8 | actual fun ImageBitmap.toByteArray(format: ImageFormat): ByteArray { 9 | val data = 10 | Image 11 | .makeFromBitmap(asSkiaBitmap()) 12 | .encodeToData(format) ?: error("This painter cannot be encoded to $format") 13 | 14 | return data.bytes 15 | } 16 | -------------------------------------------------------------------------------- /feature/mood/overview/src/commonMain/kotlin/com/joohnq/overview/di/MoodOverviewModule.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.overview.di 2 | 3 | import com.joohnq.overview.presentation.MoodOverviewViewModel 4 | import org.koin.core.module.Module 5 | import org.koin.core.module.dsl.viewModel 6 | import org.koin.dsl.module 7 | 8 | val moodOverviewModule: Module = 9 | module { 10 | viewModel { 11 | MoodOverviewViewModel( 12 | getMoodsUseCase = get(), 13 | deleteMoodUseCase = get() 14 | ) 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /feature/security/impl/src/jvmMain/kotlin/com/joohnq/security/impl/di/SecurityAuthenticationModule.jvm.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.security.impl.di 2 | 3 | import com.joohnq.security.api.SecurityAuthentication 4 | import com.joohnq.security.impl.data.SecurityAuthenticationImpl 5 | import org.koin.core.module.Module 6 | import org.koin.core.module.dsl.factoryOf 7 | import org.koin.dsl.bind 8 | import org.koin.dsl.module 9 | 10 | actual val securityAuthenticationModule: Module = 11 | module { 12 | factoryOf(::SecurityAuthenticationImpl) bind SecurityAuthentication::class 13 | } 14 | -------------------------------------------------------------------------------- /core/database/src/jvmMain/kotlin/com/joohnq/database/AppDatabase.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.database 2 | 3 | import androidx.room.Room 4 | import androidx.sqlite.driver.bundled.BundledSQLiteDriver 5 | import kotlinx.coroutines.Dispatchers 6 | import java.io.File 7 | 8 | fun getDatabaseBuilder(): AppDatabase { 9 | val dbFile = File(System.getProperty("java.io.tmpdir"), "app.db") 10 | return Room 11 | .databaseBuilder(dbFile.absolutePath) 12 | .setDriver(BundledSQLiteDriver()) 13 | .setQueryCoroutineContext(Dispatchers.IO) 14 | .build() 15 | } 16 | -------------------------------------------------------------------------------- /core/navigation/src/commonMain/kotlin/com/joohnq/navigation/NavigationGraph.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.navigation 2 | 3 | import kotlinx.serialization.Serializable 4 | 5 | sealed interface NavigationGraph { 6 | @Serializable data object Loading : NavigationGraph 7 | 8 | @Serializable data object Welcome : NavigationGraph 9 | 10 | @Serializable data object Onboarding : NavigationGraph 11 | 12 | @Serializable data object Auth : NavigationGraph 13 | 14 | @Serializable data object Security : NavigationGraph 15 | 16 | @Serializable data object App : NavigationGraph 17 | } 18 | -------------------------------------------------------------------------------- /core/ui/src/nativeMain/kotlin/com/joohnq/ui/mapper/ImageBitmapMapper.native.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.ui.mapper 2 | 3 | import androidx.compose.ui.graphics.ImageBitmap 4 | import androidx.compose.ui.graphics.asSkiaBitmap 5 | import com.joohnq.ui.entity.ImageFormat 6 | import org.jetbrains.skia.Image 7 | 8 | actual fun ImageBitmap.toByteArray(format: ImageFormat): ByteArray { 9 | val data = 10 | Image 11 | .makeFromBitmap(asSkiaBitmap()) 12 | .encodeToData(format) ?: error("This painter cannot be encoded to $format") 13 | 14 | return data.bytes 15 | } 16 | -------------------------------------------------------------------------------- /feature/gratefulness/api/src/commonMain/kotlin/com/joohnq/gratefulness/api/use_case/DeleteGratefulnessUseCase.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.gratefulness.api.use_case 2 | 3 | import com.joohnq.gratefulness.api.repository.GratefulnessRepository 4 | 5 | class DeleteGratefulnessUseCase( 6 | private val repository: GratefulnessRepository, 7 | ) { 8 | suspend operator fun invoke(id: Long): Result = 9 | try { 10 | repository.deleteById(id) 11 | Result.success(Unit) 12 | } catch (e: Exception) { 13 | Result.failure(e) 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /feature/preferences/api/src/commonMain/kotlin/com/joohnq/preferences/api/use_case/UpdateSkipAuthUseCase.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.preferences.api.use_case 2 | 3 | import com.joohnq.preferences.api.repository.PreferencesRepository 4 | 5 | class UpdateSkipAuthUseCase( 6 | private val repository: PreferencesRepository, 7 | ) { 8 | suspend operator fun invoke(value: Boolean): Result = 9 | try { 10 | repository.updateSkipAuth(value) 11 | Result.success(Unit) 12 | } catch (e: Exception) { 13 | Result.failure(e) 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /feature/security/impl/src/nativeMain/kotlin/com/joohnq/security/impl/di/SecurityAuthenticationModule.native.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.security.impl.di 2 | 3 | import com.joohnq.security.api.SecurityAuthentication 4 | import com.joohnq.security.impl.data.SecurityAuthenticationImpl 5 | import org.koin.core.module.Module 6 | import org.koin.core.module.dsl.factoryOf 7 | import org.koin.dsl.bind 8 | import org.koin.dsl.module 9 | 10 | actual val securityAuthenticationModule: Module = 11 | module { 12 | factoryOf(::SecurityAuthenticationImpl) bind SecurityAuthentication::class 13 | } 14 | -------------------------------------------------------------------------------- /feature/self-journal/api/src/commonMain/kotlin/com/joohnq/self_journal/api/repository/SelfJournalRepository.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.self_journal.api.repository 2 | 3 | import com.joohnq.self_journal.api.entity.SelfJournalRecord 4 | import kotlinx.coroutines.flow.Flow 5 | 6 | interface SelfJournalRepository { 7 | fun observe(): Flow> 8 | 9 | suspend fun getById(id: Long): SelfJournalRecord 10 | 11 | suspend fun add(record: SelfJournalRecord) 12 | 13 | suspend fun deleteById(id: Long) 14 | 15 | suspend fun update(record: SelfJournalRecord) 16 | } 17 | -------------------------------------------------------------------------------- /feature/sleep-quality/api/src/commonMain/kotlin/com/joohnq/sleep_quality/api/use_case/DeleteSleepQualityUseCase.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.sleep_quality.api.use_case 2 | 3 | import com.joohnq.sleep_quality.api.repository.SleepQualityRepository 4 | 5 | class DeleteSleepQualityUseCase( 6 | private val repository: SleepQualityRepository, 7 | ) { 8 | suspend operator fun invoke(id: Long): Result = 9 | try { 10 | repository.delete(id) 11 | Result.success(Unit) 12 | } catch (e: Exception) { 13 | Result.failure(e) 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /feature/stress-level/api/src/commonMain/kotlin/com/joohnq/stress_level/api/use_case/DeleteStressLevelUseCase.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.stress_level.api.use_case 2 | 3 | import com.joohnq.stress_level.api.repository.StressLevelRepository 4 | 5 | class DeleteStressLevelUseCase( 6 | private val repository: StressLevelRepository, 7 | ) { 8 | suspend operator fun invoke(id: Long): Result = 9 | try { 10 | repository.delete(id) 11 | 12 | Result.success(Unit) 13 | } catch (e: Exception) { 14 | Result.failure(e) 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /shared-resources/src/androidDebug/kotlin/com/joohnq/shared_resources/components/text/TextEllipsisPreview.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.shared_resources.components.text 2 | 3 | import androidx.compose.runtime.Composable 4 | import com.joohnq.shared_resources.theme.Colors 5 | import com.joohnq.shared_resources.theme.TextStyles 6 | import org.jetbrains.compose.ui.tooling.preview.Preview 7 | 8 | @Preview 9 | @Composable 10 | private fun Preview() { 11 | TextEllipsis( 12 | text = "Text", 13 | style = TextStyles.textSmMedium(), 14 | color = Colors.Brown80 15 | ) 16 | } 17 | -------------------------------------------------------------------------------- /shared-resources/src/commonMain/composeResources/drawable/ic_close_outlined.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /core/datastore/src/commonMain/kotlin/com/joohnq/datastore/CreateDataStore.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.datastore 2 | 3 | import androidx.datastore.core.DataStore 4 | import androidx.datastore.preferences.core.PreferenceDataStoreFactory 5 | import androidx.datastore.preferences.core.Preferences 6 | import okio.Path.Companion.toPath 7 | 8 | fun createDataStore(producePath: () -> String): DataStore = 9 | PreferenceDataStoreFactory.createWithPath( 10 | produceFile = { producePath().toPath() } 11 | ) 12 | 13 | internal const val DATASTORE_FILE_NAME = "moodapp.preferences_pb" 14 | -------------------------------------------------------------------------------- /feature/gratefulness/api/src/commonMain/kotlin/com/joohnq/gratefulness/api/entity/dto/GratefulnessDTO.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.gratefulness.api.entity.dto 2 | 3 | import androidx.room.Entity 4 | import androidx.room.PrimaryKey 5 | import com.joohnq.api.getNow 6 | import kotlinx.datetime.LocalDateTime 7 | 8 | @Entity(tableName = "gratefulness") 9 | data class GratefulnessDTO( 10 | @PrimaryKey(autoGenerate = true) val id: Long = 0, 11 | val iAmGratefulFor: String, 12 | val smallThingIAppreciate: String, 13 | val description: String, 14 | val createdAt: LocalDateTime = getNow(), 15 | ) 16 | -------------------------------------------------------------------------------- /feature/home/impl/src/commonMain/kotlin/com/joohnq/home/impl/ui/components/CreateTabItem.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.home.impl.ui.components 2 | 3 | import androidx.compose.runtime.Composable 4 | import com.joohnq.navigation.Destination 5 | import com.joohnq.ui.entity.BottomItem 6 | 7 | @Composable 8 | fun CreateTabItem( 9 | item: BottomItem, 10 | isCurrentRoute: (Destination) -> Boolean, 11 | onNavigate: (Destination) -> Unit, 12 | ) = TabItem( 13 | icon = item.icon, 14 | selected = isCurrentRoute(item.route), 15 | onNavigate = { onNavigate(item.route) } 16 | ) 17 | -------------------------------------------------------------------------------- /feature/preferences/api/src/commonMain/kotlin/com/joohnq/preferences/api/use_case/UpdateSkipSecurityUseCase.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.preferences.api.use_case 2 | 3 | import com.joohnq.preferences.api.repository.PreferencesRepository 4 | 5 | class UpdateSkipSecurityUseCase( 6 | private val repository: PreferencesRepository, 7 | ) { 8 | suspend operator fun invoke(value: Boolean): Result = 9 | try { 10 | repository.updateSkipSecurity(value) 11 | Result.success(Unit) 12 | } catch (e: Exception) { 13 | Result.failure(e) 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /feature/self-journal/api/src/commonMain/kotlin/com/joohnq/self_journal/api/use_case/DeleteSelfJournalsUseCase.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.self_journal.api.use_case 2 | 3 | import com.joohnq.self_journal.api.repository.SelfJournalRepository 4 | 5 | class DeleteSelfJournalsUseCase( 6 | private val repository: SelfJournalRepository, 7 | ) { 8 | suspend operator fun invoke(item: Long): Result = 9 | try { 10 | repository.deleteById(item) 11 | 12 | Result.success(Unit) 13 | } catch (e: Exception) { 14 | Result.failure(e) 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /feature/gratefulness/impl/src/commonMain/kotlin/com/joohnq/gratefulness/impl/di/GratefulnessImplModule.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.gratefulness.impl.di 2 | 3 | import com.joohnq.gratefulness.api.repository.GratefulnessRepository 4 | import com.joohnq.gratefulness.impl.data.repository.GratefulnessRepositoryImpl 5 | import org.koin.core.module.Module 6 | import org.koin.core.module.dsl.singleOf 7 | import org.koin.dsl.bind 8 | import org.koin.dsl.module 9 | 10 | val gratefulnessImplModule: Module = 11 | module { 12 | singleOf(::GratefulnessRepositoryImpl) bind GratefulnessRepository::class 13 | } 14 | -------------------------------------------------------------------------------- /feature/gratefulness/overview/src/commonMain/kotlin/com/joohnq/gratefulness/overview/di/GratefulnessOverviewModule.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.gratefulness.overview.di 2 | 3 | import com.joohnq.gratefulness.overview.presentation.GratefulnessOverviewViewModel 4 | import org.koin.core.module.Module 5 | import org.koin.dsl.module 6 | 7 | val gratefulnessOverviewModule: Module = 8 | module { 9 | single { 10 | GratefulnessOverviewViewModel( 11 | getGratefulnessUseCase = get(), 12 | deleteGratefulnessUseCase = get() 13 | ) 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /feature/preferences/api/src/commonMain/kotlin/com/joohnq/preferences/api/use_case/UpdateSkipOnboardingUseCase.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.preferences.api.use_case 2 | 3 | import com.joohnq.preferences.api.repository.PreferencesRepository 4 | 5 | class UpdateSkipOnboardingUseCase( 6 | private val repository: PreferencesRepository, 7 | ) { 8 | suspend operator fun invoke(value: Boolean): Result = 9 | try { 10 | repository.updateSkipOnboarding(value) 11 | Result.success(Unit) 12 | } catch (e: Exception) { 13 | Result.failure(e) 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /feature/preferences/api/src/commonMain/kotlin/com/joohnq/preferences/api/use_case/UpdateSkipWelcomeUseCase.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.preferences.api.use_case 2 | 3 | import com.joohnq.preferences.api.repository.PreferencesRepository 4 | 5 | class UpdateSkipWelcomeUseCase( 6 | private val repository: PreferencesRepository, 7 | ) { 8 | suspend operator fun invoke(value: Boolean): Result = 9 | try { 10 | repository.updateSkipWelcome(value) 11 | 12 | Result.success(Unit) 13 | } catch (e: Exception) { 14 | Result.failure(e) 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /feature/user/api/src/commonMain/kotlin/com/joohnq/api/use_case/UpdateSoughtHelpUseCase.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.api.use_case 2 | 3 | import com.joohnq.api.entity.ProfessionalHelp 4 | import com.joohnq.api.repository.UserRepository 5 | 6 | class UpdateSoughtHelpUseCase( 7 | private val repository: UserRepository, 8 | ) { 9 | suspend operator fun invoke(soughtHelp: ProfessionalHelp): Result = 10 | try { 11 | repository.updateSoughtHelp(soughtHelp) 12 | Result.success(Unit) 13 | } catch (e: Exception) { 14 | Result.failure(e) 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /shared-resources/src/androidDebug/kotlin/com/joohnq/shared_resources/components/time_picker/AppTimePickerPreview.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.shared_resources.components.time_picker 2 | 3 | import androidx.compose.material3.ExperimentalMaterial3Api 4 | import androidx.compose.material3.rememberTimePickerState 5 | import androidx.compose.runtime.Composable 6 | import org.jetbrains.compose.ui.tooling.preview.Preview 7 | 8 | @Preview 9 | @Composable 10 | @OptIn(ExperimentalMaterial3Api::class) 11 | private fun Preview() { 12 | AppTimePicker( 13 | timePickerState = rememberTimePickerState() 14 | ) 15 | } 16 | -------------------------------------------------------------------------------- /feature/preferences/api/src/commonMain/kotlin/com/joohnq/preferences/api/repository/PreferencesRepository.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.preferences.api.repository 2 | 3 | import com.joohnq.preferences.api.entity.AppPreferences 4 | 5 | interface PreferencesRepository { 6 | suspend fun get(): AppPreferences? 7 | 8 | suspend fun updateSkipWelcome(value: Boolean) 9 | 10 | suspend fun updateSkipOnboarding(value: Boolean) 11 | 12 | suspend fun updateSkipAuth(value: Boolean) 13 | 14 | suspend fun updateSkipSecurity(value: Boolean) 15 | 16 | suspend fun updateSkipSqlMigration(value: Boolean) 17 | } 18 | -------------------------------------------------------------------------------- /feature/security/api/src/commonMain/kotlin/com/joohnq/security/api/use_case/GetSecurityUseCase.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.security.api.use_case 2 | 3 | import com.joohnq.security.api.Security 4 | import com.joohnq.security.api.SecurityPreference 5 | 6 | class GetSecurityUseCase( 7 | private val securityPreference: SecurityPreference, 8 | ) { 9 | suspend operator fun invoke(): Result = 10 | try { 11 | val security = securityPreference.get() 12 | 13 | Result.success(security) 14 | } catch (e: Exception) { 15 | Result.failure(e) 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /feature/stress-level/api/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | id("moodly.android.library") 3 | id("moodly.multiplatform.library") 4 | 5 | alias(libs.plugins.serialization) 6 | } 7 | 8 | kotlin { 9 | sourceSets { 10 | commonMain.dependencies { 11 | implementation(projects.core.domain) 12 | 13 | implementation(libs.serialization) 14 | implementation(libs.kotlin.datetime) 15 | 16 | implementation(libs.bundles.koin) 17 | } 18 | commonTest.dependencies { 19 | implementation(libs.bundles.test) 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /feature/user/api/src/commonMain/kotlin/com/joohnq/api/entity/ProfessionalHelp.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.api.entity 2 | 3 | import com.joohnq.api.property.ProfessionalHelpProperties 4 | 5 | sealed class ProfessionalHelp( 6 | override val id: Long, 7 | override val value: Boolean, 8 | ) : ProfessionalHelpProperties { 9 | data object Yes : ProfessionalHelp(YES.id, YES.value) 10 | 11 | data object No : ProfessionalHelp(NO.id, NO.value) 12 | 13 | companion object { 14 | val YES = DProfessionalHelpProperties(1, true) 15 | val NO = DProfessionalHelpProperties(0, false) 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /feature/welcome/api/src/commonMain/kotlin/com/joohnq/welcome/api/entity/Welcome.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.welcome.api.entity 2 | 3 | import androidx.compose.ui.graphics.Color 4 | import org.jetbrains.compose.resources.DrawableResource 5 | import org.jetbrains.compose.resources.StringResource 6 | 7 | data class Welcome( 8 | val image: DrawableResource, 9 | val step: StringResource, 10 | val index: Int, 11 | val backgroundColor: Color, 12 | val firstTitle: StringResource? = null, 13 | val span: StringResource, 14 | val secondTitle: StringResource? = null, 15 | val spanColor: Color, 16 | ) 17 | -------------------------------------------------------------------------------- /feature/security/api/src/commonMain/kotlin/com/joohnq/security/api/use_case/UpdateSecurityUseCase.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.security.api.use_case 2 | 3 | import com.joohnq.security.api.Security 4 | import com.joohnq.security.api.SecurityPreference 5 | 6 | class UpdateSecurityUseCase( 7 | private val securityPreference: SecurityPreference, 8 | ) { 9 | suspend operator fun invoke(security: Security): Result = 10 | try { 11 | securityPreference.update(security) 12 | Result.success(Unit) 13 | } catch (e: Exception) { 14 | Result.failure(e) 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /feature/self-journal/history/src/commonMain/kotlin/com/joohnq/self_journal/di/SelfJournalHistoryModule.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.self_journal.di 2 | 3 | import com.joohnq.self_journal.presentation.SelfJournalHistoryViewModel 4 | import org.koin.core.module.Module 5 | import org.koin.core.module.dsl.viewModel 6 | import org.koin.dsl.module 7 | 8 | val selfJournalHistoryModule: Module = 9 | module { 10 | viewModel { 11 | SelfJournalHistoryViewModel( 12 | getSelfJournalsUseCase = get(), 13 | deleteSelfJournalsUseCase = get() 14 | ) 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /feature/self-journal/overview/src/commonMain/kotlin/com/joohnq/self_journal/di/SelfJournalOverviewModule.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.self_journal.di 2 | 3 | import com.joohnq.self_journal.presentation.SelfJournalOverviewViewModel 4 | import org.koin.core.module.Module 5 | import org.koin.core.module.dsl.viewModel 6 | import org.koin.dsl.module 7 | 8 | val selfJournalOverviewModule: Module = 9 | module { 10 | viewModel { 11 | SelfJournalOverviewViewModel( 12 | getSelfJournalsUseCase = get(), 13 | deleteSelfJournalsUseCase = get() 14 | ) 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /shared-resources/src/commonMain/composeResources/drawable/ic_nothing_outlined.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /shared-resources/src/commonMain/kotlin/com/joohnq/shared_resources/components/modifier/DpOffset.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.shared_resources.components.modifier 2 | 3 | import androidx.compose.foundation.layout.offset 4 | import androidx.compose.runtime.Composable 5 | import androidx.compose.ui.Modifier 6 | import androidx.compose.ui.unit.Dp 7 | import androidx.compose.ui.unit.IntOffset 8 | import androidx.compose.ui.unit.dp 9 | 10 | @Composable 11 | fun Modifier.dpOffset( 12 | x: Dp = 0.dp, 13 | y: Dp = 0.dp, 14 | ): Modifier = 15 | offset { 16 | IntOffset(x = x.toPx().toInt(), y = y.toPx().toInt()) 17 | } 18 | -------------------------------------------------------------------------------- /core/ui/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | id("moodly.android.library") 3 | id("moodly.multiplatform.library") 4 | id("moodly.compose") 5 | } 6 | 7 | kotlin { 8 | sourceSets { 9 | commonMain.dependencies { 10 | implementation(libs.kotlin.datetime) 11 | implementation(libs.bundles.koin) 12 | implementation(libs.calendar) 13 | implementation(libs.coroutines.core) 14 | implementation(libs.coroutines.extensions) 15 | implementation(libs.compose.navigation) 16 | implementation(libs.bundles.viewmodel) 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /feature/mood/impl/src/androidDebug/kotlin/com/joohnq/mood/impl/ui/parameter/MoodResourceParameterProvider.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.mood.impl.ui.parameter 2 | 3 | import androidx.compose.ui.tooling.preview.PreviewParameterProvider 4 | import com.joohnq.mood.add.ui.resource.MoodResource 5 | 6 | class MoodResourceParameterProvider : PreviewParameterProvider { 7 | override val values = 8 | sequenceOf( 9 | MoodResource.Depressed, 10 | MoodResource.Sad, 11 | MoodResource.Neutral, 12 | MoodResource.Happy, 13 | MoodResource.Overjoyed 14 | ) 15 | } 16 | -------------------------------------------------------------------------------- /feature/self-journal/overview/src/androidDebug/kotlin/com/joohnq/self_journal/overview/component/CalendarInfoCardPreview.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.self_journal.overview.component 2 | 3 | import androidx.compose.runtime.Composable 4 | import com.joohnq.self_journal.presentation.components.CalendarInfoCard 5 | import com.joohnq.shared_resources.remember.rememberCalendarInfo 6 | import org.jetbrains.compose.ui.tooling.preview.Preview 7 | 8 | @Preview 9 | @Composable 10 | private fun Preview() { 11 | rememberCalendarInfo().forEach { info -> 12 | CalendarInfoCard( 13 | info = info 14 | ) 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /feature/user/api/src/commonMain/kotlin/com/joohnq/api/entity/User.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.api.entity 2 | 3 | import com.joohnq.api.getNow 4 | import kotlinx.datetime.LocalDate 5 | 6 | data class User( 7 | val id: Long = 1, 8 | val name: String = "", 9 | val image: String? = null, 10 | val imageType: ImageType = ImageType.DRAWABLE, 11 | val medicationsSupplements: MedicationsSupplements = MedicationsSupplements.ImNotTakingAny, 12 | val soughtHelp: ProfessionalHelp = ProfessionalHelp.No, 13 | val physicalSymptoms: PhysicalSymptoms = PhysicalSymptoms.No, 14 | val createdAt: LocalDate = getNow().date, 15 | ) 16 | -------------------------------------------------------------------------------- /shared-resources/src/commonMain/composeResources/drawable/ic_heart_outlined.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /feature/self-journal/impl/src/androidDebug/kotlin/com/joohnq/self_journal/impl/parameter/ListSelfJournalRecordResourceParameterProvider.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.self_journal.impl.parameter 2 | 3 | import androidx.compose.ui.tooling.preview.PreviewParameterProvider 4 | import com.joohnq.self_journal.impl.ui.resource.SelfJournalRecordResource 5 | 6 | class ListSelfJournalRecordResourceParameterProvider : PreviewParameterProvider> { 7 | override val values = 8 | sequenceOf( 9 | SelfJournalRecordResource.allSelfJournalRecordResourcePreview, 10 | emptyList() 11 | ) 12 | } 13 | -------------------------------------------------------------------------------- /feature/self-journal/overview/src/androidDebug/kotlin/com/joohnq/self_journal/overview/component/SelfJournalPanelPreview.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.self_journal.overview.component 2 | 3 | import androidx.compose.runtime.Composable 4 | import com.joohnq.self_journal.impl.ui.resource.SelfJournalRecordResource 5 | import com.joohnq.self_journal.presentation.components.SelfJournalOverviewPanel 6 | import org.jetbrains.compose.ui.tooling.preview.Preview 7 | 8 | @Preview 9 | @Composable 10 | private fun Preview() { 11 | SelfJournalOverviewPanel( 12 | items = SelfJournalRecordResource.allSelfJournalRecordResourcePreview 13 | ) 14 | } 15 | -------------------------------------------------------------------------------- /feature/user/api/src/commonMain/kotlin/com/joohnq/api/use_case/UpdatePhysicalSymptomsUseCase.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.api.use_case 2 | 3 | import com.joohnq.api.entity.PhysicalSymptoms 4 | import com.joohnq.api.repository.UserRepository 5 | 6 | class UpdatePhysicalSymptomsUseCase( 7 | private val repository: UserRepository, 8 | ) { 9 | suspend operator fun invoke(physicalSymptoms: PhysicalSymptoms): Result = 10 | try { 11 | repository.updatePhysicalSymptoms(physicalSymptoms) 12 | Result.success(Unit) 13 | } catch (e: Exception) { 14 | Result.failure(e) 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /shared-resources/src/androidDebug/kotlin/com/joohnq/shared_resources/components/button/BottomNavigationButtonPreview.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.shared_resources.components.button 2 | 3 | import androidx.compose.runtime.Composable 4 | import com.joohnq.shared_resources.Res 5 | import com.joohnq.shared_resources.app_name 6 | import com.joohnq.shared_resources.theme.Drawables 7 | import org.jetbrains.compose.ui.tooling.preview.Preview 8 | 9 | @Preview 10 | @Composable 11 | private fun Preview() { 12 | BottomNavigationButton( 13 | image = Drawables.Icons.Outlined.Logo, 14 | description = Res.string.app_name 15 | ) 16 | } 17 | -------------------------------------------------------------------------------- /feature/stress-level/api/src/commonMain/kotlin/com/joohnq/stress_level/api/di/StressLevelApiModule.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.stress_level.api.di 2 | 3 | import com.joohnq.stress_level.api.use_case.AddStressLevelUseCase 4 | import com.joohnq.stress_level.api.use_case.DeleteStressLevelUseCase 5 | import com.joohnq.stress_level.api.use_case.GetAllStressLevelUseCase 6 | import org.koin.core.module.dsl.factoryOf 7 | import org.koin.dsl.module 8 | 9 | val stressLevelApiModule = 10 | module { 11 | factoryOf(::AddStressLevelUseCase) 12 | factoryOf(::GetAllStressLevelUseCase) 13 | factoryOf(::DeleteStressLevelUseCase) 14 | } 15 | -------------------------------------------------------------------------------- /feature/stress-level/history/src/commonMain/kotlin/com/joohnq/stress_level/history/di/StressLevelHistoryModule.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.stress_level.history.di 2 | 3 | import com.joohnq.stress_level.history.presentation.StressLevelHistoryViewModel 4 | import org.koin.core.module.Module 5 | import org.koin.core.module.dsl.viewModel 6 | import org.koin.dsl.module 7 | 8 | val stressLevelHistoryModule: Module = 9 | module { 10 | viewModel { 11 | StressLevelHistoryViewModel( 12 | getAllStressLevelUseCase = get(), 13 | deleteStressLevelUseCase = get() 14 | ) 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /feature/stress-level/impl/src/androidDebug/kotlin/com/joohnq/stress_level/impl/ui/parameter/ListStressLevelRecordResourceParameterProvider.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.stress_level.impl.ui.parameter 2 | 3 | import androidx.compose.ui.tooling.preview.PreviewParameterProvider 4 | import com.joohnq.stress_level.impl.ui.resource.StressLevelRecordResource 5 | 6 | class ListStressLevelRecordResourceParameterProvider : PreviewParameterProvider> { 7 | override val values = 8 | sequenceOf( 9 | StressLevelRecordResource.allStressLevelRecordResourcePreview, 10 | emptyList() 11 | ) 12 | } 13 | -------------------------------------------------------------------------------- /feature/user/impl/src/androidDebug/kotlin/com/joohnq/user/impl/ui/parameter/PhysicalSymptomsResourceParameterProvider.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.user.impl.ui.parameter 2 | 3 | import androidx.compose.ui.tooling.preview.PreviewParameterProvider 4 | import com.joohnq.user.impl.ui.resource.PhysicalSymptomsResource 5 | 6 | class PhysicalSymptomsResourceParameterProvider : PreviewParameterProvider { 7 | override val values = 8 | sequenceOf( 9 | PhysicalSymptomsResource.No, 10 | PhysicalSymptomsResource.YesJustABit, 11 | PhysicalSymptomsResource.YesVeryPainful 12 | ) 13 | } 14 | -------------------------------------------------------------------------------- /shared-resources/src/commonMain/composeResources/drawable/ic_clock.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /feature/gratefulness/api/src/commonMain/kotlin/com/joohnq/gratefulness/api/use_case/AddGratefulnessUseCase.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.gratefulness.api.use_case 2 | 3 | import com.joohnq.gratefulness.api.entity.Gratefulness 4 | import com.joohnq.gratefulness.api.repository.GratefulnessRepository 5 | 6 | class AddGratefulnessUseCase( 7 | private val repository: GratefulnessRepository, 8 | ) { 9 | suspend operator fun invoke(item: Gratefulness): Result = 10 | try { 11 | repository.add(item) 12 | Result.success(Unit) 13 | } catch (e: Exception) { 14 | Result.failure(e) 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /feature/mood/impl/src/androidDebug/kotlin/com/joohnq/mood/impl/ui/parameter/MoodAverageResourceParameterProvider.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.mood.impl.ui.parameter 2 | 3 | import androidx.compose.ui.tooling.preview.PreviewParameterProvider 4 | import com.joohnq.mood.add.ui.resource.MoodAverageResource 5 | 6 | class MoodAverageResourceParameterProvider : PreviewParameterProvider { 7 | override val values = 8 | sequenceOf( 9 | MoodAverageResource.Neutral, 10 | MoodAverageResource.Negative, 11 | MoodAverageResource.Skipped, 12 | MoodAverageResource.Positive 13 | ) 14 | } 15 | -------------------------------------------------------------------------------- /feature/sleep-quality/impl/src/androidDebug/kotlin/com/joohnq/sleep_quality/impl/ui/parameter/ListSleepQualityRecordResourceParameterProvider.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.sleep_quality.impl.ui.parameter 2 | 3 | import androidx.compose.ui.tooling.preview.PreviewParameterProvider 4 | import com.joohnq.sleep_quality.impl.ui.resource.SleepQualityRecordResource 5 | 6 | class ListSleepQualityRecordResourceParameterProvider : PreviewParameterProvider> { 7 | override val values = 8 | sequenceOf( 9 | SleepQualityRecordResource.allSleepQualityRecordResource, 10 | emptyList() 11 | ) 12 | } 13 | -------------------------------------------------------------------------------- /shared-resources/src/commonMain/composeResources/drawable/ic_target.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /feature/security/impl/src/androidMain/kotlin/com/joohnq/security/impl/ui/SecurityAuthentication.android.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.security.impl.ui 2 | 3 | import androidx.appcompat.app.AppCompatActivity 4 | import androidx.compose.runtime.Composable 5 | import androidx.compose.ui.platform.LocalContext 6 | import com.joohnq.security.api.SecurityAuthentication 7 | import org.koin.compose.koinInject 8 | import org.koin.core.parameter.parametersOf 9 | 10 | @Composable 11 | actual fun securityAuthentication(): SecurityAuthentication { 12 | val appCompat = LocalContext.current as AppCompatActivity 13 | return koinInject { parametersOf(appCompat) } 14 | } 15 | -------------------------------------------------------------------------------- /feature/self-journal/overview/src/androidDebug/kotlin/com/joohnq/self_journal/overview/component/SelfJournalOverviewHistoryPreview.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.self_journal.overview.component 2 | 3 | import androidx.compose.runtime.Composable 4 | import com.joohnq.self_journal.impl.ui.resource.SelfJournalRecordResource 5 | import com.joohnq.self_journal.presentation.components.SelfJournalOverviewHistory 6 | import org.jetbrains.compose.ui.tooling.preview.Preview 7 | 8 | @Preview 9 | @Composable 10 | private fun Preview() { 11 | SelfJournalOverviewHistory( 12 | items = SelfJournalRecordResource.allSelfJournalRecordResourcePreview 13 | ) 14 | } 15 | -------------------------------------------------------------------------------- /feature/sleep-quality/history/src/commonMain/kotlin/com/joohnq/sleep_quality/history/di/SleepQualityHistoryModule.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.sleep_quality.history.di 2 | 3 | import com.joohnq.sleep_quality.history.presentation.SleepQualityHistoryViewModel 4 | import org.koin.core.module.Module 5 | import org.koin.core.module.dsl.viewModel 6 | import org.koin.dsl.module 7 | 8 | val sleepQualityHistoryModule: Module = 9 | module { 10 | viewModel { 11 | SleepQualityHistoryViewModel( 12 | getSleepQualitiesUseCase = get(), 13 | deleteSleepQualityUseCase = get() 14 | ) 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /feature/self-journal/api/src/commonMain/kotlin/com/joohnq/self_journal/api/use_case/AddSelfJournalsUseCase.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.self_journal.api.use_case 2 | 3 | import com.joohnq.self_journal.api.entity.SelfJournalRecord 4 | import com.joohnq.self_journal.api.repository.SelfJournalRepository 5 | 6 | class AddSelfJournalsUseCase( 7 | private val repository: SelfJournalRepository, 8 | ) { 9 | suspend operator fun invoke(value: SelfJournalRecord): Result = 10 | try { 11 | repository.add(value) 12 | Result.success(Unit) 13 | } catch (e: Exception) { 14 | Result.failure(e) 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /feature/sleep-quality/api/src/commonMain/kotlin/com/joohnq/sleep_quality/api/di/SleepQualityApiModule.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.sleep_quality.api.di 2 | 3 | import com.joohnq.sleep_quality.api.use_case.AddSleepQualityUseCase 4 | import com.joohnq.sleep_quality.api.use_case.DeleteSleepQualityUseCase 5 | import com.joohnq.sleep_quality.api.use_case.GetSleepQualitiesUseCase 6 | import org.koin.core.module.dsl.factoryOf 7 | import org.koin.dsl.module 8 | 9 | val sleepQualityApiModule = 10 | module { 11 | factoryOf(::AddSleepQualityUseCase) 12 | factoryOf(::GetSleepQualitiesUseCase) 13 | factoryOf(::DeleteSleepQualityUseCase) 14 | } 15 | -------------------------------------------------------------------------------- /feature/sleep-quality/overview/src/commonMain/kotlin/com/joohnq/sleep_quality/overview/di/SleepQualityOverviewModule.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.sleep_quality.overview.di 2 | 3 | import com.joohnq.sleep_quality.overview.presentation.SleepQualityOverviewViewModel 4 | import org.koin.core.module.Module 5 | import org.koin.core.module.dsl.viewModel 6 | import org.koin.dsl.module 7 | 8 | val sleepQualityOverviewModule: Module = 9 | module { 10 | viewModel { 11 | SleepQualityOverviewViewModel( 12 | getSleepQualitiesUseCase = get(), 13 | deleteSleepQualityUseCase = get() 14 | ) 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /feature/stress-level/api/src/commonMain/kotlin/com/joohnq/stress_level/api/use_case/AddStressLevelUseCase.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.stress_level.api.use_case 2 | 3 | import com.joohnq.stress_level.api.entity.StressLevelRecord 4 | import com.joohnq.stress_level.api.repository.StressLevelRepository 5 | 6 | class AddStressLevelUseCase( 7 | private val repository: StressLevelRepository, 8 | ) { 9 | suspend operator fun invoke(record: StressLevelRecord): Result = 10 | try { 11 | repository.add(record) 12 | Result.success(Unit) 13 | } catch (e: Exception) { 14 | Result.failure(e) 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /feature/self-journal/edit/src/commonMain/kotlin/com/joohnq/self_journal/di/SelfJournalEditModule.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.self_journal.di 2 | 3 | import com.joohnq.self_journal.presentation.EditSelfJournalViewModel 4 | import org.koin.core.module.Module 5 | import org.koin.core.module.dsl.viewModel 6 | import org.koin.dsl.module 7 | 8 | val selfJournalEditModule: Module = 9 | module { 10 | viewModel { 11 | EditSelfJournalViewModel( 12 | getSelfJournalByIdUseCase = get(), 13 | deleteSelfJournalsUseCase = get(), 14 | updateSelfJournalsUseCase = get() 15 | ) 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /feature/user/impl/src/commonMain/kotlin/com/joohnq/user/impl/data/database/UserDatabase.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.user.impl.data.database 2 | 3 | import app.cash.sqldelight.db.SqlDriver 4 | import com.joohnq.database.Database 5 | import com.joohnq.user.database.UserDatabaseSql 6 | 7 | class UserDatabase( 8 | private val driver: SqlDriver, 9 | ) : Database() { 10 | override operator fun invoke(): UserDatabaseSql = UserDatabaseSql(driver) 11 | 12 | override fun drop() { 13 | driver.execute(null, "DROP TABLE IF EXISTS User;", 0) 14 | } 15 | 16 | companion object { 17 | const val DATABASE_NAME = "user.db" 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /feature/gratefulness/history/src/commonMain/kotlin/com/joohnq/gratefulness/history/di/GratefulnessHistoryModule.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.gratefulness.history.di 2 | 3 | import com.joohnq.gratefulness.history.presentation.GratefulnessHistoryViewModel 4 | import org.koin.core.module.Module 5 | import org.koin.core.module.dsl.viewModel 6 | import org.koin.dsl.module 7 | 8 | val gratefulnessHistoryModule: Module = 9 | module { 10 | viewModel { 11 | GratefulnessHistoryViewModel( 12 | getGratefulnessUseCase = get(), 13 | deleteGratefulnessUseCase = get() 14 | ) 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /feature/mood/impl/src/commonMain/kotlin/com/joohnq/mood/add/data/database/MoodDatabase.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.mood.add.data.database 2 | 3 | import app.cash.sqldelight.db.SqlDriver 4 | import com.joohnq.database.Database 5 | import com.joohnq.mood.database.MoodDatabaseSql 6 | 7 | class MoodDatabase( 8 | private val driver: SqlDriver, 9 | ) : Database() { 10 | override operator fun invoke(): MoodDatabaseSql = MoodDatabaseSql(driver) 11 | 12 | override fun drop() { 13 | driver.execute(null, "DROP TABLE IF EXISTS MoodRecord;", 0) 14 | } 15 | 16 | companion object { 17 | const val DATABASE_NAME = "mood.db" 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /feature/mood/impl/src/commonMain/kotlin/com/joohnq/mood/add/ui/mapper/MoodAverageResourceMapper.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.mood.add.ui.mapper 2 | 3 | import com.joohnq.mood.add.ui.resource.MoodAverageResource 4 | import com.joohnq.mood.api.entity.MoodAverage 5 | 6 | object MoodAverageResourceMapper { 7 | fun MoodAverage.toResource(): MoodAverageResource = 8 | when (this) { 9 | MoodAverage.Skipped -> MoodAverageResource.Skipped 10 | MoodAverage.Negative -> MoodAverageResource.Negative 11 | MoodAverage.Neutral -> MoodAverageResource.Neutral 12 | MoodAverage.Positive -> MoodAverageResource.Positive 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /shared-resources/src/androidDebug/kotlin/com/joohnq/shared_resources/components/chart/LineChartPreview.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.shared_resources.components.chart 2 | 3 | import androidx.compose.runtime.Composable 4 | import com.joohnq.shared_resources.theme.Colors 5 | import org.jetbrains.compose.ui.tooling.preview.Preview 6 | 7 | @Preview 8 | @Composable 9 | private fun Preview() { 10 | LineChart( 11 | color = Colors.Brown80, 12 | values = 13 | listOf( 14 | 0.0, 15 | 1.0, 16 | 2.0, 17 | 3.0, 18 | 4.0, 19 | 5.0 20 | ) 21 | ) 22 | } 23 | -------------------------------------------------------------------------------- /feature/mood/api/src/commonMain/kotlin/com/joohnq/mood/api/mapper/MoodAverageMapper.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.mood.api.mapper 2 | 3 | import com.joohnq.mood.api.entity.Mood 4 | import com.joohnq.mood.api.entity.MoodAverage 5 | 6 | object MoodAverageMapper { 7 | fun Int.toAverage(): MoodAverage = 8 | when (this) { 9 | in Mood.Depressed.healthLevel - 20..Mood.Sad.healthLevel -> MoodAverage.Negative 10 | in Mood.Neutral.healthLevel - 20..Mood.Neutral.healthLevel -> MoodAverage.Neutral 11 | in Mood.Happy.healthLevel - 20..Mood.Overjoyed.healthLevel -> MoodAverage.Positive 12 | else -> MoodAverage.Skipped 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /feature/self-journal/api/src/commonMain/kotlin/com/joohnq/self_journal/api/use_case/UpdateSelfJournalsUseCase.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.self_journal.api.use_case 2 | 3 | import com.joohnq.self_journal.api.entity.SelfJournalRecord 4 | import com.joohnq.self_journal.api.repository.SelfJournalRepository 5 | 6 | class UpdateSelfJournalsUseCase( 7 | private val repository: SelfJournalRepository, 8 | ) { 9 | suspend operator fun invoke(selfJournal: SelfJournalRecord): Result = 10 | try { 11 | repository.update(selfJournal) 12 | Result.success(Unit) 13 | } catch (e: Exception) { 14 | Result.failure(e) 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /feature/stress-level/overview/src/commonMain/kotlin/com/joohnq/stress_level/overview/di/StressLevelOverviewModule.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.stress_level.overview.di 2 | 3 | import com.joohnq.stress_level.overview.presentation.StressLevelOverviewViewModel 4 | import org.koin.core.module.Module 5 | import org.koin.core.module.dsl.viewModel 6 | import org.koin.dsl.module 7 | 8 | val stressLevelOverviewModule: Module = 9 | module { 10 | viewModel { 11 | StressLevelOverviewViewModel( 12 | getAllStressLevelUseCase = get(), 13 | deleteStressLevelUseCase = get() 14 | ) 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /feature/user/api/src/commonMain/kotlin/com/joohnq/api/use_case/UpdateMedicationsSupplementsUseCase.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.api.use_case 2 | 3 | import com.joohnq.api.entity.MedicationsSupplements 4 | import com.joohnq.api.repository.UserRepository 5 | 6 | class UpdateMedicationsSupplementsUseCase( 7 | private val repository: UserRepository, 8 | ) { 9 | suspend operator fun invoke(medicationsSupplements: MedicationsSupplements): Result = 10 | try { 11 | repository.updateMedicationsSupplements(medicationsSupplements) 12 | Result.success(Unit) 13 | } catch (e: Exception) { 14 | Result.failure(e) 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /shared-resources/src/androidDebug/kotlin/com/joohnq/shared_resources/components/text/HeadingWithSpanPreview.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.shared_resources.components.text 2 | 3 | import androidx.compose.runtime.Composable 4 | import com.joohnq.shared_resources.Res 5 | import com.joohnq.shared_resources.app_name 6 | import com.joohnq.shared_resources.theme.Colors 7 | import org.jetbrains.compose.ui.tooling.preview.Preview 8 | 9 | @Preview 10 | @Composable 11 | private fun Preview() { 12 | HeadingWithSpan( 13 | firstTitle = Res.string.app_name, 14 | secondTitle = Res.string.app_name, 15 | span = "Span", 16 | spanColor = Colors.Brown80 17 | ) 18 | } 19 | -------------------------------------------------------------------------------- /feature/sleep-quality/overview/src/androidDebug/kotlin/com/joohnq/sleep_quality/overview/component/SleepQualityOverviewPanelInfoPreview.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.sleep_quality.overview.component 2 | 3 | import androidx.compose.runtime.Composable 4 | import com.joohnq.shared_resources.Res 5 | import com.joohnq.shared_resources.app_name 6 | import com.joohnq.shared_resources.theme.Drawables 7 | import org.jetbrains.compose.ui.tooling.preview.Preview 8 | 9 | @Preview 10 | @Composable 11 | private fun Preview() { 12 | SleepQualityOverviewPanelInfo( 13 | icon = Drawables.Icons.Outlined.Logo, 14 | title = Res.string.app_name, 15 | value = "Value" 16 | ) 17 | } 18 | -------------------------------------------------------------------------------- /shared-resources/src/commonMain/kotlin/com/joohnq/shared_resources/components/IconResource.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.shared_resources.components 2 | 3 | import androidx.compose.material3.Icon 4 | import androidx.compose.runtime.Composable 5 | import com.joohnq.ui.entity.IconResource 6 | import org.jetbrains.compose.resources.painterResource 7 | import org.jetbrains.compose.resources.stringResource 8 | 9 | @Composable 10 | fun IconResource(icon: IconResource) { 11 | Icon( 12 | painter = painterResource(icon.icon), 13 | contentDescription = stringResource(icon.contentDescription), 14 | tint = icon.tint, 15 | modifier = icon.modifier 16 | ) 17 | } 18 | -------------------------------------------------------------------------------- /feature/gratefulness/api/src/commonMain/kotlin/com/joohnq/gratefulness/api/di/GratefulnessApiModule.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.gratefulness.api.di 2 | 3 | import com.joohnq.gratefulness.api.use_case.AddGratefulnessUseCase 4 | import com.joohnq.gratefulness.api.use_case.DeleteGratefulnessUseCase 5 | import com.joohnq.gratefulness.api.use_case.GetGratefulnessUseCase 6 | import org.koin.core.module.Module 7 | import org.koin.core.module.dsl.singleOf 8 | import org.koin.dsl.module 9 | 10 | val gratefulnessApiModule: Module = 11 | module { 12 | singleOf(::AddGratefulnessUseCase) 13 | singleOf(::DeleteGratefulnessUseCase) 14 | singleOf(::GetGratefulnessUseCase) 15 | } 16 | -------------------------------------------------------------------------------- /feature/mood/api/src/commonMain/kotlin/com/joohnq/mood/api/entity/MoodPalette.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.mood.api.entity 2 | 3 | import androidx.compose.ui.graphics.Color 4 | 5 | data class MoodPalette( 6 | val faceBackgroundColor: Color, 7 | val faceColor: Color, 8 | val backgroundColor: Color, 9 | val subColor: Color, 10 | val color: Color, 11 | val moodScreenBackgroundColor: Color, 12 | val moodScreenInactiveColor: Color, 13 | val moodScreenTraceColor: Color, 14 | val moodScreenMoodFaceBackgroundColor: Color, 15 | val moodScreenMoodFaceColor: Color, 16 | val barColor: Color, 17 | val barFaceColor: Color, 18 | val imageColor: Color, 19 | ) 20 | -------------------------------------------------------------------------------- /feature/preferences/impl/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | id("moodly.android.library") 3 | id("moodly.multiplatform.library") 4 | id("moodly.compose") 5 | } 6 | 7 | kotlin { 8 | sourceSets { 9 | commonMain.dependencies { 10 | implementation(projects.core.datastore) 11 | 12 | implementation(projects.core.ui) 13 | 14 | implementation(projects.core.domain) 15 | 16 | implementation(projects.sharedResources) 17 | 18 | implementation(projects.feature.preferences.api) 19 | 20 | implementation(libs.bundles.koin) 21 | implementation(libs.bundles.dataStore) 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /feature/security/api/src/commonMain/kotlin/com/joohnq/security/api/Security.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.security.api 2 | 3 | import kotlinx.serialization.Serializable 4 | 5 | @Serializable 6 | sealed class Security { 7 | @Serializable 8 | data object None : Security() 9 | 10 | @Serializable 11 | data object Corrupted : Security() 12 | 13 | @Serializable 14 | data class Biometric( 15 | val enabled: Boolean, 16 | ) : Security() 17 | 18 | @Serializable 19 | data class Pin( 20 | val enabled: Boolean, 21 | val code: List, 22 | ) : Security() 23 | } 24 | 25 | fun Security.getPinCode(): List = (this as Security.Pin).code 26 | -------------------------------------------------------------------------------- /feature/security/impl/src/androidMain/kotlin/com/joohnq/security/impl/di/SecurityAuthenticationModule.android.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.security.impl.di 2 | 3 | import androidx.appcompat.app.AppCompatActivity 4 | import com.joohnq.security.api.SecurityAuthentication 5 | import com.joohnq.security.impl.data.SecurityAuthenticationImpl 6 | import org.koin.core.module.Module 7 | import org.koin.dsl.bind 8 | import org.koin.dsl.module 9 | 10 | actual val securityAuthenticationModule: Module = 11 | module { 12 | factory { (activity: AppCompatActivity) -> 13 | SecurityAuthenticationImpl(activity) 14 | } bind 15 | SecurityAuthentication::class 16 | } 17 | -------------------------------------------------------------------------------- /feature/home/impl/src/commonMain/kotlin/com/joohnq/home/impl/di/HomeImplModule.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.home.impl.di 2 | 3 | import com.joohnq.home.impl.ui.presentation.dashboard.DashboardViewModel 4 | import org.koin.dsl.module 5 | 6 | val homeImplModule = 7 | module { 8 | single { 9 | DashboardViewModel( 10 | getUserUseCase = get(), 11 | getMoodsUseCase = get(), 12 | getSelfJournalsUseCase = get(), 13 | getSleepQualitiesUseCase = get(), 14 | getAllStressLevelUseCase = get(), 15 | getGratefulnessUseCase = get() 16 | ) 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /feature/preferences/api/src/commonMain/kotlin/com/joohnq/preferences/api/use_case/GetPreferencesUseCase.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.preferences.api.use_case 2 | 3 | import com.joohnq.preferences.api.entity.AppPreferences 4 | import com.joohnq.preferences.api.repository.PreferencesRepository 5 | 6 | class GetPreferencesUseCase( 7 | private val repository: PreferencesRepository, 8 | ) { 9 | suspend operator fun invoke(): Result = 10 | try { 11 | val preferences = repository.get() ?: error("Preferences is null") 12 | 13 | Result.success(preferences) 14 | } catch (e: Exception) { 15 | Result.failure(e) 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /feature/self-journal/api/src/commonMain/kotlin/com/joohnq/self_journal/api/use_case/GetSelfJournalByIdUseCase.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.self_journal.api.use_case 2 | 3 | import com.joohnq.self_journal.api.entity.SelfJournalRecord 4 | import com.joohnq.self_journal.api.repository.SelfJournalRepository 5 | 6 | class GetSelfJournalByIdUseCase( 7 | private val repository: SelfJournalRepository, 8 | ) { 9 | suspend operator fun invoke(id: Long): Result = 10 | try { 11 | val selfJournal = repository.getById(id) 12 | 13 | Result.success(selfJournal) 14 | } catch (e: Exception) { 15 | Result.failure(e) 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /shared-resources/src/commonMain/composeResources/drawable/ic_check_outlined.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /feature/security/impl/src/androidDebug/kotlin/com/joohnq/security/impl/ui/presentation/unlock/UnLockContentPreview.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.security.impl.ui.presentation.unlock 2 | 3 | import androidx.compose.material3.ExperimentalMaterial3Api 4 | import androidx.compose.runtime.Composable 5 | import org.jetbrains.compose.ui.tooling.preview.Preview 6 | 7 | @Preview 8 | @Composable 9 | @OptIn(ExperimentalMaterial3Api::class) 10 | private fun Preview() { 11 | UnLockContent( 12 | state = 13 | UnlockContract.State( 14 | showBottomSheet = true, 15 | code = listOf(1, 2, 3, 4), 16 | focusedIndex = 0 17 | ) 18 | ) 19 | } 20 | -------------------------------------------------------------------------------- /feature/sleep-quality/overview/src/androidDebug/kotlin/com/joohnq/sleep_quality/overview/component/SleepQualityOverviewPanelInfoInvertedPreview.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.sleep_quality.overview.component 2 | 3 | import androidx.compose.runtime.Composable 4 | import com.joohnq.shared_resources.Res 5 | import com.joohnq.shared_resources.app_name 6 | import com.joohnq.shared_resources.theme.Drawables 7 | import org.jetbrains.compose.ui.tooling.preview.Preview 8 | 9 | @Preview 10 | @Composable 11 | private fun Preview() { 12 | SleepQualityOverviewPanelInfoInverted( 13 | icon = Drawables.Icons.Outlined.Logo, 14 | title = Res.string.app_name, 15 | value = "Value" 16 | ) 17 | } 18 | -------------------------------------------------------------------------------- /feature/user/api/src/commonMain/kotlin/com/joohnq/api/use_case/UpdateUserImageDrawableUseCase.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.api.use_case 2 | 3 | import com.joohnq.api.entity.ImageType 4 | import com.joohnq.api.repository.UserRepository 5 | 6 | class UpdateUserImageDrawableUseCase( 7 | private val repository: UserRepository, 8 | ) { 9 | suspend operator fun invoke(i: Int): Result = 10 | try { 11 | repository.updateUserImage( 12 | image = i.toString(), 13 | imageType = ImageType.DRAWABLE 14 | ) 15 | 16 | Result.success(Unit) 17 | } catch (e: Exception) { 18 | Result.failure(e) 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /shared-resources/src/commonMain/composeResources/drawable/ic_circle_outlined.xml: -------------------------------------------------------------------------------- 1 | 6 | 10 | 11 | -------------------------------------------------------------------------------- /feature/user/api/src/commonMain/kotlin/com/joohnq/api/mapper/ProfessionalHelpMapper.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.api.mapper 2 | 3 | import com.joohnq.api.entity.ProfessionalHelp 4 | import com.joohnq.api.entity.ProfessionalHelp.Companion.NO 5 | import com.joohnq.api.entity.ProfessionalHelp.Companion.YES 6 | import com.joohnq.api.entity.ProfessionalHelp.No 7 | import com.joohnq.api.entity.ProfessionalHelp.Yes 8 | 9 | object ProfessionalHelpMapper { 10 | fun Long.toProfessionalHelp(): ProfessionalHelp = 11 | when (this) { 12 | YES.id -> Yes 13 | NO.id -> No 14 | else -> throw IllegalArgumentException("Unknown professional help option: $this") 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /shared-resources/src/commonMain/composeResources/drawable/ic_warning.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /feature/security/impl/src/commonMain/kotlin/com/joohnq/security/impl/ui/presentation/security_confirmed/SecurityConfirmedContract.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.security.impl.ui.presentation.security_confirmed 2 | 3 | import com.joohnq.ui.UnidirectionalViewModelWithoutState 4 | 5 | sealed interface SecurityConfirmedContract { 6 | interface ViewModel : UnidirectionalViewModelWithoutState 7 | 8 | sealed interface SideEffect { 9 | data object NavigateNext : SideEffect 10 | 11 | data class ShowError( 12 | val message: String, 13 | ) : SideEffect 14 | } 15 | 16 | sealed interface Intent { 17 | data object Action : Intent 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /shared-resources/src/androidDebug/kotlin/com/joohnq/shared_resources/components/text/BubbleTextPreview.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.shared_resources.components.text 2 | 3 | import androidx.compose.runtime.Composable 4 | import com.joohnq.shared_resources.Res 5 | import com.joohnq.shared_resources.app_name 6 | import org.jetbrains.compose.ui.tooling.preview.Preview 7 | 8 | @Preview 9 | @Composable 10 | private fun Preview() { 11 | BubbleText( 12 | text = Res.string.app_name, 13 | selected = false 14 | ) 15 | } 16 | 17 | @Preview 18 | @Composable 19 | private fun SelectedPreview() { 20 | BubbleText( 21 | text = Res.string.app_name, 22 | selected = true 23 | ) 24 | } 25 | -------------------------------------------------------------------------------- /core/domain/src/commonMain/kotlin/com/joohnq/api/mapper/DoubleMapper.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.api.mapper 2 | 3 | import kotlin.math.PI 4 | import kotlin.math.pow 5 | 6 | object DoubleMapper { 7 | fun Double.toRadians(): Double = this / 180.0 * PI 8 | 9 | fun Double.toDegrees(): Double = this * 180.0 / PI 10 | 11 | fun List.organizeMoodRange(): List = if (size < 8) listOf(0.0) + this + 0.0 else this 12 | 13 | fun Double.toPercentage(decimals: Int = 1): String { 14 | val rounded = (this * 10.0.pow(decimals.toDouble())).toInt() / 10.0.pow(decimals.toDouble()) 15 | return if (rounded == rounded.toInt().toDouble()) "${rounded.toInt()}%" else "$rounded%" 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /core/database/src/androidMain/kotlin/com/joohnq/database/AppDatabase.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.database 2 | 3 | import android.content.Context 4 | import androidx.room.Room 5 | import androidx.sqlite.driver.bundled.BundledSQLiteDriver 6 | import kotlinx.coroutines.Dispatchers 7 | 8 | fun getDatabaseBuilder(context: Context): AppDatabase { 9 | val appContext = context.applicationContext 10 | val dbFile = appContext.getDatabasePath("app.db") 11 | return Room 12 | .databaseBuilder( 13 | context = appContext, 14 | name = dbFile.absolutePath 15 | ).setDriver(BundledSQLiteDriver()) 16 | .setQueryCoroutineContext(Dispatchers.IO) 17 | .build() 18 | } 19 | -------------------------------------------------------------------------------- /feature/user/api/src/commonMain/kotlin/com/joohnq/api/entity/PhysicalSymptoms.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.api.entity 2 | 3 | import com.joohnq.api.property.PhysicalSymptomsProperties 4 | 5 | sealed class PhysicalSymptoms( 6 | override val id: Long, 7 | ) : PhysicalSymptomsProperties { 8 | data object YesVeryPainful : PhysicalSymptoms(YES_VERY_PAINFUL.id) 9 | 10 | data object No : PhysicalSymptoms(NO.id) 11 | 12 | data object YesJustABit : PhysicalSymptoms(YES_JUST_A_BIT.id) 13 | 14 | companion object { 15 | val YES_VERY_PAINFUL = DPhysicalSymptomsProperties(0) 16 | val NO = DPhysicalSymptomsProperties(1) 17 | val YES_JUST_A_BIT = DPhysicalSymptomsProperties(2) 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /core/database/src/jvmMain/kotlin/com/joohnq/database/driver/AppDatabaseDriverFactory.jvm.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.database.driver 2 | 3 | import app.cash.sqldelight.db.SqlDriver 4 | import app.cash.sqldelight.driver.jdbc.sqlite.JdbcSqliteDriver 5 | import com.joohnq.database.AppDatabaseSql 6 | import com.joohnq.database.AppSqlDelightDatabase 7 | import java.util.Properties 8 | 9 | actual class AppDatabaseDriverFactory { 10 | actual fun createDriver(): SqlDriver = 11 | JdbcSqliteDriver( 12 | url = "jdbc:sqlite:${AppSqlDelightDatabase.DATABASE_NAME}", 13 | properties = Properties().apply { put("foreign_keys", "true") }, 14 | schema = AppDatabaseSql.Schema 15 | ) 16 | } 17 | -------------------------------------------------------------------------------- /feature/home/impl/src/androidDebug/kotlin/com/joohnq/home/impl/components/HomeTopBarPreview.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.home.impl.components 2 | 3 | import androidx.compose.runtime.Composable 4 | import com.joohnq.api.entity.ImageType 5 | import com.joohnq.api.entity.User 6 | import com.joohnq.home.impl.ui.components.HomeTopBar 7 | import org.jetbrains.compose.ui.tooling.preview.Preview 8 | 9 | @Preview 10 | @Composable 11 | private fun Preview() { 12 | HomeTopBar( 13 | user = 14 | User( 15 | id = 1, 16 | name = "John Doe", 17 | image = "0", 18 | imageType = ImageType.DRAWABLE 19 | ), 20 | freudScore = 88 21 | ) 22 | } 23 | -------------------------------------------------------------------------------- /feature/mood/impl/src/jvmMain/kotlin/com/joohnq/mood/add/data/driver/MoodDriverFactory.jvm.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.mood.add.data.driver 2 | 3 | import app.cash.sqldelight.db.SqlDriver 4 | import app.cash.sqldelight.driver.jdbc.sqlite.JdbcSqliteDriver 5 | import com.joohnq.mood.add.data.database.MoodDatabase 6 | import com.joohnq.mood.database.MoodDatabaseSql 7 | import java.util.Properties 8 | 9 | actual class MoodDriverFactory { 10 | actual fun createDriver(): SqlDriver = 11 | JdbcSqliteDriver( 12 | url = "jdbc:sqlite:${MoodDatabase.DATABASE_NAME}", 13 | properties = Properties().apply { put("foreign_keys", "true") }, 14 | schema = MoodDatabaseSql.Schema 15 | ) 16 | } 17 | -------------------------------------------------------------------------------- /shared-resources/src/androidDebug/kotlin/com/joohnq/shared_resources/components/parameter/ShapeParameterProvider.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.shared_resources.components.parameter 2 | 3 | import androidx.compose.ui.graphics.Shape 4 | import androidx.compose.ui.tooling.preview.PreviewParameterProvider 5 | import com.joohnq.shared_resources.theme.Dimens 6 | 7 | class ShapeParameterProvider : PreviewParameterProvider { 8 | override val values = 9 | sequenceOf( 10 | Dimens.Shape.Circle, 11 | Dimens.Shape.ExtraLarge, 12 | Dimens.Shape.Large, 13 | Dimens.Shape.Medium, 14 | Dimens.Shape.Small, 15 | Dimens.Shape.ExtraSmall 16 | ) 17 | } 18 | -------------------------------------------------------------------------------- /feature/self-journal/overview/src/androidDebug/kotlin/com/joohnq/self_journal/overview/component/SelfJournalInsightItemPreview.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.self_journal.overview.component 2 | 3 | import androidx.compose.runtime.Composable 4 | import com.joohnq.self_journal.presentation.components.SelfJournalInsightItem 5 | import com.joohnq.shared_resources.theme.Colors 6 | import com.joohnq.shared_resources.theme.Drawables 7 | import org.jetbrains.compose.ui.tooling.preview.Preview 8 | 9 | @Preview 10 | @Composable 11 | private fun Preview() { 12 | SelfJournalInsightItem( 13 | count = 1, 14 | percentage = 0.5f, 15 | color = Colors.Brown80, 16 | face = Drawables.Icons.Outlined.Logo 17 | ) 18 | } 19 | -------------------------------------------------------------------------------- /feature/user/impl/src/jvmMain/kotlin/com/joohnq/user/impl/data/driver/UserDriverFactory.jvm.kt: -------------------------------------------------------------------------------- 1 | package com.joohnq.user.impl.data.driver 2 | 3 | import app.cash.sqldelight.db.SqlDriver 4 | import app.cash.sqldelight.driver.jdbc.sqlite.JdbcSqliteDriver 5 | import com.joohnq.user.database.UserDatabaseSql 6 | import com.joohnq.user.impl.data.database.UserDatabase 7 | import java.util.Properties 8 | 9 | actual class UserDriverFactory { 10 | actual fun createDriver(): SqlDriver = 11 | JdbcSqliteDriver( 12 | url = "jdbc:sqlite:${UserDatabase.DATABASE_NAME}", 13 | properties = Properties().apply { put("foreign_keys", "true") }, 14 | schema = UserDatabaseSql.Schema 15 | ) 16 | } 17 | --------------------------------------------------------------------------------