Skip to content

Conversation

@dogmania
Copy link
Member

@dogmania dogmania commented Jan 3, 2026

이슈 번호

작업내용

  • :app에 MainActivity를 추가하고 진입점으로 설정했습니다.
  • LoginActivity와 Manifest를 제거하고 임시 LoginScreen 컴포저블을 추가했습니다.
  • LoginNavGraph, LoginModule을 구현했습니다.
  • Application Class의 koin 초기화 로직을 개선했습니다.
  • 상단바를 제거하는 theme를 적용했습니다.
  • targetSdk가 누락되어 경고창이 뜨는 것을 해결했습니다.

리뷰어에게 추가로 요구하는 사항 (선택)

멀티 모듈에서 koin을 활용하는 방법을 이 pr에서 최대한 구현해 봤습니다. 추후에 구현하시는 feature 모듈마다 NavGraphContributor 구현체를 만들고 di 패키지에서 koin 모듈을 만들면 됩니다. 다음으로는 이 koin 모듈을 :app에 존재하는 FeatureModules에 추가해주세요.

현재 :feature:login에 뷰모델이 없기 때문에 뷰모델 관련된 di 코드가 추가되지 않은 상태인데, NavGraphContributor를 koin 모듈에 등록하듯이 LoginViewModel을 koin 모듈에 추가해주시면 됩니다.

val loginModule = module {
    viewModelOf(::LoginViewModel)    // 뷰모델 Koin 등록
    single<NavGraphContributor>(named("LoginNavGraph")) { LoginNavGraph }
}

뷰모델 Koin 등록은 위와 같이 해주시면 됩니다.

@dogmania dogmania requested a review from chanho0908 January 3, 2026 08:09
@dogmania dogmania self-assigned this Jan 3, 2026
@dogmania dogmania added the Refactor Good for newcomers label Jan 3, 2026
@coderabbitai
Copy link

coderabbitai bot commented Jan 3, 2026

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

🗂️ Base branches to auto review (2)
  • main
  • develop

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Member

@chanho0908 chanho0908 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

현수 고생했어 ! 궁금한거랑 몇 가지 수정할거 남겨봤어 :)

Comment on lines 5 to 6
import org.koin.android.ext.koin.androidContext
import org.koin.core.context.startKoin
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

요긴 사용되고있지 않는 것 같아! 👀

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

네 import 지웠습니다!

import org.koin.core.module.Module

fun initKoin(
context: Context? = null,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Context가 nullable 이유가 혹시 있을까 ?

지금은 TwixApplication에서만 호출되서 nullable이지 않아도 괜찮을 것 같은데 어떤 확장성을 고려한걸까 ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CMP로 데스크탑까지 확장하게 되면 Jvm 환경에서는 context가 없어서 일단 nullable로 뒀습니다!

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

오호 대박 그건 몰랐네 👍

import org.koin.dsl.module

val loginModule = module {
single<NavGraphContributor>(named("LoginNavGraph")) { LoginNavGraph }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

혹시 하드코딩된 qualifier를 사용한 이유가 있을까 ?

내가 이해하기엔 class로 각각의 Feature들의 NavGraph를 고유하게 만들어서
qualifier가 필요하지 않을까란 생각이 들어서 ! 🙂

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

koin이 기본적으로 타입을 키로 활용해서 의존성을 관리합니다. 저희는 feature 모듈마다 NavGraphContributor를 만들어 등록하는 구조라 같은 타입이 여러 개 생길 수밖에 없는데, qualifier가 없으면 koin 입장에서는 서로 다른 그래프를 구분할 수 없습니다.

single<NavGraphContributor> { LoginNavGraph }
single<NavGraphContributor> { HomeNavGraph }

예를 들어 이렇게 두개를 등록하면 등록 단계에서 키가 충돌하고 결과적으로 컨테이너에 등록된 Graph는 하나만 남게 돼요. named는 같은 타입의 NavGraph들을 구분하기 위한 용도로 활용합니다.

하드코딩된 값들은 Graph마다 route가 있으니 이걸 활용해서 개선하면 될 거 같아요!

import com.twix.navigation.NavRoutes
import com.twix.navigation.base.NavGraphContributor

object LoginNavGraph: NavGraphContributor {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

요건 단순히 궁금증인데 object로 선언한 이유가 궁금해 ! 😃

내가 생각하기에 어차피 KoinSingleton으로 등록하기 때문에
일반 class든 object든 크게 상관 없을거라고 생각하긴 하는데 현수의 생각도 궁금해서 !

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

지금 NavGraph는 내부 상태 없이 순수하게 정해진 그래프만 등록하는 역할이에요. 그래서 여러 인스턴스를 만들 필요도 없고 여러 인스턴스를 생성하는 게 가능할 필요도 없다고 생각해요.

class로 구현하는 게 불가능한 건 아니지만 class로 구현하면 모듈에 등록하는 과정에서 누군가는 인스턴스 생성을 책임져야 해요. 그리고 이론상 여러곳에서 인스턴스를 생성하는 게 가능해지기 때문에 종합적으로 고려했을 때 class보다는 object로 구현하는 게 맞다고 판단했습니다!

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

그렇구나 그런 이유라면 너무 좋은 것 같아 ! 😄

Copy link
Member Author

@dogmania dogmania left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

import 제거했고 qualifier NavRoute로 수정했습니다!

Comment on lines 5 to 6
import org.koin.android.ext.koin.androidContext
import org.koin.core.context.startKoin
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

네 import 지웠습니다!

import org.koin.core.module.Module

fun initKoin(
context: Context? = null,
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CMP로 데스크탑까지 확장하게 되면 Jvm 환경에서는 context가 없어서 일단 nullable로 뒀습니다!

import org.koin.dsl.module

val loginModule = module {
single<NavGraphContributor>(named("LoginNavGraph")) { LoginNavGraph }
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

koin이 기본적으로 타입을 키로 활용해서 의존성을 관리합니다. 저희는 feature 모듈마다 NavGraphContributor를 만들어 등록하는 구조라 같은 타입이 여러 개 생길 수밖에 없는데, qualifier가 없으면 koin 입장에서는 서로 다른 그래프를 구분할 수 없습니다.

single<NavGraphContributor> { LoginNavGraph }
single<NavGraphContributor> { HomeNavGraph }

예를 들어 이렇게 두개를 등록하면 등록 단계에서 키가 충돌하고 결과적으로 컨테이너에 등록된 Graph는 하나만 남게 돼요. named는 같은 타입의 NavGraph들을 구분하기 위한 용도로 활용합니다.

하드코딩된 값들은 Graph마다 route가 있으니 이걸 활용해서 개선하면 될 거 같아요!

import com.twix.navigation.NavRoutes
import com.twix.navigation.base.NavGraphContributor

object LoginNavGraph: NavGraphContributor {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

지금 NavGraph는 내부 상태 없이 순수하게 정해진 그래프만 등록하는 역할이에요. 그래서 여러 인스턴스를 만들 필요도 없고 여러 인스턴스를 생성하는 게 가능할 필요도 없다고 생각해요.

class로 구현하는 게 불가능한 건 아니지만 class로 구현하면 모듈에 등록하는 과정에서 누군가는 인스턴스 생성을 책임져야 해요. 그리고 이론상 여러곳에서 인스턴스를 생성하는 게 가능해지기 때문에 종합적으로 고려했을 때 class보다는 object로 구현하는 게 맞다고 판단했습니다!

Copy link
Member

@chanho0908 chanho0908 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

고생했어 현수야 ! 🏊 🏊 🏊

import org.koin.core.module.Module

fun initKoin(
context: Context? = null,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

오호 대박 그건 몰랐네 👍

import com.twix.navigation.NavRoutes
import com.twix.navigation.base.NavGraphContributor

object LoginNavGraph: NavGraphContributor {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

그렇구나 그런 이유라면 너무 좋은 것 같아 ! 😄

@chanho0908 chanho0908 merged commit 42e2dd1 into feat/#20-navigation-base Jan 3, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Refactor Good for newcomers

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants