docs: 项目文档与协作规范

This commit is contained in:
AndyChen1024
2026-09-14 21:10:44 +08:00
parent ec19d3bf98
commit ae763ae3a1
3 changed files with 169 additions and 0 deletions

57
README.md Normal file
View File

@@ -0,0 +1,57 @@
# ios-client
SwiftUI + MVVM 单向数据流的 iOS「打卡/习惯追踪」客户端,采用 SPM 多 target 模块化,架构对齐 Android NIA(`core/*` + `feature/*`)。
## 架构
```
App(组合根)──► feature/* ──► core/*
│
└──► CoreRepository ──► CoreNetwork / CoreDatabase / CoreDomain
```
依赖单向无环,由 SPM target 依赖天然强制(import 不到即编不过)。
## 模块
| 模块 | 职责 |
|---|---|
| CoreModel | 领域模型(叶子,`Sendable` 值类型)|
| CoreCommon | 通用工具(日志等)|
| CoreDomain | Repository 协议 + UseCase(纯 Swift)|
| CoreRepository | Repository 实现(Fake / OfflineFirst)|
| CoreNetwork | DTO + URLSession APIClient |
| CoreDatabase | SwiftData(`@Model` + `ModelContainer`)|
| DesignSystem | 设计 tokens(颜色/间距/圆角)|
| CoreUI | 可复用 SwiftUI 组件 |
| FeatureHome | 首页(打卡列表)|
| FeatureAuth | 登录 / 我的(占位)|
| App | 组合根(DI + 导航)|
## 环境要求
- Xcode 26.6+
- iOS 17.0+(`@Observable` / SwiftData 下限)
## 构建
```bash
xcodebuild -project ios-client.xcodeproj -scheme ios-client \
-destination 'generic/platform=iOS Simulator' \
CODE_SIGNING_ALLOWED=NO build
```
## Lint
```bash
brew install swiftlint # 首次
swiftlint lint
```
## 目录与协作规范
见 [CLAUDE.md](CLAUDE.md) 与 [CONTRIBUTING.md](CONTRIBUTING.md)。
## License
[MIT](LICENSE)