Cockpit
The message centre above all of the company's apps: every event as a notification on the phone, right onto the lock screen, with one-tap actions.
App behind a sign-in. Test stage without customer operation.
What it does
- Notifications for every event from CRM and marketing, for monthly audits and for every call.
- Up to two buttons per notification, on the lock screen too: send reminder, start audit, confirm acceptance.
- The result replaces the notification under the same tag instead of adding a second one.
- A button works once and for at most 14 days; the authorisation number only reaches the device with the notification.
- Every morning an overview, from “all quiet” to the points that are waiting.
- If mail stays unread for an hour, the Cockpit asks once a day whether the server is running.
From the event to the tap on the lock screen
Five stations; each one says who triggers it and where it runs.
- Daniel taps or approves
- Runs by itself
Runs by itselfWhere: Database, schema cockpit
Event
An app reports something to the message centre. The same report counts once, so recurring checks do not flood the phone.
Runs by itselfWhere: Edge Function cockpit-push
Push
The notification goes encrypted to every registered device without holding up the event that caused it.
Daniel taps or approvesWhere: Phone, lock screen too
Notification with buttons
Up to two buttons, for example “send” and “do not send” for a reminder.
Runs by itselfWhere: Database, cockpit.run_action
Action
Checked first: button offered, not yet used, notification at most 14 days old. Then the action runs in the CRM and a reply sentence replaces the notification.
Runs by itselfWhere: schedule in the database
Morning overview and watchdog
An overview every morning; every hour a look at whether mail is being read.
Skills at work here
Interface
- Preact and TypeScript
- Vite
- Installable web app (progressive web app)
- Own service worker
Push messages
- Encryption by RFC 8291 (Request for Comments, an internet standard)
- Sender identification by RFC 8292 (Voluntary Application Server Identification)
- Edge Function in Deno
Database
- Triggers on the CRM tables
- Asynchronous sending with pg_net
- Schedules with pg_cron
- Live updates for the open app
- Row level security
The Cockpit in five scenes
The message centre above all of the company's apps.
Every event from the apps arrives as a notification on the phone, right onto the lock screen.
Up to two buttons per notification. One tap sends a reminder, for example.
The result replaces the notification under the same tag instead of adding a second one.
An overview every morning. If mail stays unread for an hour, the Cockpit asks whether the server is running.