Architecture
Overview
Web (React + WASM) Android (Kotlin) Linux (GTK)¹ Chrome extension
\ | / |
+---------- hc-client (Rust) ------+ |
| |
HTTP / live updates / DAV |
| |
hc-server: hc-platform + app crates (calendar, tasks, polls,
contacts, files, finance) + plugins ────────── SQLite- One server,
hc-server(Rust, axum, sqlx on SQLite). It serves the API, CalDAV, CardDAV and WebDAV, the built web app, and runs the background jobs (reminders, sync links, backups). - One client core,
hc-client(Rust). It holds the client logic, the offline queue and conflict handling once for every client: compiled to WebAssembly for the web, called through JNI on Android, linked directly into the GTK apps. - The same backend on the device. The Android apps and the desktop calendar can run the server's engine in-process against a local SQLite database, so they work without a server.
¹ The GTK apps are suspended (#800); HyperCloud Desktop (#803), built from the sync client, replaces them: one hypercloud binary with sync, tray and file manager integration, configured per device from the web (HyperCloud Desktop).
Apps
Each app is a crate (crates/apps/app-<id>) implementing the App trait of hc-app-api: its migrations, routes, DAV collections, jobs and settings. It gets its database, HTTP client, clock and blob store from the host, never by itself, and owns its own tables. hc-platform provides what all apps share: accounts, sessions, settings, groups, the app registry and the DAV tree. Apps meet only through interfaces the platform offers (the registry, an event bus, extension points).
The web app mirrors this: clients/web/src/platform/ is the shell, and each app lives in apps/<app>/ and registers what it contributes (its page, settings sections, live-update topics). A build can leave apps out with HYPERCLOUD_APPS.
| Shared crate | What it does |
|---|---|
hc-contract | API types, the source of contract/ and the TS and Kotlin types |
hc-time | Time zones and recurrence rules, the only zone arithmetic |
hc-ical, hc-vcard | iCalendar and vCard parsing and writing |
hc-sync | Two-way sync decisions and the offline three-way merge |
hc-crypto | End-to-end encryption of event content, sealed server secrets |
hc-dav | The DAV client used for CalDAV and CardDAV links |
hc-finance | Shared-expense maths in integer minor units |
Data model
An event is stored once, as a UTC start and end plus an IANA time zone. Repeating events are one row with an RRULE, expanded on demand, with per-occurrence edits in a separate overrides table. Per-day segments are a rendering concern and never stored, which is why boundary maths goes through date-fns with @date-fns/tz on the web and hc-time in Rust.
File contents live outside the database, under FILES_PATH or in an S3 bucket, named by their SHA-256.
Requests
Every request passes a request log with a correlation id, security headers (a strict CSP), a CSRF origin check, a body limit, and then authentication: a session cookie or a bearer app password resolves to an account, and every query is scoped to it. Admin routes check the role, and each app's routes sit behind its switch.
Offline and sync
The web app's service worker precaches the shell. Changes made offline are queued and replayed on reconnect. Conflicts merge field by field: edits to different fields both survive, and where both sides changed the same field the user decides. Native clients and the sync client follow a per-account change feed.
More detail
Design notes on every part (the Android and desktop apps, accounts, finance, the API contract, the data model, the release process) are in docs/internal/ in the repository.