Skip to content

Commit 629c99f

Browse files
authored
feat: add desktop app (#3)
1 parent 058c4b9 commit 629c99f

133 files changed

Lines changed: 10609 additions & 35 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/ci.yml

Lines changed: 79 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,87 @@ env:
88
CARGO_TERM_COLOR: always
99

1010
jobs:
11-
check:
11+
rust-lint:
12+
name: Rust Lint
1213
runs-on: ubuntu-latest
1314
timeout-minutes: 30
15+
permissions:
16+
contents: read
1417
steps:
1518
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
16-
- uses: dtolnay/rust-toolchain@631a55b12751854ce901bb631d5902ceb48146f7 # stable
17-
with:
18-
components: rustfmt, clippy
19+
- uses: cashapp/activate-hermit@e49f5cb4dd64ff0b0b659d1d8df499595451155a # v1
1920
- uses: Swatinem/rust-cache@ad397744b0d591a723ab90405b7247fac0e6b8db # v2
20-
- run: cargo fmt --all -- --check
21-
- run: cargo clippy --workspace --all-targets -- -D warnings
22-
- run: cargo test --workspace
23-
- run: cargo install cargo-audit --locked
24-
- run: cargo audit --ignore RUSTSEC-2023-0071 --ignore RUSTSEC-2024-0384
25-
- run: cargo install cargo-deny --locked
26-
- run: cargo deny check
21+
- name: Format check
22+
run: just fmt-check
23+
- name: Clippy
24+
run: just clippy
25+
26+
unit-tests:
27+
name: Unit Tests
28+
runs-on: ubuntu-latest
29+
timeout-minutes: 30
30+
permissions:
31+
contents: read
32+
steps:
33+
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
34+
- uses: cashapp/activate-hermit@e49f5cb4dd64ff0b0b659d1d8df499595451155a # v1
35+
- uses: Swatinem/rust-cache@ad397744b0d591a723ab90405b7247fac0e6b8db # v2
36+
- name: Unit tests
37+
run: just test-unit
38+
39+
desktop:
40+
name: Desktop
41+
runs-on: ubuntu-latest
42+
timeout-minutes: 45
43+
permissions:
44+
contents: read
45+
steps:
46+
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
47+
- uses: cashapp/activate-hermit@e49f5cb4dd64ff0b0b659d1d8df499595451155a # v1
48+
- uses: Swatinem/rust-cache@ad397744b0d591a723ab90405b7247fac0e6b8db # v2
49+
with:
50+
workspaces: desktop/src-tauri
51+
- name: Install Tauri dependencies (Linux)
52+
env:
53+
DEBIAN_FRONTEND: noninteractive
54+
run: |
55+
sudo apt-get update \
56+
-o Acquire::Retries=3 \
57+
-o Acquire::http::Timeout=30 \
58+
-o Acquire::https::Timeout=30
59+
sudo apt-get install -y --no-install-recommends \
60+
-o Acquire::Retries=3 \
61+
-o Acquire::http::Timeout=30 \
62+
-o Acquire::https::Timeout=30 \
63+
-o DPkg::Lock::Timeout=120 \
64+
build-essential \
65+
curl \
66+
file \
67+
libayatana-appindicator3-dev \
68+
libgtk-3-dev \
69+
librsvg2-dev \
70+
libssl-dev \
71+
libwebkit2gtk-4.1-dev \
72+
libxdo-dev \
73+
patchelf \
74+
wget
75+
- name: Install desktop dependencies
76+
run: just desktop-install-ci
77+
- name: Desktop lint and format
78+
run: just desktop-check
79+
- name: Desktop build
80+
run: just desktop-build
81+
- name: Desktop Tauri check
82+
run: just desktop-tauri-check
83+
84+
security:
85+
name: Security
86+
runs-on: ubuntu-latest
87+
timeout-minutes: 20
88+
permissions:
89+
contents: read
90+
steps:
91+
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
92+
- uses: cashapp/activate-hermit@e49f5cb4dd64ff0b0b659d1d8df499595451155a # v1
93+
- name: Dependency policy
94+
run: cargo-deny check

CONTRIBUTING.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,11 @@ unacceptable behavior to **conduct@sprout-relay.org**.
3939
| Tool | Version | Notes |
4040
|------|---------|-------|
4141
| Rust | 1.88+ | Install via [rustup](https://rustup.rs/) |
42+
| Node.js | 24+ | Required for desktop app commands and `just ci` |
43+
| pnpm | 10+ | Required for desktop app commands and `just ci` |
4244
| Docker | 24+ | For MySQL, Redis, Typesense |
4345
| `just` | latest | Task runner — `cargo install just` |
46+
| `lefthook` | latest | Optional; run `lefthook install` for local Git hooks |
4447
| `sqlx-cli` | latest | Optional; `just migrate` falls back to `docker exec` |
4548

4649
This repo uses [Hermit](https://cashapp.github.io/hermit/) for toolchain
@@ -68,6 +71,9 @@ cp .env.example .env
6871

6972
# 4. Start infrastructure + run migrations
7073
just setup
74+
75+
# 5. Install Git hooks (optional, recommended)
76+
lefthook install
7177
```
7278

7379
`just setup` starts Docker services (MySQL on `:3306`, Redis on `:6379`,
@@ -134,7 +140,7 @@ Before opening a PR, run the full CI gate locally:
134140

135141
```bash
136142
just ci
137-
# Runs: fmt-check + clippy + unit tests
143+
# Runs: check + unit tests + desktop build + Tauri check
138144
```
139145

140146
This is the same check that runs in CI. PRs that fail `just ci` will not be

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ members = [
1414
"crates/sprout-admin",
1515
"crates/sprout-workflow",
1616
]
17+
exclude = ["desktop/src-tauri"]
1718
resolver = "2"
1819

1920
[workspace.package]

README.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ Set `SPROUT_PRIVATE_KEY` (nsec format) to use a persistent identity.
193193

194194
## Development
195195

196-
**Prerequisites:** Rust 1.88+, Docker, [`just`](https://github.com/casey/just)
196+
**Prerequisites:** Rust 1.88+, Docker, Node.js 24+, pnpm 10+, [`just`](https://github.com/casey/just)
197197

198198
This repo uses [Hermit](https://cashapp.github.io/hermit/) for toolchain pinning. Activate with:
199199

@@ -206,11 +206,15 @@ This repo uses [Hermit](https://cashapp.github.io/hermit/) for toolchain pinning
206206
```bash
207207
just setup # Start Docker services + run migrations
208208
just relay # Run the relay (dev mode)
209-
just build # Build entire workspace
210-
just check # fmt-check + clippy
209+
just build # Build the Rust workspace
210+
just desktop-install # Install desktop dependencies
211+
just desktop-dev # Run the desktop web UI only
212+
just desktop-app # Run the Tauri desktop app
213+
just desktop-ci # Desktop check + build + Tauri Rust check
214+
just check # Rust fmt/clippy + desktop check
211215
just test-unit # Unit tests (no infra required)
212216
just test # All tests (starts services if needed)
213-
just ci # fmt-check + clippy + unit tests (CI gate)
217+
just ci # check + unit tests + desktop build + Tauri check
214218
just migrate # Run pending migrations
215219
just down # Stop Docker services (keep data)
216220
just reset # ⚠️ Wipe all data and recreate environment

bin/.lefthook-2.1.3.pkg

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
hermit

bin/.node-24.14.0.pkg

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
hermit

bin/.pnpm-10.31.0.pkg

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
hermit

bin/.rustup-1.28.2.pkg

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
hermit

bin/cargo

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
.rust@1.88.pkg
1+
.rustup-1.28.2.pkg

0 commit comments

Comments
 (0)