Share
Embed
KMP + Supabase: 1인 개발의 새로운 패러다임
주최: Kotlin User Group Seoul
행사: Kotlin Multiplatform Meetup
날짜: 2025-12-21
제목: KMP + Supabase: 1인 개발의 새로운 패러다임
Yeojun Yoon
December 21, 2025
Transcript
43 slides
-
Kotlin User Groups Seoul Kotlin Multiplatform Meetup ਮৈળ NAVER Android
Developer yjyoon-dev KMP + Supabase 1ੋ ѐߊ ࢜۽ ಁ۞ -
Kotlin User Groups Seoul 1ੋ ѐߊ ߷ दр ࠗ ೡ
ೠ҅ + दр ױ୷ ೡ ഛ + दр ହ ೡ ୡਘ = ??? -
Kotlin User Groups Seoul Supabase ۆ? • য়ࣗझ ӝ߈ BaaS
( Backend as a Service) ۖಬ • Auth, DB, Storage, API, etc. • like Firebase + Kotlin Multiplatform ਗ! -
Kotlin User Groups Seoul supabase-kt A Kotlin Multiplatform client for
Supabase https://github.com/supabase-community/supabase-kt -
Kotlin User Groups Seoul supabase-kt A Kotlin Multiplatform client for
Supabase • द द ܴ SupaCompose ۽ KMP ਗ ߂ CMP о٘ ઁҕ • Android / Desktop ਵ۽ दೞৈ JS → iOS → Wasm ࣽਵ۽ ഛ • റ Supabase ҕध о٘ ޙࢲ ١ -
Kotlin User Groups Seoul ۽Ӓੋ ҳഅೞӝ গ ۽Ӓੋ ೠ ߣب
উ ೧ࠌחؘ… • ࢎ٘ ۽ં ױ୶ = ࣗ࣍ ۽Ӓੋ • AppStore ଼ ࢚ ࣗ࣍ ۽Ӓੋ ઁҕ द গ ۽Ӓੋ ҳഅ ࣻ! • Supabase ח Google, Apple, Kakao ١ਸ ನೣ೧ ড 20ѐ ࣗ࣍ ۽Ӓੋ ۖಬ ਗ • Google ߂ Apple ۽Ӓੋী ೠ೧ ֎౭࠳ ߑध ਗ -
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() } } / / . . . } } -
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) -
Kotlin User Groups Seoul ۖಬ ߹ ֎౭࠳ ۽Ӓੋ ҳഅ ۖಬ
߹ ۽Ӓੋ ߡౡ ҳഅ when (platform) { Platform.Android -> { Button(onClick = { googleSignInAction.startFlow() }) { ProviderButtonContent(Google) } } Platform.iOS - > { Button(onClick = { appleSignInAction.startFlow() }) { ProviderButtonContent(Apple) } } } -
Kotlin User Groups Seoul Ӓ ৻ ۖಬ ۽Ӓੋ য় ۽Ӓੋب
֍ਸېਃ • Google ߂ Apple ਸ ઁ৻ೠ ఋ ۖಬ ۽Ӓੋ ࠳ۄ ܻ۩ ߑध • ۽Ӓੋ द ӝࠄ ࠳ۄо ৌܻѱ غחؘ, ח AppStore ٣ੋ о٘ ଼ ਤ߈ • п ۖಬ ߹ ੋজ ࠳ۄܳ ࢎਊೞب۾ ೞח Ѫ best practice • Android Custom Tabs / iOS SFSafariViewController -
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 } } } }} -
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) } } } }} -
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 ױীࢲ ۽Ӓੋ ࣻ೯ ߂ ੋૐ ৈࠗ ഛੋ -
Kotlin User Groups Seoul Ӓ ৻ ੋૐ ҙ۲ ӝמٜ •
ࣗ࣍ ۽Ӓੋ ৻ীب Phone ߂ E - Mail ਸ ਊೠ ۽Ӓੋ ӝמ ਗ • ز ۽Ӓੋ ӝמ ղ • Android / iOS ࡺ݅ ইפۄ JVM / JS / Wasm ب ৮߷ ਗ -
Kotlin User Groups Seoul DB Supabase ೨ब ࢲ࠺झ •
Supabase ח PostgreSQL ӝ߈ DB ܳ ઁҕ • DB ࢸ҅ח ۄ ѐߊٜীѱ ߷ • ৻ېః, ੋؙझ, RLS ١١… • ী ੜ ޅ ࢸ҅ೞݶ աী غجܻӝب ൨ٝ → Supabase AI Assistant ۽ ೧Ѿ! -
Kotlin User Groups Seoul DB with AI Assistant “ җ
э ӝמਸ ыח ध ݫ ୶ୌ ࢲ࠺झܳ ٜ݅Ѣঠ • ࢎਊо ݡ धਸ ইஜ, ब, ֘ ߹۽ ӝ۾ೡ ࣻ • ࢎਊח જইೞח धҗ फযೞח धਸ ࢸೡ ࣻ • ࢎਊח धࢎ ӝ۾җ ध ࢶഐبܳ ߄ఔਵ۽ ݫܳ ୶ୌ ߉ ࢲ࠺झী ਃೠ DB ܳ ࢸ҅ೞҊ ࢤࢿ೧. ٸ, п ప࠶ ߹۽ ೠ INDEX ৬ RLS ଼ب ࢸ೧. ” -
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) / / ۞Ӓੋ ୶о } } } -
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 } } -
Kotlin User Groups Seoul Room ӝ߈ ۽ஸ ࢲ࠺झ ݃Ӓۨ࣌ য়ۄੋ
জਸ ৡۄੋ জਵ۽ ജ೧ࠁ “ ইېח Android / KMP ۽ં ٘ীࢲ Room DB ۽ ࢿػ Entity ٘ঠ. ܳ Supabase DB ۽ ݃Ӓۨ࣌ ೧. (Room DB ٘) ” -
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>() } -
Kotlin User Groups Seoul Edge functions ࠂೠ ࠺ૉפझ ۽ ҳഅী
ೠ ೧Ѿ଼ • ਗѺীࢲ प೯ೡ ࣻ ח ೣࣻ ઑп • ݃ AWS Lambda + API Gateway • ࣛীࢲ पदр ഐ ۽Ӓ ഛੋ оמ • KMP জীࢲ ഐೡ ࢲߡ API ೡ -
Kotlin User Groups Seoul Edge functions with AI Assistant ࠂೠ
࠺ૉפझ ۽ ҳഅী ೠ ೧Ѿ଼ “ ࢎਊীѱ അ о ୶ୌغח ध ݫܳ ߈ജೞח API ܳ Edge Functions ۽ ٜ݅য. ୶ୌೞח ӝળ ইې৬ эই. • ݡ য়ېػ धੌࣻ۾ ୶ୌ ഛܫ ૐо • ࢎਊо જইೞח ध ୶ୌ ഛܫ ૐо • धࢎ ٸ ݡ धҗ э పҊܻ ध ୶ୌ ഛܫ хࣗ ৻ীب ցо ࢤпೞח જ ӝળ ݶ ୶о೧ ” -
Kotlin User Groups Seoul Edge functions with AI Assistant ࠂೠ
࠺ૉפझ ۽ ҳഅী ೠ ೧Ѿ଼ • ۽ં झః݃ܳ ഛੋೞҊ ୶ୌী ഝਊೡ ࣻ ח ప࠶ਸ ঌইࢲ ੋध • ࢜۽ ୶ୌ ઑѤ ਊ • ҅ী ٮܲ ݫ ߹ о / ୭Ӕ ୶ୌী ನೣػ ध ಁօ౭ • ੋૐ ߂ য়ܨ ҙ۲ ۽ ਊ • KMP জীࢲ ই ۽Ӓੋೞ ঋ ࢚కীࢲ ഐ द ੋૐ য়ܨ • ҳഅ ٘ח TypeScript ӝ߈ -
Kotlin User Groups Seoul { “limit”: 3 } Edge functions
with AI Assistant ࠂೠ ࠺ૉפझ ۽ ҳഅী ೠ ೧Ѿ଼ POST /food-recommendations Request Response { “result”: [{ “foodId”: “uuid”, “name”: “ࠛҊӝ”, “score”: 0.82 }] } -
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 ۞Ӓੋ ࢸ -
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 ) -
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>() -
Kotlin User Groups Seoul Realtime पदр ӝמ ҳഅ •
पदр DB ӝמ ઁҕਵ۽ ӝמ ҳഅ ١ী ࢎਊ • Firebase Realtime Database ৬ ਬࢎ • ҳةೠ DB ী ೠ पदр ߸ചܳ Flow ۽ ߈ജ → ܖ౯ ച • അ KMP ജ҃ীࢲ पदр ӝמਸ ҳഅೞח о ए ߑߨ -
Kotlin User Groups Seoul Storage ੌ ࣗ • ৬
э ੌী ೠ ࣗ ӝמਵ۽ AWS S3 ৬ ਬࢎ • ࢎਊ ۽ ١җ э স۽٘ ӝמ ҳഅ https://supabase.com/docs/reference/kotlin/storage-from-upload -
Kotlin User Groups Seoul Supabase Free Plan ഌ ے! •
50,000 MAU ө ழߡ оמ • ޖઁೠ Edge Functions API ਃ • DB 500MB ઁҕ • Storage 1GB ઁҕ • ױ, ୭ 2ѐ ۽ં ࢤࢿ оמ • 1ੌ ࢚ ࢎਊ হਵݶ ۽ં ੌद -
Kotlin User Groups Seoul ݽݾ ध ݫ ୶ୌ ࢲ࠺झ https://github.com/yjyoon-dev/momokzi-kmp
• धࢎ दр ߹ ݫ ୶ୌ • ध ݫ ࢶഐب ࢸ • ݡ ध ݫ ӝ۾ • धणҙ ా҅ ઑഥ • धࢎ दр ߹ ಹद ঌܿ -
Kotlin User Groups Seoul Kotlin Multiplatform Meetup ਮৈળ NAVER Android
Developer yjyoon-dev хࢎפ KMP + Supabase: 1ੋ ѐߊ ࢜۽ ಁ۞