Skip to main content

Documentation Index

Fetch the complete documentation index at: https://tech.illasoft.com/llms.txt

Use this file to discover all available pages before exploring further.

当前状态:MVP。只实装了鉴权(Google / Apple Sign-In + 用户 profile 查询)。核心 AI 功能(Generator / Feed / Gallery / Video / Audio / Rewind)尚未实装。iOS 仅有 Xcode 工程壳,Compose UI 未集成。

目录说明

代码在仓库根 Kira/注意:大写 K),文档路径继续沿用 /kira-mobile/

技术栈

类别版本说明
Kotlin2.3.0语言
Compose Multiplatform1.9.3UI 框架
Android Gradle Plugin8.13.2
Ktor3.3.3HTTP 客户端(Android OkHttp / iOS Darwin)
Koin4.1.1DI
Supabase SDK (jan-tennert)3.2.6auth-ktpostgrest-ktcompose-auth(仅 Android)
Coil3.3.0图片加载(+ coil-network-ktor
SQLDelight2.2.1本地数据库(已配置,未实际使用)
Credentials Manager1.5.0原生 Google Sign-In
KMP NativeCoroutines1.0.0iOS Swift interop (StateFlow)
Android min SDK24target SDK 36,Kotlin JVM 11

模块结构

Kira/
├── composeApp/              # Android 应用主模块
│   └── src/
│       ├── androidMain/     # Android 平台 UI + DI 装配
│       └── androidUnitTest/
├── shared/                  # KMP 共享库
│   └── src/
│       ├── commonMain/      # 跨平台:网络 / 数据 / Domain / ViewModel / Koin
│       ├── androidMain/     # Android 平台实现:Ktor OkHttp + Koin Android
│       └── iosMain/         # iOS 平台实现:Ktor Darwin
└── iosApp/                  # Xcode 原生壳(目前无 Compose UI 集成)

架构

MVVM + Clean Architecture
  • PresentationAuthViewModel(Lifecycle 2.9.6)+ AuthState / AuthEvent sealed classes
  • Domain — 接口层(AuthRepository
  • Data — 实现 + API client(AuthRepositoryImplUserApi
  • Core — 网络(ApiClientSupabaseProvider)+ 配置
DI:Koin 4.1.1
coreModule       → Supabase + HttpClient
dataModule       → UserApi + AuthRepositoryImpl
presentationModule → ViewModels
入口:MainActivity.initKoin() 组合 appModules

路由

  • 自定义 if-else Composable( Voyager / Compose Navigation)
  • 当前仅 MainScreenLoginScreen 两屏切换

已实装的功能

  • Google Sign-In(Android Credential Manager 原生 → fallback 到 Supabase Web OAuth)
  • Apple Sign-In(iOS 通过 Supabase ASWebAuthenticationSession
  • GET /user/profile 查询展示 ProfileDto

网络层

  • ApiClient(shared/commonMain)含 ContentNegotiation + Logging
  • baseUrl = "https://api.kira.art"(硬编码;可通过 BuildKonfig 的 DEBUG_API_URL / RELEASE_API_URLlocal.properties 覆盖)
  • 请求 timeout 30s,连接 timeout 15s
  • JWT 自动刷新:Supabase currentAccessTokenOrNull() → 401 时 refreshCurrentSession() → 重试 3 次
  • 失败:sessionExpired: SharedFlow<Unit> emit → UI 强制登出

鉴权实现

Android Credential Manager

GoogleSignInHelper.signIn()
  → androidx.credentials.CredentialManager
  → GoogleIdTokenCredential (webClientId=133759969213-...apps.googleusercontent.com)
  ↓ 成功
  Supabase.SignInWithGoogleIdToken(idToken, nonce)
  ↓ 失败 / 用户无凭证
  Supabase.SignInWithGoogle()  // Web OAuth
  • Debug:poisson.art
  • Release:kira.art
  • schemes.json + MainActivity.onNewIntent() 处理回调

Supabase

  • URL:https://base.kira.art
  • Anon Key:sb_publishable_61zxmN9KGCaMgf7qjq4eBQ_tXITHX_f(publishable,可接受硬编码)

环境配置(BuildKonfig + local.properties)

# AppConfig (硬编码)
supabaseUrl = "https://base.kira.art"
supabaseAnonKey = "sb_publishable_..."
appLinkHost = "poisson.art" (debug) / "kira.art" (release)

# BuildKonfig(从 local.properties 读,可覆盖)
DEBUG_API_URL = "https://api.kira.art"
RELEASE_API_URL = "https://api.kira.art"

构建 / 发布

  • 包名:com.kira.art
  • versionCode = 1,versionName = “1.0”
  • 无 CI workflow.github/workflows/ 缺失)
  • 无 Fastlane、无 TestFlight / Play Internal Testing 自动化
  • 本地手动构建

尚未实装的能力(路线图)

相较 kira-web,以下模块尚未在移动端实装
  • ❌ AI Agent 对话(SSE)/ ::::poisson-function 消息格式
  • ❌ Generator 工作区(图片 / 视频 / 音频)
  • ❌ Pixi / Canvas 编辑
  • ❌ Feed / Gallery / Timeline / Rewind
  • ❌ 移动端 Notification (FCM / APNS)
  • ❌ Centrifugo WebSocket
  • ❌ i18n 多语言
  • ❌ PostHog 埋点
  • ❌ Sentry 错误追踪
  • ❌ Apple IAP / Google Play Billing
  • ❌ CSAM 错误 UI 提示

相关