模块清单
May 21, 2026 · View on GitHub
app/components
| 路径 | 类型 | 说明 |
|---|---|---|
| common/ | 通用组件 | Modal、Toast、列表通用项、Loading 等 |
| widget/ | 业务组件 | 用户卡片、仓库卡片、Issue 卡片、PullLoadMoreListView 等 |
*.js | Page | Login/My/Person/Repository/Issue/Search 等屏幕级组件 |
维护原则:新增页面统一放根目录;可复用 UI 沉淀进 widget/;纯 UI 组件入 common/。
app/store
- store/index.js:使用
createStore + applyMiddleware(thunk)。 - reducers/:按域拆分 (event/issue/login/repository/user)。
- actions/:thunk action creators。
- reducerUtils.js:
createReducer辅助。 - type.js:action type 常量。
app/dao(数据访问 + 业务整合层)
| 文件 | 作用 |
|---|---|
| db/index.js | Realm schema 定义(仓库 pulse、已读历史、分支、commit、watcher、star、fork…) |
| eventDao.js | 用户动态、关注动态 |
| issueDao.js | Issue / Notification |
| repositoryDao.js | 仓库详情、文件、分支、提交 |
| userDao.js | 用户、登录、Token、关注关系 |
app/net
- net/index.js:fetch 封装、统一鉴权 / 重试 / GraphQL 请求。
- net/address.js:API 地址常量。
- net/qiniu/:图片上传 SDK。
app/utils
| 文件 | 作用 |
|---|---|
| actionUtils.js | 跨页交互工具:刷新桥接、分享、Right Btn 等 |
| backUtils.js | Android 返回键管理 |
| eventUtils.js | 动态事件文案 |
| filterUtils.js | 搜索过滤 |
| htmlUtils.js | Markdown / 代码 HTML 渲染 |
| issueUtils.js | issue 工具 |
| timeUtil.js | 时间转化 |
| trending/ | Trending 抓取 |
| pulse/ | 仓库 Pulse 解析 |
app/navigation
- AppNavigator.js:Stack/Tab/Drawer 配置。
- Actions.js:兼容旧 router-flux API 的桥接层。
- NavigationService.js:脱离组件触发跳转。
app/style
- constant.js:颜色、尺寸、刷新事件常量。
- i18n.js:i18next 初始化。
- index.js:通用 StyleSheet。
- lottie/:动画资源。
原生
- Android:MainActivity.java、MainApplication.java。
- iOS:AppDelegate.h、AppDelegate.m、Podfile。