paw-gui/src-tauri/README.md
2025-04-14 19:17:53 +08:00

37 lines
2.0 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# Paw GUi
Paw 的 GUI 客户端,基于 Tauri 构建。
有关系统服务部分,请看其[独立的文档](./system-service/README.md),有关整体、前端和构建,请看[上一级的文档](../README.md)
## 项目结构
- capabilities/ 用于管理窗口组的权限,请看[文档](https://v2.tauri.app/reference/acl/capability/)
- icons/ 软件使用的图标
- rust-toolchain.toml 固定工具链版本
- rustfmt.toml 格式化方案
- **tauri.config.json tauri 框架的配置文件,后期可能根据操作系统拆分成三个文件,注意其中的 `build` 选项**
- build.rs 构建脚本
- system-service 用于管理系统服务,是独立的 package内含三个 crate
- common 存放一些公共的代码,所有 crate 都依赖它
- install-scripts 打包时需要用的脚本包含win、linux和macos的脚本
- src/
- main.rs 二进制 crate 入口文件,一般不需要修改
- lib.rs 真正的程序入口
- cmds.rs 前端可以调用的指令,其中功能指向具体实现模块
- core/ 与核心交互模块
- service/ 与系统服务交互模块
## 第三方库依赖
- [tauri](https://v2.tauri.app/): 基础应用框架
- [serde](https://serde.rs/) & serde_json: 序列化/反序列化框架
- [specta](https://docs.rs/specta/2.0.0-rc.20/specta/index.html) & specta-typescript: 将 Rust 类型生成为 ts 类型
- [tauri-specta](https://docs.rs/tauri-specta/2.0.0-rc.20/tauri_specta/index.html) 生成 `bindings.ts` 中的 command、event 和类型代码,**请使用这个库来创建需要传输的类型、command 和 event**
- [reqwest](https://docs.rs/reqwest/latest/reqwest/) HTTP客户端
- [anyhow](https://github.com/dtolnay/anyhow) 简化错误处理
- [tracing](https://docs.rs/tracing/latest/tracing/) 日志门面库
- [tracing-subscriber](https://docs.rs/tracing-subscriber/latest/tracing_subscriber/) 日志实现库
- [tokio](https://tokio.rs/tokio/tutorial) 异步运行时,也包含了很多异步实用工具
- [elevated-command](https://crates.io/crates/elevated-command) 用于提权安装系统服务