Clinic Operations
Common questions about running a clinic on CareNova — patients, appointments, payments, roles, and data management.
Written By Dev010
Last updated 19 days ago
Can CareNova support multiple clinics or locations?
Not out of the box. CareNova is designed as a single-tenant system — one installation serves one clinic. The clinics table has one row and the entire application operates around it.
Multi-tenancy (multiple clinics sharing one installation with isolated data) is listed as a future roadmap item but is not implemented in the current version. Building it would require adding a clinic_id foreign key to every patient- facing table and enforcing tenant isolation at the query level throughout all server actions.
For multiple locations operating as separate independent clinics, the straightforward approach is a separate installation per location — each with its own Supabase project and deployment.
Can patients book appointments themselves?
Partially. CareNova includes a public appointment booking page at /appointment on the landing site. This page is visible to all visitors without requiring login.
However the public booking page in the current version is a request form — it does not write directly to the appointments table or check doctor availability in real time. Staff confirm and schedule the appointment from the dashboard after receiving the request.
Full self-service patient booking with live availability, calendar slot selection, and automatic appointment creation is not implemented in the current version.
Does CareNova integrate with Stripe or any payment gateway?
No. CareNova's financial module — invoices, payments, and expenses — is fully self-contained. Payments are recorded manually by staff in the dashboard. There is no integration with Stripe, PayPal, or any external payment processor.
This is intentional for clinics that collect payment in person and need a record-keeping system rather than an online checkout flow.
If you need to add a payment gateway, the integration point is lib/actions/payment-actions.ts — create the payment intent with the external provider, then record the result as a payment entry on success. The invoice status update would need to be triggered as part of the same flow.
Can I add custom roles beyond the four built-in ones?
Not without code changes. CareNova's role system is built on a PostgreSQL enum — user_role — with four fixed values: admin, doctor, receptionist, nurse. Adding a new role requires changes in several places:
Add the new value to the
user_roleenum inlib/db/schema.tsRun a migration to update the enum in PostgreSQL:
ALTER TYPE user_role ADD VALUE 'new_role';Add default permissions for the new role in
lib/constants/permissions.tsunderDEFAULT_ROLE_PERMISSIONSAdd the role to
ROLESandROLE_CONFIGconstantsUpdate
nav-main.tsxto include the new role in relevant nav item role arraysAdd the role to
requireRolecalls in any server actions it should be permitted to execute
The staff table uses a free-text role column — HR staff records are not restricted to the four system roles and can use any label.
What happens to records when a staff member is deleted?
Deleting a user from the users table sets their foreign key references to null on most related tables — it does not cascade delete clinical or financial records. Patient data, appointments, prescriptions, invoices, and medical records are preserved.
Specifically, when a user is deleted:
Before deleting a user account, reassign their active appointments and open invoices to another doctor or staff member. Appointments and prescriptions do not SET NULL on the doctor_id — leaving a reference to a deleted user may cause unexpected behavior in those modules.
For departing staff the recommended approach is to deactivate rather than delete — set the user's status to inactive and revoke their Supabase Auth account via Supabase Dashboard → Authentication → Users → Ban user. Their records remain intact and properly attributed.
Can I export my data?
Yes, for the two main clinical datasets. CareNova includes CSV export for:
Patients — requires
patients.exportpermissionAppointments — requires
appointments.exportpermission
Both are accessible from the respective module list pages via the Export button. The export runs server-side and streams the CSV file directly to the browser.
For other tables — invoices, payments, expenses, inventory — there is no built-in export UI in the current version. You can export these directly from Supabase:
Supabase Dashboard → Table Editor → select table → Export to CSV
For a full database backup, use Supabase's built-in backup feature under Project Settings → Backups, or pg_dump via the direct connection URL.
Can I customize what each role can see and do?
Yes — this is one of CareNova's core features. The Permissions module at Dashboard → Permissions gives admins a matrix UI to grant or revoke individual permission keys per role.
Changes take effect immediately — the sidebar navigation and server action enforcement both read from the role_permissions table at runtime.
The admin role is the exception — it cannot be restricted. Admin accounts always bypass permission checks regardless of what is configured in the permissions matrix.
See the Roles & Permissions article for the full list of permission keys and default assignments.
What happens if two staff members book the same appointment slot?
CareNova does not enforce hard conflicts at the database level — there is no unique constraint preventing two appointments from overlapping for the same doctor.
Conflict detection is handled at the UI level in the calendar view and booking form — overlapping slots are visually flagged when scheduling. Staff are responsible for resolving conflicts manually.
If strict double-booking prevention is required, it can be enforced by adding a database-level check in lib/actions/appointment-actions.ts before inserting a new appointment — query for existing appointments with overlapping start_time and end_time for the same doctor_id and return an error if any are found.