chore: 初始化 Windows-Gotify-Client-Rust 项目骨架

使用 Rust + Slint 重建一个轻量、现代、Windows 原生体验良好的 Gotify
桌面客户端。本次只搭目录骨架与占位文件,未进入 Phase 1(Bootstrap)。

本次提交内容
------------
- 保留 AGENTS.md(1363 行定制 Agent 实施计划,含 8 阶段路线图)
- 新建 Cargo.toml([package] 元数据 + AGENTS.md §44 依赖模板 + §42
  release profile;无 [[bin]],等 Phase 1 才加 src/main.rs)
- 新建 README.md(项目导览,引用 AGENTS.md)
- 新建 .gitignore(Rust / Slint / Windows / IDE / 密钥)
- 新建 LICENSE(MIT 占位)
- 按 AGENTS.md §4 建好全部 10 个目录,每个空目录放 .gitkeep:
    assets/        assets/fonts/
    ui/            scripts/
    src/           src/gotify/
    src/storage/   src/windows/
    src/services/  tests/

未提交(Phase 1 起才落地)
------------------------
- src/main.rs 及所有 .rs 业务代码
- ui/*.slint 视图
- scripts/build-release.ps1 等构建脚本
- Cargo.lock(当前 Cargo.toml 是占位、无可编译代码)

技术栈约束(来自 AGENTS.md §1 / §2)
------------------------------------
- Rust stable + Slint 1.17.x + Windows 10/11
- 显式禁用:Tauri / Wails / Electron / WebView2 / WPF / WinUI 3 / Node 运行时
- 单一主程序,无浏览器运行时依赖;UI 由 Slint 原生渲染

仓库
----
远程:https://gitea.kennethcheng.cc/KennethCheng/Windows-Gotify-Client-Rust
This commit is contained in:
2026-09-19 04:02:51 +08:00
commit a3a6a7c91d
15 changed files with 2429 additions and 0 deletions
+53
View File
@@ -0,0 +1,53 @@
# --- Rust / Cargo ---
/target/
**/*.rs.bk
Cargo.lock.bak
# Keep Cargo.lock tracked once a real build exists in Phase 1.
# Until then, an empty Cargo.toml exists and no lockfile is produced.
# --- Slint build artifacts ---
ui/*.slint.bak
*.slint~
# --- Windows / IDE / OS ---
.vs/
.vscode/
.idea/
*.user
*.suo
*.sdf
*.opensdf
*.cachefile
*.VC.db
*.VC.opendb
# OS junk
Thumbs.db
ehthumbs.db
ehthumbs_vista.db
.DS_Store
Desktop.ini
$RECYCLE.BIN/
# --- Local config / state ---
# The runtime config + state files live under %APPDATA%/WindowsGotify/
# and are NEVER inside the repo. The list below is just a defensive net.
*.local.json
*.local.toml
config.local.*
state.local.*
# --- Logs ---
*.log
logs/
# --- Secrets ---
.env
.env.*
*.pem
*.key
# --- UPX / packing artifacts ---
*.upx
packed/
+2236
View File
File diff suppressed because it is too large Load Diff
+53
View File
@@ -0,0 +1,53 @@
# Placeholder Cargo.toml — actual configuration is finalized in Phase 1 (Bootstrap).
# See AGENTS.md §44 (dependency rationale) and §42 (release profile) for guidance.
#
# Until Phase 1 lands:
# - No [[bin]] / src/main.rs is declared yet, so `cargo build` is a no-op.
# - The dependency list below is a copy of the AGENTS.md template;
# versions will be verified against the locked Rust toolchain in Phase 1.
# - No Cargo.lock will be committed until a real build exists.
[package]
name = "windows-gotify-client-rust"
version = "0.1.0"
edition = "2021"
rust-version = "1.75"
description = "Lightweight, modern, Windows-native Gotify desktop client (Rust + Slint)"
license = "MIT"
readme = "README.md"
authors = ["KennethCheng <a1478925630@163.com>"]
[dependencies]
# --- UI ---
slint = "1.17"
# --- Serialization ---
serde = { version = "1", features = ["derive"] }
serde_json = "1"
# --- Networking (blocking HTTP + plain WebSocket, no full async runtime yet) ---
reqwest = { version = "0.12", default-features = false, features = ["blocking", "json", "rustls-tls"] }
tungstenite = "0.21"
url = "2"
# --- Logging ---
tracing = "0.1"
tracing-subscriber = "0.3"
# --- Error handling ---
anyhow = "1"
thiserror = "2"
# Windows-only focused crates are added on demand in Phase 6 (Windows Integration).
# Do not import the umbrella `windows` crate wholesale — see AGENTS.md §1.
[profile.release]
opt-level = "z"
lto = true
codegen-units = 1
panic = "abort"
strip = true
[profile.release-balanced]
inherits = "release"
opt-level = 3
+21
View File
@@ -0,0 +1,21 @@
MIT License
Copyright (c) 2026 KennethCheng
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
+66
View File
@@ -0,0 +1,66 @@
# Windows-Gotify-Client-Rust
轻量、现代、Windows 原生体验良好的 Gotify 桌面客户端,使用 **Rust + Slint** 构建。
> 详细的产品定位、技术栈约束、架构、UI 规范与分阶段实施计划全部记录在 [`AGENTS.md`](./AGENTS.md)。本文档只做项目导览。
## 状态
🚧 **从 0 起步** —— 当前仓库只有目录骨架与占位 `Cargo.toml`,尚未进入 Phase 1(Bootstrap)。
完整 8 阶段路线图见 `AGENTS.md` §57。
## 目标平台
- Windows 10 x64
- Windows 11 x64(ARM64 条件允许时支持)
- 后台常驻、托盘型客户端
## 技术栈
| 层 | 选型 |
|---|---|
| 语言 | Rust stable |
| UI | Slint 1.17.x |
| HTTP | `reqwest`(blocking + rustls) |
| WebSocket | `tungstenite` |
| Windows 集成 | `windows-rs` focused crates(按需引入) |
| 配置 / 状态 | JSON 文件(`%APPDATA%/WindowsGotify/`) |
| 日志 | `tracing` + `tracing-subscriber` |
显式禁用:Tauri / Wails / Electron / WebView2 / WPF / WinUI 3 / Node 运行时。
理由见 `AGENTS.md` §2。
## 仓库布局
```
Windows-Gotify-Client-Rust/
├── Cargo.toml # 占位 — 见 AGENTS.md §44
├── AGENTS.md # AI Agent 实施计划(1363 行)
├── README.md
├── LICENSE # MIT(占位)
├── .gitignore
├── assets/ # 图标、字体等
├── ui/ # Slint 视图
├── src/ # Rust 业务代码
│ ├── gotify/ # HTTP + WebSocket
│ ├── storage/ # config.json / state.json
│ ├── windows/ # 托盘 / Toast / 启动 / 单实例 / URL
│ └── services/ # 生命周期
├── tests/ # 集成测试
└── scripts/ # PowerShell 构建脚本
```
## 开发环境
> 本仓库目前还没有源码,本节将在 Phase 1 完成后补全具体的 `cargo run` / `cargo build --release` 步骤。
## 隐私与安全
- App Token 默认以 JSON 明文存储在 `%APPDATA%/WindowsGotify/config.json`,仅当前用户可访问
- 日志永不打印完整 `Authorization` 头
- 通知点击的 `click.url` 仅允许 `http://` / `https://`,拒绝 `file://` / `javascript:` / 自定义 scheme
- 详细策略见 `AGENTS.md` §13 / §20 / §38 / §51
## License
MIT(见 [LICENSE](./LICENSE))。
View File
View File
View File
View File
View File
View File
View File
View File
View File
View File