docs: add architecture plan for OpenClaw mobile app

This commit is contained in:
OpenClaw committed 2026-03-07 00:26:13 +08:00
1 parent 403a538fda
commit a017533b96
2 files changed
+547 -52

No files matched your search

+49 -52
View File
@@ -1,63 +1,60 @@
This is a Kotlin Multiplatform project targeting Android, iOS, Web.
# OpenClawApp
* [/composeApp](./composeApp/src) is for code that will be shared across your Compose Multiplatform applications.
It contains several subfolders:
- [commonMain](./composeApp/src/commonMain/kotlin) is for code that’s common for all targets.
- Other folders are for Kotlin code that will be compiled for only the platform indicated in the folder name.
For example, if you want to use Apple’s CoreCrypto for the iOS part of your Kotlin app,
the [iosMain](./composeApp/src/iosMain/kotlin) folder would be the right place for such calls.
Similarly, if you want to edit the Desktop (JVM) specific part, the [jvmMain](./composeApp/src/jvmMain/kotlin)
folder is the appropriate location.
OpenClawApp 是一个面向 **Android / iOS / Web** 的 OpenClaw 客户端,使用 **Kotlin Multiplatform + Compose Multiplatform** 构建。
* [/iosApp](./iosApp/iosApp) contains iOS applications. Even if you’re sharing your UI with Compose Multiplatform,
you need this entry point for your iOS app. This is also where you should add SwiftUI code for your project.
目标不是把 OpenClaw 整体搬到手机运行,而是提供一个稳定、好用的移动端入口:
### Build and Run Android Application
- 查看会话列表
- 与 OpenClaw 聊天
- 查看状态与默认 agent
- 后续接入推送通知
- 通过中转层(BFF)安全地连接 OpenClaw
To build and run the development version of the Android app, use the run configuration from the run widget
in your IDE’s toolbar or build it directly from the terminal:
- on macOS/Linux
```shell
./gradlew :composeApp:assembleDebug
```
- on Windows
```shell
.\gradlew.bat :composeApp:assembleDebug
```
## 当前架构方向
### Build and Run Web Application
采用三层架构:
To build and run the development version of the web app, use the run configuration from the run widget
in your IDE's toolbar or run it directly from the terminal:
- for the Wasm target (faster, modern browsers):
- on macOS/Linux
```shell
./gradlew :composeApp:wasmJsBrowserDevelopmentRun
```
- on Windows
```shell
.\gradlew.bat :composeApp:wasmJsBrowserDevelopmentRun
```
- for the JS target (slower, supports older browsers):
- on macOS/Linux
```shell
./gradlew :composeApp:jsBrowserDevelopmentRun
```
- on Windows
```shell
.\gradlew.bat :composeApp:jsBrowserDevelopmentRun
```
```text
OpenClawApp
↓
BFF / Mobile Gateway
↓
OpenClaw
```
### Build and Run iOS Application
V1 不把移动端直接做成 OpenClaw 插件/渠道,而是先做一个独立客户端。
To build and run the development version of the iOS app, use the run configuration from the run widget
in your IDE’s toolbar or open the [/iosApp](./iosApp) directory in Xcode and run it from there.
详细规划见:[`docs/ARCHITECTURE.md`](./docs/ARCHITECTURE.md)
---
## 项目结构
Learn more about [Kotlin Multiplatform](https://www.jetbrains.com/help/kotlin-multiplatform-dev/get-started.html),
[Compose Multiplatform](https://github.com/JetBrains/compose-multiplatform/#compose-multiplatform),
[Kotlin/Wasm](https://kotl.in/wasm/)…
- `composeApp/`:共享 UI 与跨平台应用代码
- `iosApp/`:iOS 宿主工程
- `docs/`:架构、接入与迭代文档
We would appreciate your feedback on Compose/Web and Kotlin/Wasm in the public Slack channel [#compose-web](https://slack-chats.kotlinlang.org/c/compose-web).
If you face any issues, please report them on [YouTrack](https://youtrack.jetbrains.com/newIssue?project=CMP).
## 开发阶段
当前阶段:
1. 建立应用骨架
2. 用 Mock 数据跑通会话/聊天/设置/状态页面
3. 再接入真实 BFF
4. 最后联通 OpenClaw
## 常用命令
### Android
```bash
./gradlew :composeApp:assembleDebug
```
### Web (Wasm)
```bash
./gradlew :composeApp:wasmJsBrowserDevelopmentRun
```
### iOS
使用 Xcode 打开 `iosApp/` 后运行。