# QupleA tiny "call someone by username" desktop app built around[Jitsi Meet](https://jitsi.org). Modeled on [quintodrome](../quintodrome), itwraps a web app in a [Tauri](https://tauri.app) shell β but instead of hostinga local sidecar server, it points at a hosted (or self-hosted) Jitsi Meetdeployment and uses a minimal central service to let two users find eachother and agree on a meeting room.## How it works1. **Sign in.** Everything is behind a Quine account at[login.quineglobal.com](https://login.quineglobal.com), Quine's Keycloak(the realm `public`, where anyone can sign up; Quple is its OIDC client`quple`). The app opens the sign-in page in the system browser. YourQuine username is what people call you by.**Contacts** are kept per person on the signaling server.2. **Presence.** While the app is open, it polls the signaling server everyfew seconds, which doubles as "I'm online" and "did anyone call me?".3. **Calling.** You call someone by username, on whichever Jitsi Meetserver you like: meet.jit.si by default, or any other deployment (theapp remembers the last one you used). Jitsi servers need no credentialsfrom Quple, so nothing is set up on them. The signaling server mints ameeting ID and your app opens a window at `<jitsi>/<meeting-id>`.4. **Receiving.** The callee's app sees the pending invite on its next poll,shows an "Incoming call from X on <server>" prompt, and β if accepted βopens the same meeting URL on the caller's chosen server. Jitsi Meet'sown WebRTC signaling (XMPP + the videobridge) takes it from there;Quple's server never touches media or call content, it only introducestwo clients to the same room name.5. **Ringing.** The caller doesn't join the Jitsi room untilthe call is answered: it shows "Calling bob" and sends heartbeats(`/calls/{id}/heartbeat`). The callee's phone rings for 45 s, checkingthe call meanwhile (`GET /calls/{id}`, which isn't answering) andstopping if the caller cancels. Answering opens the callee's call screen,whose first heartbeat tells the caller's app, which joins the room then.Declining or ringing out hangs up, and the caller's app goes back to"bob didn't answer"; so it does after 60 s with no answer at all (thecallee's app wasn't open). An invite for a call that's already beenhung up isn't delivered.**Every device rings.** Each of the callee's devices (iPhone, Mac) getsthe invite on its own `/poll?device=β¦`, once; one that opens within theinvite's 2 minutes still rings. The first to answer has the call, andthe others, checking `GET /calls/{id}?device=β¦` while they ring, see`answeredOn` ("Answered on your iPhone") and stop without hanging up.Declining on any of them declines the call.**Crossed calls.** If you call someone who is already ringing you (youboth pressed call at once, or you call back instead of answering), theserver doesn't open a second room: your `/call` answers their call onyour device and returns its meeting and Jitsi server with`"joined": true`, and your app goes straight into it. Their ringingscreen sees the answer as usual, and your other devices stop ringing("Answered on your Mac"). A call that was hung up or has run outdoesn't count: calling back then rings as a new call.**Calling yourself** (typing your own username), from your Mac to youriPhone or back: your other devices ring, not the one calling. Theserver tells the two sides apart by device rather than username (thecaller's device is the caller's side; the other device that answers isthe callee's), so apps send their device with `/call`, `/hangup` and`GET /calls/{id}`, and `peerEnded` says which side hung up (`endedBy`is you either way). Such a call can't be moved.6. **Ending.** Jitsi doesn't end a call when the other side leaves, so theiPhone app's call screen does, on any Jitsi server([`mobile/src/watchdog.ts`](mobile/src/watchdog.ts)). Every 3 s it sendsa heartbeat to the signaling server, which answers whether the otherside hung up (or declined) and when their call screen last sent one, andit watches who's in the Jitsi room. It ends the call when the other sidehangs up, hasn't answered after 60 s, or is gone from both the room andthe server (45 s), and rejoins (remounts the Jitsi SDK) when it never gotinto the room or the other side is in the call but not in its room.Quple's server being down never ends a call Jitsi is still carrying.Hanging up, declining or letting it ring out sends `/hangup`, so theother app ends too.The desktop app does the same with a copy of the watchdog(`desktop/src/watchdog.js`, tested with `node --testdesktop/test/*.test.mjs`). Its meeting window is plain web content withno access to the app, so a script injected into it reports the room(joined, how many others, from Jitsi's `window.APP`) through the pagetitle, which the app reads (`desktop/src-tauri/src/lib.rs`). Closingthat window, or Jitsi's hang-up button, hangs up, and the window closes.Jitsi's red button is always a plain hang-up, on both apps: no "Leave /End meeting for all" menu, since hanging up already ends the call onboth sides (desktop: the injected script; iPhone:`mobile/patches/@jitsi+react-native-sdk+*.patch`, applied bypatch-package on `npm install`). Each call starts with the mic andcamera on or off as they were at the end of the last one, on thatdevice (Quple's own muting for a move, and iOS turning the camera offin the background, don't count).7. **Calls while Quple is closed.** Without VoIP push (a paid Appleaccount), the iPhone app only rings while it's open. So when a call isplaced to someone whose app hasn't polled in the last 10 s, the serveralso publishes "alice is calling. Open Quple to answer." to their ownntfy topic on ntfy.quineglobal.com (`quple_<random>`, made on first use,kept in `DATA_DIR`; petersweb-infra `docs/NTFY.md`), and "Missed callfrom alice" if alice gives up first. The ntfy app shows it even whenQuple is closed; tapping it opens Quple (`com.quineglobal.quple://call`),which polls and rings as usual. The caller's app waits 100 s instead of60 for such a call (`/call` answers `"notified": true`). The ntfy iPhoneapp has no subscribe links, so at launch, until you've said you did it,the iPhone app walks you through subscribing (install ntfy, then itstopic and server with copy buttons; **Notifications** on the home screenbrings it back).8. **Moving a call.** Each app has a device ID (kept for good: the iPhone'sin AsyncStorage, the Mac's in its webview's localStorage), sent withevery heartbeat. The first device to send one holds your side of thecall. While it lasts, your other devices see it on their next poll(`/poll?device=β¦` lists it once answered): "In a call with bob on youriPhone β Move to this Mac". Moving (`POST /calls/{id}/move`) makes thatdevice the holder and joins the same Jitsi room from it; the old one'snext heartbeat answer says `movedTo`, so it mutes at once (the two may beside by side) and, once the new one reports it's in the room(`movedJoined`), leaves without hanging up. Bob sees you drop out andcome back for a moment; his app keeps the call, since it goes by yourusername. It works both ways, but the device you move to has to haveQuple open (no VoIP push).Every request to the signaling server carries a Quine access token; theserver takes the caller's username (the token's `preferred_username`) fromit, never from the request, and only accepts access tokens issued to Quple(`typ` Bearer, `azp` quple).meet.jit.si only starts a meeting once a signed-in user joins, so when thechosen server is meet.jit.si the app offers to sign you in to it (once; it'sremembered).```Caller's Quple Signaling server Callee's Quple-------------- ---------------- --------------POST /call -----> mint meetingId,{to, jitsiUrl}queue invite for "to"<----- {meetingId, jitsiUrl}open window:<jitsiUrl>/<id>GET /poll<----- (polling every ~3s)return queued invite ----->show "Incoming callfrom X on <server>"accept -> open window:<jitsiUrl>/<id>```Both windows are now just two independent visitors to the same Jitsi Meetroom β the same as if they'd both manually opened`https://meet.jit.si/quple-abc123` and shared the link.## Layout```quple/βββ server/ # Go: the minimal central signaling serviceβββ desktop/ # Tauri desktop app (the thing each user runs); the UI isβ # Preact + htm, vendored, so there's no frontend buildβββ jitsi-meet/ # Upstream jitsi-meet source, as its own git clone (ignored# here; reference only, not built as part of this app β# see below)```### Why `jitsi-meet/` isn't builtQuple doesn't build or serve jitsi-meet's frontend itself. It just navigatesa window to a room URL on *some* Jitsi Meet deployment, the same way abrowser tab would. By default that's the public `meet.jit.si`, which requiresno infrastructure at all. Running your own deployment needs Prosody (XMPP),Jicofo, and JVB in addition to the web frontend in this repo β that's aseparate, heavier project (see jitsi-meet's own `doc/quick-install.md` and`docker-compose` setup). The source is vendored here so it's easy to build acustom/branded frontend later; once one is running, just type its URL as theserver when calling (or make it the signaling server's `DEFAULT_JITSI`).## Running itRequires Go 1.25+.### 1. Quine sign-inNothing to run: Quple uses login.quineglobal.com(`https://login.quineglobal.com/realms/public`), where the `quple` client isset up by petersweb-infra (`nixos/keycloak/public-realm.nix`, docs/LOGIN.md).Self-hosting later means any OIDC provider with a public client `quple`that allows PKCE and a `http://127.0.0.1/callback` redirect on any port,issues `preferred_username` as a username like login.quineglobal.com's(3-32 of a-z, 0-9, `.`, `_`, `-`), and offers`offline_access`; Keycloak does all of that.### 2. Signaling server```shcd servergo run . # listens on :8080; set ADDR to change it````ISSUER` (default `https://login.quineglobal.com/realms/public`) is theidentity server whose access tokens it accepts and `CLIENT_ID` (default`quple`) the app they must be issued to. Every endpoint needs `Authorization: Bearer <access token>`.`DEFAULT_JITSI` (default `https://meet.jit.si`) hosts calls that don't name aserver, and `DATA_DIR` holds contacts and notification topics. `NTFY_URL` and`NTFY_TOKEN` (one that may publish to `quple_*` topics) turn on callnotifications for closed apps; without them there are none.**Deploying** (meet.quineglobal.com) works like our other services: a pushto `main` that touches `server/` runs `.forgejo/workflows/deploy.yml`, whichtests it, builds `server/Containerfile` as`forge.in.quineglobal.com/quine-global/quple-server` and opens apetersweb-infra PR bumping its pinned digest (`nixos/quple/default.nix`).Merging the PR deploys it. Restarting clears presence and any in-flightinvites; contacts are kept in `DATA_DIR`.### Local signaling server```sh(cd server && ADDR=127.0.0.1:8090 go run .)```Then in the app's **Advanced settings** set the signaling server to`http://127.0.0.1:8090`. It still signs in at login.quineglobal.com.### 3. Desktop appRequires a Rust toolchain (pinned via `desktop/rust-toolchain.toml`,installed automatically by `rustup`) and, on Linux, the system WebViewpackages Tauri needs (`webkit2gtk-4.1`, `gtk3`, `libappindicator3`,`librsvg2` β see [Tauri's Linux prerequisites](https://v2.tauri.app/start/prerequisites/)).On this machine those aren't installed at the OS level (it's an immutable/atomic distro), so build it the same way quintodrome does for Linux: insidethe `flatpak-builder` distrobox, or via `rpm-ostree install` + reboot if youwant it on the host directly. macOS and Windows need no extra systempackages beyond Xcode CLT / the MSVC Build Tools.```shcd desktop/src-tauricargo run```On first launch you'll land on **Sign in with Quine**, which finishes in yourbrowser and comes back to the app (RFC 8252: a one-shot listener on`127.0.0.1`). The refresh token is kept in the app's data dir, readable onlyby you; the webview only ever sees short-lived access tokens. The identityand signaling server URLs are under **Advanced settings**, and later the gearicon. The Jitsi server for a call is picked on the main screen.To build a standalone app bundle:```shcd desktop/src-tauricargo tauri build```#### Updates and releases (macOS)Like Quintodrome's, the Mac app updates itself with[Sparkle](https://sparkle-project.org/) through[tauri-plugin-sparkle-updater](https://crates.io/crates/tauri-plugin-sparkle-updater):**Quple βΊ Check for Updatesβ¦**, a background check at every launch, andSparkle's daily one. Sparkle shows its native "A new version is available"window and installs the update itself (`desktop/src-tauri/src/updater.rs`).- **Building locally:** `bash desktop/scripts/download-sparkle.shdesktop/src-tauri` once (Sparkle.framework and its tools, git-ignored),then `cd desktop && SPARKLE_FRAMEWORK_PATH=$PWD/src-tauri npx@tauri-apps/cli@2 build`. Sparkle only runs in the packaged `.app`, not`cargo run`.- **Releasing:** `git tag -a v1.2.3 -m "What's new" && git push originv1.2.3`. `.forgejo/workflows/desktop.yml` builds both architectures on theMac runner, publishes the Forgejo release (downloadable throughgit.quineglobal.com), and writes the Homebrew cask (`brew install --caskquine-global/tap/quple`) and one Sparkle appcast per architecture(`appcasts/quple-<arch>.xml`) into quine-global/homebrew-tap. The tag'smessage is the release notes, shown in Sparkle's update window.- **Signing:** each update zip is signed with an Ed25519 key; the public halfis `SUPublicEDKey` in `desktop/src-tauri/Info.plist`, the private half the`SPARKLE_PRIVATE_KEY` Actions secret. It's Quintodrome's and Hyper's key(the login Keychain's `hyper` account, backed up in 1Password as "HyperSparkle update signing key"); the appcasts are separate, so no app isoffered another's updates. Pushing to the tap needs the`HOMEBREW_TAP_SSH_KEY` secret, a key with write access to the tap.- **Version:** release builds take the tag's version (what people see);Sparkle compares `CFBundleVersion`, which is the workflow's run number, asis the appcast's `sparkle:version`.- The app is only ad-hoc signed: the cask strips the quarantine flag, andsays `auto_updates true`, so `brew upgrade` leaves it to Sparkle.#### Linux (Quine Linux)A Flatpak, `com.quineglobal.Quple` (`desktop/flatpak/`), built for botharchitectures by `.forgejo/workflows/flatpak.yml` on every push to `main`that touches the desktop app, and uploaded as a bundle to the bucket's`flatpak/incoming/`. quine-global/flatpak-repo publishes it from there toQuine Linux's Flatpak repo (`flatpak.quineglobal.com`) within about 10minutes. Quine Linux preinstalls it from that repo and updates it like itsother Flatpaks.**Calls open in the browser**, not in a window of the app: Tauri draws withWebKitGTK on Linux, and the GNOME runtime's WebKitGTK (the Flatpak's) isbuilt without WebRTC, so Jitsi Meet can't run in it (tested on GNOME 50and 51: no `RTCPeerConnection`). Sign-in, contacts and ringing are in theapp as on the Mac; when a call starts, the meeting opens in the defaultbrowser (`MEETING_IN_BROWSER` in `lib.rs`). The app can't see or close thebrowser's tab, so:- You hang up in Quple; when a call ends, it says to close the browser'stab too.- The watchdog goes on Quple's server alone (`external` in`desktop/src/watchdog.js`): the other side hanging up or vanishing endsthe call; the room-based rules (rejoining, alone in the room) don'tapply.- Hanging up only in the browser isn't seen: the other side ends the callafter its own alone-in-the-room timeout.- meet.jit.si's sign-in happens in the browser (its sign-in page comes firstand goes straight on when the browser is signed in), so the app's own"Sign in to meet.jit.si" isn't shown.The app id (the Tauri identifier, set by `TAURI_CONFIG` in the manifest) is`com.quineglobal.Quple` here rather than the Mac's `com.quple.desktop`, sothe window matches its desktop file.### 4. iPhone app (`mobile/`)React Native 0.85 (the version the Jitsi Meet SDK, 13.3, supports), iOSonly. Same account, contacts and calling as the desktop app; calls happen inthe Jitsi Meet SDK, and incoming calls ring on iOS's own call screen(CallKit).- **Installed with AltStore**, re-signed with a free Apple ID, so no pushnotifications: a call only rings **while the app is open** (it polls thesignaling server in the foreground, like the desktop app). Ringing whenclosed needs VoIP push, which needs the paid Apple Developer Program(then TestFlight); `src/callkit.ts` is where it would plug in.- Sign-in: `com.quineglobal.quple:/oauth`, registered with the `quple`client (petersweb-infra docs/LOGIN.md). The refresh token is in theiOS Keychain.**Installing:** in AltStore, Sources β + β`https://packages.quineglobal.com/altstore.json`,then install Quple from it; new builds show up as updates. It's Quine'ssource, for all our iPhone apps (Quple is the first). CI(`.forgejo/workflows/ios.yml`, on the Mac runner) builds every push to`main` that touches `mobile/`, uploads the build to this repo's `altstore`release, and replaces Quple's entry in the source(`.forgejo/altstore-source.py`; the listing is `mobile/altstore.json`),leaving other apps' alone.Building by hand (on a Mac with Xcode and CocoaPods; our Mac mini has both):```shcd mobile && npm ci && cd ios && pod installxcodebuild -workspace QupleMobile.xcworkspace -scheme QupleMobile \-configuration Release -sdk iphoneos -destination generic/platform=iOS \-derivedDataPath build CODE_SIGNING_ALLOWED=NO buildmkdir -p ipa/Payload && cp -R build/Build/Products/Release-iphoneos/QupleMobile.app ipa/Payload/(cd ipa && zip -qry ../build/Quple.ipa Payload)```Unsigned on purpose: AltStore signs it with your Apple ID when it installsit (and again every 7 days). TypeScript: `npx tsc --noEmit` (the JitsiSDK's own sources don't type-check, so `types/` declares its API).## Verification status- **`server/`**: `go vet`-clean, with HTTP-level tests for auth, calls onthe default and a caller-chosen Jitsi server (and refusal of non-http(s)or otherwise odd server URLs), and contacts; the token check against afake Keycloak-shaped issuer (ID, refresh and other apps' tokens, otherissuers, expired tokens and other keys are refused).- **`mobile/`**: type-checks, and builds for iPhone (Release, unsigned)with Xcode 27.2. Not yet run on a phone: sign-in, CallKit ringing and aJitsi call need a device.- **`desktop/`**: builds with `cargo build` on macOS and runs. The Preact UI(Quine sign-in, contacts, picking the server for a call, the meet.jit.sisign-in prompt, incoming calls showing their server) is checked headlesslyagainst a mocked backend. The browser sign-in round trip in the real apphasn't been driven automatically.## Server APIAll endpoints require `Authorization: Bearer <Quine access token>`; thecaller's username is the token's `preferred_username`.| Method & path | Body | Returns ||-------------------------------|-----------------------------------------|---------|| `GET /me` | β | `{"username":"alice","defaultJitsiUrl":"https://meet.jit.si"}`, plus `"ntfyServer"` and `"ntfyTopic"` (yours, made on first use) when the server sends call notifications || `POST /register` | β | `{"ok":true}` β marks you online || `POST /call` | `{"to":"bob","jitsiUrl":"https://meet.jit.si","device":"β¦","name":"Mac"}` | `{"meetingId":β¦,"jitsiUrl":β¦,"notified":false}` β every device of `to` rings. `jitsiUrl` is optional (default `DEFAULT_JITSI`); `device` and `name` too, except to call yourself (`to` is you: your other devices ring; 400 without a device); `notified` when the callee's app was closed and they got a notification instead; `"joined": true` when `to` was already ringing you (a crossed call): that's their call, answered on your device, and nobody rings || `GET /poll[?device=β¦]` | β | `{"invites":[{"from":β¦,"meetingId":β¦,"jitsiUrl":β¦,"createdAt":β¦}]}` β also marks you online. Each invite comes once per device (apps without `device` share one), until it's answered, hung up or 2 minutes old. With `device`, also `"calls":[{"meetingId":β¦,"peer":β¦,"jitsiUrl":β¦,"device":"iPhone"}]`: your answered calls on your other devices, to move || `GET /calls/{meetingId}[?device=β¦]` | β | the same as a heartbeat's answer, without counting as one: for a device that's ringing (has the caller given up?). With `device`, also `answeredOn` (a device name) once another of your devices has answered: stop ringing, don't hang up || `POST /calls/{meetingId}/heartbeat` | `{"device":"β¦","name":"iPhone","joined":true}` (optional) | `{"peer":"bob","peerSeenMsAgo":1200,"endedBy":"","peerEnded":false}` β sent every few seconds from a call screen; `peerSeenMsAgo` is `null` until the other side's call screen opens (not answered; the caller's call screen is up from the start), `endedBy` is who hung up and `peerEnded` whether it was the other side (what tells them apart in a call to yourself). With a device, also `movedTo`/`movedJoined` when the call is now on another of your devices (see "Moving a call"). Also marks you online. Only the call's two parties: 403 otherwise, 404 for unknown or long-idle calls || `POST /calls/{meetingId}/move` | `{"device":"β¦","name":"Mac"}` | `{"meetingId":β¦,"peer":"bob","jitsiUrl":β¦,"device":"Mac"}` β puts your side of the call on this device; your other one leaves once this one's heartbeat says `joined`. 409 if it's ended, or a call to yourself || `POST /calls/{meetingId}/hangup` | `{"device":"β¦"}` (optional; needed in a call to yourself) | `{"ok":true}` β ends the call for both sides (hanging up, declining, or the ring running out) || `GET /contacts` | β | `{"contacts":[{"username":β¦,"online":true}]}` || `POST /contacts` | `{"username":"bob"}` | the added contact || `DELETE /contacts/{username}` | β | `{"ok":true}` |Presence expires 90s after the last `/register` or `/poll`. Undeliveredinvites expire after 2 minutes.