Lock in $30 Savings on PRO—Offer Ends Soon! ⏳

KMP + Supabase: 1인 개발의 새로운 패러다임

KMP + Supabase: 1인 개발의 새로운 패러다임

주최: Kotlin User Group Seoul
행사: Kotlin Multiplatform Meetup
날짜: 2025-12-21
제목: KMP + Supabase: 1인 개발의 새로운 패러다임

Avatar for Yeojun Yoon

Yeojun Yoon

December 21, 2025
Tweet

More Decks by Yeojun Yoon

Other Decks in Technology

Transcript

  1. Kotlin User Groups Seoul Kotlin Multiplatform Meetup ਮৈળ NAVER Android

    Developer yjyoon-dev KMP + Supabase 1ੋ ѐߊ੄ ࢜۽਍ ಁ۞׮੐
  2. Kotlin User Groups Seoul 1ੋ ѐߊ੄ ੢߷ दр ࠗ઒ ৉ೡ

    ೠ҅ + दр ױ୷ ৉ೡ ഛ੢ + दр ହ୹ ৉ೡ ୡਘ = ???
  3. Kotlin User Groups Seoul Supabase ۆ? • য়೑ࣗझ ӝ߈੄ BaaS

    ( Backend as a Service) ೒ۖಬ • Auth, DB, Storage, API, etc. • like Firebase + Kotlin Multiplatform ૑ਗ!
  4. Kotlin User Groups Seoul supabase-kt A Kotlin Multiplatform client for

    Supabase https://github.com/supabase-community/supabase-kt
  5. Kotlin User Groups Seoul supabase-kt A Kotlin Multiplatform client for

    Supabase • ୐ ୹द ׼द ੉ܴ਷ SupaCompose ۽ KMP ૑ਗ ߂ CMP о੉٘ ઁҕ • Android / Desktop ਵ۽ द੘ೞৈ JS → iOS → Wasm ࣽਵ۽ ഛ੢ • ੉റ Supabase ҕध о੉٘ ޙࢲ ١੤
  6. Kotlin User Groups Seoul ۽Ӓੋ ҳഅೞӝ গ೒ ۽Ӓੋ਷ ೠ ߣب

    উ ೧ࠌחؘ… • ࢎ੉٘ ೐۽ં౟੄ ୐ ױ୶ = ࣗ࣍ ۽Ӓੋ • AppStore ੿଼ ࢚ ࣗ࣍ ۽Ӓੋ ઁҕ द গ೒ ۽Ӓੋ ҳഅ ೙ࣻ! • Supabase ח Google, Apple, Kakao ١ਸ ನೣ೧ ড 20ѐ੄ ࣗ࣍ ۽Ӓੋ ೒ۖಬ ૑ਗ • Google ߂ Apple ۽Ӓੋী ೠ೧ ֎੉౭࠳ ߑध ૑ਗ
  7. Kotlin User Groups Seoul ೒ۖಬ ߹ ֎੉౭࠳ ۽Ӓੋ ҳഅ supabase

    client ࢤࢿ ߂ native login ࢸ੿ val supabaseModule = module { single { createSupabaseClient( supabaseUrl = SUPABASE_URL, supabaseKey = SUPABASE_KEY ) { install(ComposeAuth) { googleNativeLogin(serverClientId = GOOGLE_CLIENT_ID) appleNativeLogin() } } / / . . . } }
  8. Kotlin User Groups Seoul ೒ۖಬ ߹ ֎੉౭࠳ ۽Ӓੋ ҳഅ ۽Ӓੋ

    ௒ߔ ੿੄ ߂ ۽Ӓੋ composable function ࢶ঱ val supabaseClient = koinInject<SupabaseClient>() val onResult: (NativeSignInResult) -> Unit = { result -> when (result) { is NativeSignInResult.Success - > { / * login success */ } is NativeSignInResult.Error - > { / * login error */ } is NativeSignInResult.Network - > { / * network error */ } is NativeSignInResult.ClosedByUser - > { / * canceled by user */ } } } val googleSignInAction = supabaseClient.composeAuth.rememberSignInWithGoogle(onResult) val appleSignInAction = supabaseClient.composeAuth.rememberSignInWithApple(onResult)
  9. Kotlin User Groups Seoul ೒ۖಬ ߹ ֎੉౭࠳ ۽Ӓੋ ҳഅ ೒ۖಬ

    ߹ ۽Ӓੋ ߡౡ ҳഅ when (platform) { Platform.Android -> { Button(onClick = { googleSignInAction.startFlow() }) { ProviderButtonContent(Google) } } Platform.iOS - > { Button(onClick = { appleSignInAction.startFlow() }) { ProviderButtonContent(Apple) } } }
  10. Kotlin User Groups Seoul Ӓ ৻ ೒ۖಬ ۽Ӓੋ ஠஠য় ۽Ӓੋب

    ֍ਸېਃ • Google ߂ Apple ਸ ઁ৻ೠ ఋ ೒ۖಬ ۽Ӓੋ਷ ࠳ۄ਋੷ ܻ׮੉۩౟ ߑध • ۽Ӓੋ द ӝࠄ ࠳ۄ਋੷о ৌܻѱ غחؘ, ੉ח AppStore ٣੗ੋ о੉٘ ੿଼ ਤ߈ • п ೒ۖಬ ߹ ੋজ ࠳ۄ਋੷ܳ ࢎਊೞب۾ ೞח Ѫ੉ best practice • Android ੄ Custom Tabs / iOS ੄ SFSafariViewController
  11. Kotlin User Groups Seoul ੋজ ࠳ۄ਋੷۽ ۽Ӓੋೞӝ UrlLauncher ழझథ ҳഅ

    ઁҕ val supabaseModule = module { single { createSupabaseClient( supabaseUrl = SUPABASE_URL, supabaseKey = SUPABASE_KEY ) { / / . . . install(Auth) { host = REDIRECT_URL_HOST scheme = REDIRECT_URL_SCHEME urlLauncher = UrlLauncher { _, url -> / / should open url using in-app browser } } } }}
  12. Kotlin User Groups Seoul ੋজ ࠳ۄ਋੷۽ ۽Ӓੋೞӝ KInAppBrowser ੸ਊ https://github.com/yjyoon-dev/KInAppBrowser

    val supabaseModule = module { single { createSupabaseClient( supabaseUrl = SUPABASE_URL, supabaseKey = SUPABASE_KEY ) { / / . . . install(Auth) { host = REDIRECT_URL_HOST scheme = REDIRECT_URL_SCHEME urlLauncher = UrlLauncher { _, url -> KInAppBrowser.open(url) } } } }}
  13. Kotlin User Groups Seoul ੋজ ࠳ۄ਋੷۽ ۽Ӓੋೞӝ val sessionStatus by

    supabaseClient.auth.sessionStatus.collectAsStateWithLifecycle() // login success when sessionStatus is SessionStatus.Authenticated coroutineScope.launch { supabaseClient.auth.signInWith(Kakao) supabaseClient.auth.signInWith(Discord) supabaseClient.auth.signInWith(Slack) // . . . } override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) supabaseClient.handleDeepLinks(intent) { userSession - > / / login success / / navigate to HomeScreen } } UI ױীࢲ ۽Ӓੋ ࣻ೯ ߂ ੋૐ ৈࠗ ഛੋ
  14. Kotlin User Groups Seoul Ӓ ৻ ੋૐ ҙ۲ ӝמٜ •

    ࣗ࣍ ۽Ӓੋ ৻ীب Phone ߂ E - Mail ਸ ੉ਊೠ ۽Ӓੋ ӝמ ૑ਗ • ੗ز ۽Ӓੋ ӝמ ղ੢ • Android / iOS ࡺ݅ ইפۄ JVM / JS / Wasm ب ৮߷ ૑ਗ
  15. Kotlin User Groups Seoul DB Supabase ੄ ೨ब ࢲ࠺झ •

    Supabase ח PostgreSQL ӝ߈ DB ܳ ઁҕ • DB ࢸ҅ח ௿ۄ੉঱౟ ѐߊ੗ٜীѱ ௾ ੢߷ • ৻ېః, ੋؙझ, RLS ١١… • ୊਺ী ੜ ޅ ࢸ҅ೞݶ ա઺ী غجܻӝب ൨ٝ → Supabase AI Assistant ۽ ೧Ѿ!
  16. Kotlin User Groups Seoul DB with AI Assistant “ ׮਺җ

    э਷ ӝמਸ ыח ਺ध ݫ׏ ୶ୌ ࢲ࠺झܳ ٜ݅Ѣঠ • ࢎਊ੗о ݡ਷ ਺धਸ ইஜ, ੼ब, ੷֘ ߹۽ ӝ۾ೡ ࣻ ੓਺ • ࢎਊ੗ח જইೞח ਺धҗ फযೞח ਺धਸ ࢸ੿ೡ ࣻ ੓਺ • ࢎਊ੗ח धࢎ ӝ۾җ ਺ध ࢶഐبܳ ߄ఔਵ۽ ݫ׏ܳ ୶ୌ ߉਺ ੉ ࢲ࠺झী ೙ਃೠ DB ܳ ࢸ҅ೞҊ ࢤࢿ೧઻. ੉ٸ, п ప੉࠶ ߹۽ ੸੺ೠ INDEX ৬ RLS ੿଼ب ࢸ੿೧઻. ”
  17. Kotlin User Groups Seoul KMP জীࢲ DB ੽Ӕೞӝ Supabase client

    ࢤࢿ द Postgrest ೒۞Ӓੋ ࢸ੿ val supabaseModule = module { single { createSupabaseClient( supabaseUrl = SUPABASE_URL, supabaseKey = SUPABASE_KEY ) { install(Auth) { / * . . . */ } install(ComposeAuth) { /* . . . */ } install(Postgrest) / / ೒۞Ӓੋ ୶о } } }
  18. Kotlin User Groups Seoul KMP জীࢲ DB ੽Ӕೞӝ supabase-kt postgrest

    CRUD ৘ઁ DB ప੉࠶ झః݃ ё୓ ࢤࢿ @Serializable data class Food( val id: Long val name: String ) // create supabaseClient.from(“foods”).insert(food) // read supabaseClient.from(“foods”).select().decodeList<Food>() // update supabaseClient.from(“foods”).update(food) { filter { Food : : id eq food.id } } // delete supabaseClient.from(“foods”).delete { filter { Food : : id eq food.id } }
  19. Kotlin User Groups Seoul Room ӝ߈ ۽ஸ ࢲ࠺झ ݃੉Ӓۨ੉࣌ য়೐ۄੋ

    জਸ ৡۄੋ জਵ۽ ੹ജ೧ࠁ੗ “ ইېח Android / KMP ೐۽ં౟ ௏٘ীࢲ Room DB ۽ ੘ࢿػ Entity ௏٘ঠ. ੉ܳ Supabase ੄ DB ۽ ݃੉Ӓۨ੉࣌ ೧઻. (Room DB ௏٘) ”
  20. Kotlin User Groups Seoul Room ӝ߈ ۽ஸ ࢲ࠺झ ݃੉Ӓۨ੉࣌ য়೐ۄੋ

    জਸ ৡۄੋ জਵ۽ ੹ജ೧ࠁ੗ internal class RoomDataSource( private val foodDao: FoodDao ) : DataSource { override suspend fun getFoods(): Result<List<Food >> = runCatching { foodDao.getFoods() } internal class SupabaseDataSource( private val supabaseClient: SupabaseClient ) : DataSource { override suspend fun getFoods(): Result<List<Food >> = runCatching { supabaseClient.from(“foods”).select().decodeList<Food>() }
  21. Kotlin User Groups Seoul Edge functions ࠂ੟ೠ ࠺ૉפझ ۽૒ ҳഅী

    ؀ೠ ೧Ѿ଼ • ਗѺীࢲ प೯ೡ ࣻ ੓ח ೣࣻ ઑп • ݃஖ AWS ੄ Lambda + API Gateway • ௑ࣛীࢲ पदр ഐ୹ ۽Ӓ ഛੋ оמ • KMP জীࢲ ഐ୹ೡ ࢲߡ API ৉ೡ
  22. Kotlin User Groups Seoul Edge functions with AI Assistant ࠂ੟ೠ

    ࠺ૉפझ ۽૒ ҳഅী ؀ೠ ೧Ѿ଼ “ ࢎਊ੗ীѱ അ੤ о੢ ୶ୌغח ਺ध ݫ׏ܳ ߈ജೞח API ܳ Edge Functions ۽ ٜ݅য઻. ୶ୌೞח ӝળ਷ ইې৬ эই. • ݡ਷૑ য়ېػ ਺धੌࣻ۾ ୶ୌ ഛܫ ૐо • ࢎਊ੗о જইೞח ਺ध਷ ୶ୌ ഛܫ ૐо • ੉੹ धࢎ ٸ ݡ਷ ਺धҗ э਷ ஠పҊܻ੄ ਺ध਷ ୶ୌ ഛܫ хࣗ ੉ ৻ীب ցо ࢤпೞח જ਷ ӝળ੉ ੓׮ݶ ੸੺൤ ୶о೧઻ ”
  23. Kotlin User Groups Seoul Edge functions with AI Assistant ࠂ੟ೠ

    ࠺ૉפझ ۽૒ ҳഅী ؀ೠ ೧Ѿ଼ • ೐۽ં౟ झః݃ܳ ഛੋೞҊ ୶ୌী ഝਊೡ ࣻ ੓ח ప੉࠶ਸ ঌইࢲ ੋध • ࢜۽਍ ୶ୌ ઑѤ ੸ਊ • ҅੺ী ٮܲ ݫ׏ ߹ о઺஖ / ୭Ӕ ୶ୌী ನೣػ ਺ध਷ ಁօ౭ • ੋૐ ߂ য়ܨ ҙ۲ ۽૒ ੸ਊ • KMP জীࢲ ই૒ ۽Ӓੋೞ૑ ঋ਷ ࢚కীࢲ ഐ୹ द ੋૐ য়ܨ • ҳഅ ௏٘ח TypeScript ӝ߈
  24. Kotlin User Groups Seoul { “limit”: 3 } Edge functions

    with AI Assistant ࠂ੟ೠ ࠺ૉפझ ۽૒ ҳഅী ؀ೠ ೧Ѿ଼ POST /food-recommendations Request Response { “result”: [{ “foodId”: “uuid”, “name”: “ࠛҊӝ”, “score”: 0.82 }] }
  25. Kotlin User Groups Seoul KMP জীࢲ Edge functions ഐ୹ೞӝ val

    supabaseModule = module { single { createSupabaseClient( supabaseUrl = SUPABASE_URL, supabaseKey = SUPABASE_KEY ) { install(Auth) { / * . . . */ } install(ComposeAuth) { /* . . . */ } install(Postgrest) { / * . . . */ } install(Functions) / / ೒۞Ӓੋ ୶о } } } Supabase client ࢤࢿ द Functions ೒۞Ӓੋ ࢸ੿
  26. Kotlin User Groups Seoul suspend fun example(request: ExampleRequest) = runCatching

    { supabaseClient.functions.invoke( function = “food-recommendations”, body = request, ).body<ExampleResponse>() KMP জীࢲ Edge functions ഐ୹ೞӝ ਃ୒ / ਽׹ ௿ېझ Edge Functions ੉ܴਸ ా೧ ഐ୹ @Serializable data class ExampleRequest( val limit: Int ) @Serializable data class ExampleResponse( val foodId: String val name: String val score: Float )
  27. Kotlin User Groups Seoul KMP জীࢲ Edge functions ഐ୹ೞӝ ӝઓ੄

    Postgrest ܳ ੉ਊೠ DB ઑ੘ Edge Functions ۽ ݃੉Ӓۨ੉࣌ supabaseClient.from(“foods”).update( { Food :: name setTo food.name }, ) { filter { Food :: id eq food.id } } supabaseClient.functions.invoke( function = “update-food-name”, body = request, ).body<UpdateFoodNAmeResponse>()
  28. Kotlin User Groups Seoul Realtime पदр ଻౴ ӝמ ҳഅ •

    पदр DB ӝמ ઁҕਵ۽ ଻౴ ӝמ ҳഅ ١ী ࢎਊ • Firebase ੄ Realtime Database ৬ ਬࢎ • ҳةೠ DB ী ؀ೠ पदр ߸ചܳ Flow ۽ ߈ജ → ௏ܖ౯ ஘ച੸ • അ੤ KMP ജ҃ীࢲ पदр ଻౴ ӝמਸ ҳഅೞח о੢ ए਍ ߑߨ
  29. Kotlin User Groups Seoul Storage ੿੸ ౵ੌ ੷੢ࣗ • ੉޷૑৬

    э਷ ੿੸ ౵ੌী ؀ೠ ੷੢ࣗ ӝמਵ۽ AWS ੄ S3 ৬ ਬࢎ • ࢎਊ੗ ೐۽೙ ੉޷૑ ١җ э਷ ੉޷૑ স۽٘ ӝמ ҳഅ https://supabase.com/docs/reference/kotlin/storage-from-upload
  30. Kotlin User Groups Seoul Supabase Free Plan ഌ੗ ೒ے੉׮! •

    50,000 MAU ө૑ ழߡ оמ • ޖઁೠ Edge Functions API ਃ୒ • DB 500MB ઁҕ • Storage 1GB ઁҕ • ױ, ୭؀ 2ѐ ೐۽ં౟ ࢤࢿ оמ • 1઱ੌ ੉࢚ ࢎਊ੉ হਵݶ ೐۽ં౟ ੌद੿૑
  31. Kotlin User Groups Seoul ݽݾ૑ ਺ध ݫ׏ ୶ୌ ࢲ࠺झ https://github.com/yjyoon-dev/momokzi-kmp

    • धࢎ दр؀ ߹ ݫ׏ ୶ୌ • ਺ध ݫ׏ ࢶഐب ࢸ੿ • ݡ਷ ਺ध ݫ׏ ӝ۾ • धणҙ ా҅ ઑഥ • धࢎ दр؀ ߹ ಹद ঌܿ
  32. Kotlin User Groups Seoul Kotlin Multiplatform Meetup ਮৈળ NAVER Android

    Developer yjyoon-dev хࢎ೤פ׮ KMP + Supabase: 1ੋ ѐߊ੄ ࢜۽਍ ಁ۞׮੐