Skip to content

Commit b7dbf41

Browse files
feat: Add ODE Desktop Application (Tauri + React) (#610)
* chore: update docs * feat: add ode desktop * wip(desktop) * chore: update ci/cd, .gitignore, docs * wip(desktop) * wip(desktop) * wip(desktop) * wip(desktop) * wip(desktop) * chore: update CSP configuration in tauri.conf.json to include frame-src and child-src directives * wip (add diagnostics) * fix: remove diagnostics code * fix(ci): install pnpm before attempting cache * fix(lint): resolve ESLint errors in desktop app * fix(format): apply Prettier formatting to desktop app * fix(rust-format): apply cargo fmt to Rust code * fix(ci): install Linux system dependencies for Tauri build * fix(ci): correct Linux package names for Tauri dependencies * fix(ci): proper pnpm setup and Linux dependencies --------- Co-authored-by: Emil Rossing <emil@rossing.org>
1 parent 2c63e37 commit b7dbf41

247 files changed

Lines changed: 38438 additions & 516 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/CICD.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -284,6 +284,27 @@ This will:
284284

285285
The `build:rn` script automatically handles cleaning, so no need to run `clean-rn-assets` separately.
286286

287+
## ODE Desktop (Tauri)
288+
289+
**Workflow file**: `.github/workflows/ode-desktop.yml`
290+
291+
### Triggers
292+
293+
- **Pull requests** and **pushes** to `main` / `dev` when files under `desktop/**` change (or the workflow file itself)
294+
- **Manual dispatch**
295+
296+
### Path filters
297+
298+
Runs only when `desktop/**` or `.github/workflows/ode-desktop.yml` changes.
299+
300+
### What it runs
301+
302+
From `desktop/`: `pnpm lint`, `pnpm format:check`, `pnpm test`, `pnpm typecheck`, `pnpm codegen:synk-client`, then **fails** if `desktop/src/generated` drifts from the regenerated OpenAPI client. From `desktop/src-tauri/`: `cargo fmt --check`, `cargo clippy -D warnings`, `cargo test`.
303+
304+
### Formplayer embed
305+
306+
After building formplayer (`npm run build` in `formulus-formplayer`), copy its `build/` into the desktop app with `pnpm copy:formplayer` from `desktop/` (see `desktop/README.md`). Copied assets are gitignored under `desktop/public/formplayer_dist/`.
307+
287308
## Future Enhancements
288309

289310
Potential improvements to the CI/CD pipeline:

.github/workflows/ode-desktop.yml

Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
name: ODE Desktop
2+
3+
on:
4+
pull_request:
5+
paths:
6+
- 'desktop/**'
7+
- '.github/workflows/ode-desktop.yml'
8+
push:
9+
branches:
10+
- main
11+
- dev
12+
paths:
13+
- 'desktop/**'
14+
- '.github/workflows/ode-desktop.yml'
15+
workflow_dispatch:
16+
17+
env:
18+
NODE_VERSION: '24'
19+
20+
jobs:
21+
desktop:
22+
name: Lint, test, and Rust checks
23+
runs-on: ubuntu-latest
24+
defaults:
25+
run:
26+
working-directory: desktop
27+
28+
steps:
29+
- name: Checkout repository
30+
uses: actions/checkout@v4
31+
32+
- name: Setup Node.js
33+
uses: actions/setup-node@v4
34+
with:
35+
node-version: ${{ env.NODE_VERSION }}
36+
37+
- name: Enable corepack and install pnpm
38+
run: |
39+
corepack enable
40+
corepack prepare pnpm@latest --activate
41+
42+
- name: Get pnpm store directory
43+
id: pnpm-cache
44+
shell: bash
45+
run: |
46+
echo "STORE_PATH=$(pnpm store path $(pnpm --version))" >> $GITHUB_OUTPUT
47+
48+
- name: Setup pnpm cache
49+
uses: actions/cache@v3
50+
with:
51+
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
52+
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
53+
restore-keys: |
54+
${{ runner.os }}-pnpm-store-
55+
56+
- name: Install dependencies
57+
run: pnpm install --frozen-lockfile
58+
59+
- name: ESLint
60+
run: pnpm lint
61+
62+
- name: Prettier
63+
run: pnpm format:check
64+
65+
- name: Vitest
66+
run: pnpm test
67+
68+
- name: Typecheck
69+
run: pnpm typecheck
70+
71+
- name: Regenerate Synkronus TypeScript client
72+
run: pnpm codegen:synk-client
73+
74+
- name: Verify generated client matches repository
75+
working-directory: ${{ github.workspace }}
76+
run: git diff --exit-code -- desktop/src/generated
77+
78+
- name: Install Linux dependencies (Tauri prerequisites)
79+
if: runner.os == 'Linux'
80+
run: |
81+
sudo apt-get update
82+
sudo apt-get install -y \
83+
libglib2.0-dev \
84+
libgtk-3-dev \
85+
libwebkit2gtk-4.1-dev \
86+
libappindicator3-dev \
87+
librsvg2-dev \
88+
patchelf \
89+
libssl-dev \
90+
pkg-config
91+
92+
- name: Install Rust toolchain
93+
uses: dtolnay/rust-toolchain@stable
94+
with:
95+
components: rustfmt, clippy
96+
97+
- name: Cargo fmt, clippy, test
98+
working-directory: desktop/src-tauri
99+
run: |
100+
cargo fmt --check
101+
cargo clippy -- -D warnings
102+
cargo test

AGENTS.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ ODE is a **clearinghouse** model: data is collected on devices, synchronized thr
1515
- **Synkronus** — Go backend: auth, sync, app bundle distribution, export, shared HTTP API.
1616
- **Synkronus Portal** — Web admin UI (React + Vite): same API as other clients; no privileged backend channel.
1717
- **Synkronus CLI**`synk` command-line client: automation, bundles, sync, export.
18+
- **ODE Desktop** — Tauri app: **Data management** + **Forms / app workbench**; source in [`desktop/`](desktop/). See [ROADMAP.md](ROADMAP.md).
1819

1920
```mermaid
2021
flowchart LR
@@ -77,8 +78,7 @@ Do not assume custom app authors have local checkouts of **ODE** or internal exa
7778

7879
Do **not** implement or assume APIs for these as if they were in-repo unless issues/specs say otherwise:
7980

80-
- **ODE Custodian** — local data stewardship and correction workflows (roadmap; often CLI-first).
81-
- **ODE Workshop** — desktop dev environment for bundles/forms (roadmap).
81+
- **ODE Desktop** — Tauri app: **Data management** and **Forms / app workbench** in one shell; see [ROADMAP.md](ROADMAP.md).
8282

8383
See [product roadmap context](https://opendataensemble.org/docs/) and organization roadmaps on [GitHub](https://github.com/OpenDataEnsemble).
8484

0 commit comments

Comments
 (0)