unical_serverpod_server 0.1.0-beta.0
unical_serverpod_server: ^0.1.0-beta.0 copied to clipboard
Reusable Serverpod module that provides calendar services: securely stored calendar accounts (CalDAV credentials), server-side CalDAV sync of events and tasks (built on unical + unical_caldav), and mu [...]
unical_serverpod_server #
A reusable Serverpod module that gives any Serverpod app calendar services,
built on the pure-Dart unical stack:
- Calendar accounts with credentials encrypted at rest (AES-256-GCM).
- Server-side CalDAV sync of events and tasks (via
unical_caldav) — secrets never reach the device. - Multi-device sync state: a canonical per-task store (
UnicalTaskState). - Private or public calendars: private accounts belong to the authenticated
user (
session.authenticated.userIdentifier); public ones are readable by anyone.
Integrate #
In your server's pubspec.yaml:
dependencies:
unical_serverpod_server: ^0.1.0
In config/generator.yaml:
modules:
unical_serverpod:
nickname: unical
Then dart pub get, serverpod generate, and apply this module's migration.
Add unical_serverpod_client to your client package.
Configure the encryption key in config/passwords.yaml:
shared:
unicalSecretKey: '<a strong random secret>'
Without it, the module refuses to store credentials (never persists them in clear text).
Endpoints #
CalendarAccountEndpoint:linkCalDav,linkGoogle,listAccounts,unlink.CalendarSyncEndpoint:pushTask,pushEvent,pullTasks,listEvents,delete,syncedTasks.
Writes require the account owner; reads are allowed on public accounts or by the owner.
Scope / limitations (0.1) #
- CalDAV is fully wired (Nextcloud/Fastmail/iCloud, etc.). Point task sync at a task-capable CalDAV server — Google's CalDAV is events-only.
- Google:
linkGooglestores an encrypted refresh token, but server-side Google sync is not yet implemented (CalendarSyncEndpointthrows for Google accounts). - Runtime (Postgres + a live CalDAV server) is not covered by the shipped unit tests — those cover the pure glue (DTO mapping, encryption, strategy parity). End-to-end verification is the integrator's.