Clinic and therapy
The clinic preset installs appointments, intake forms, note templates, consent signatures, field encryption for sensitive values, a client portal and reminders.
The clinic preset is for an app in the style of Jane or SimplePractice. A
client books an appointment, fills in the intake form and signs the consent,
the practitioner writes session notes from a template, and the client reads
their own records in a portal. Sensitive values are encrypted at rest with a
key per organization, and reads of them can go to the audit log.
Config
import { defineConfig } from "better-supabase/config";
export default defineConfig({ preset: "clinic" });npx better-supabase init --preset clinic starts a new project from it, and
npx better-supabase apply --preset clinic adds it to one you have
(CLI).
Blocks
The preset is saas plus these blocks, and
whatever they require:
| Block | Role in the app |
|---|---|
| calendar | Practitioners' calendars and availability |
| bookings | Appointments on practitioners and rooms, with no double booking |
| forms | Intake and assessment forms |
| templates | Session note templates each clinic forks |
| signatures | Consent records, signed on a frozen version |
| custom-fields | Client fields, with sensitive ones encrypted |
| field-encryption | Data keys in Vault that encrypt columns and custom fields |
| guests | The client portal |
| reminders | Appointment reminders |
The audit block from saas records who changed what.
Encryption and read audits
The preset installs field-encryption; what to encrypt and which reads to
log stay in your config, because they name your own tables and fields. Mark
a sensitive app table column encrypted: true and set auditReads on the
table, and turn on auditReads for custom fields:
import { defineConfig } from "better-supabase/config";
export default defineConfig({
preset: "clinic",
blocks: { "custom-fields": { options: { auditReads: true } } },
});A custom field definition is encrypted with encryptDefinition(id), and its
values are read back through readValues. Each read with auditReads writes
one read entry to the audit log per tenant and call, with the ids read
(field encryption,
encrypted columns). Encrypted
values have no searchable equality, so keep a separate non-sensitive column
for lookups.
How the blocks connect
An appointment is a booking on a practitioner's resource. The intake form
and the consent are linked to the client's record, and the consent
signature keeps the exact version the client signed. A client is a guest,
never a member: grant them their bookings and they read those in the portal.
The guests page lists which blocks
honor a grant; show the rest of the client's record from server code after
checking their grants with guests.mine().
With ReUI
- Event Calendar for the practitioners' day and week views.
- Stepper for intake: form, consent, booking.
- Data Grid for the client list, with Filters on practitioner and status.
Last updated on
Field service
The field-service preset installs a dispatch board of work orders, customer sites in assets, parts from inventory, quotes to invoices, checklists and signatures.
Courses and learning
The lms preset installs courses with modules, lessons and quizzes graded by forms, enrollments with progress, certificates, comments and attachments.