Setup & Configuration

Common questions about installing, configuring, and preparing CareNova for first use.

Written By Dev010

Last updated 19 days ago

Can I run CareNova without Supabase?

No. Supabase is a core dependency β€” not an optional integration. CareNova uses Supabase for three distinct things: PostgreSQL as the primary database, Supabase Auth for session management, and Supabase Storage for file uploads.

The database layer (Drizzle ORM) connects to PostgreSQL via DATABASE_URL β€” technically any PostgreSQL instance works at the query level. However, the auth system is tightly coupled to @supabase/ssr and the session cookie behavior it provides. Replacing Supabase Auth requires rewriting lib/auth/, lib/supabase/, and middleware.ts β€” it is a significant undertaking and not supported out of the box.

For most deployments, the Supabase free tier is sufficient to get started and covers development comfortably.

Can I use a different auth provider?

Not without code changes. CareNova's authentication is built on Supabase Auth via @supabase/ssr. The session handling, middleware protection, cookie management, and user approval flow all depend on Supabase Auth behavior specifically.

Clerk is referenced in the README as an alternative but is not implemented in the codebase β€” it was an early consideration that was not carried forward. The working auth system is Supabase Auth only.

If you need to replace the auth provider, the files to focus on are:

  • lib/supabase/server.ts β€” session client

  • lib/supabase/middleware.ts β€” session refresh

  • lib/auth/index.ts β€” getCurrentUser, requireRole

  • lib/actions/auth-actions.ts β€” signIn, signOut

  • middleware.ts β€” route protection logic

How do I change the clinic name and logo?

There are two places this is managed depending on what you are updating.

For the dashboard and system-wide clinic identity: Dashboard β†’ Settings β†’ Clinic tab β†’ update the clinic name and save.

For the public landing page: Dashboard β†’ Landing Settings β†’ Branding tab β†’ update the clinic name, upload a logo (light and dark versions), upload a favicon β†’ save.

Logo files are uploaded to the logos Supabase Storage bucket. Confirm this bucket exists and is set to Public before uploading β€” see the Supabase Setup guide.

How do I remove the demo data?

Run the following in the Supabase SQL Editor to clear all seeded records while preserving the table structure and your admin account:

-- Clear clinical and financial data
DELETE FROM blog_comments;
DELETE FROM blog_posts;
DELETE FROM blog_categories;
DELETE FROM notifications;
DELETE FROM payments;
DELETE FROM invoice_items;
DELETE FROM invoices;
DELETE FROM expenses;
DELETE FROM odontograms;
DELETE FROM medical_attachments;
DELETE FROM diagnoses;
DELETE FROM clinical_notes;
DELETE FROM medical_record_vitals;
DELETE FROM medical_records;
DELETE FROM test_reports;
DELETE FROM prescriptions;
DELETE FROM appointments;
DELETE FROM patients;

-- Clear operations data
DELETE FROM payroll;
DELETE FROM staff;
DELETE FROM inventory;
DELETE FROM lab_vendors;
DELETE FROM laboratory_tests;
DELETE FROM sample_types;
DELETE FROM turnaround_times;
DELETE FROM test_methodologies;
DELETE FROM test_categories;
DELETE FROM services;
DELETE FROM departments;

-- Clear demo staff accounts
-- (keep your own admin account)
DELETE FROM users 
WHERE email LIKE '%@carenova.demo';

After clearing demo users, also delete them from Supabase Auth:

Supabase Dashboard β†’ Authentication β†’ Users β†’ delete each demo account manually.

Delete tables in the order shown above β€” child records must be deleted before their parents due to foreign key constraints. Reversing the order will produce constraint violation errors.

Can I change the default language?

The dashboard defaults to English. Users can switch their preferred language from their profile settings β€” the selection is stored in a dashboard_locale cookie.

The public landing page also defaults to English. Visitors can switch language via the selector in the landing page header β€” the selection is stored in a landing_locale cookie.

CareNova ships with four languages:

Language

Code

English

en

French

fr

Spanish

es

Arabic

ar

To change the system default locale, update the defaultLocale value in lib/i18n.ts. To add a new language, create the corresponding translation files in messages/ and messages/landing/ and register the new locale in lib/i18n.ts.

What happens if I skip the license activation?

CareNova requires a valid Envato purchase code to be activated at /setup before the dashboard becomes accessible. If license activation has not been completed, all requests to /dashboard are redirected to /setup by the middleware.

To activate the license:

  1. Purchase CareNova on CodeCanyon

  2. Navigate to https://yourdomain.com/setup

  3. Enter your Envato purchase code

  4. Complete setup

For local development you can bypass license verification by setting the LICENSE_TEST_CODE environment variable:

LICENSE_TEST_CODE=carenova-dev-2026

This bypass only works in development and should never be set in a production environment.

Can I seed demo data again after deleting it?

Yes. Re-run the seed script at any time:

npm run db:seed

The seed script checks for existing records before inserting β€” it will not duplicate data if some records already exist. If you want a full clean reset including schema, use:

npm run setup:db

This clears the Next.js cache, pushes the schema, and re-seeds from scratch. Only run this against a development database β€” it is destructive.

How do I create the first admin account?

The seed script (npm run db:seed) creates a demo admin account at admin@carenova.demo. For a production installation without demo data, create the first admin manually:

  1. Sign up via https://yourdomain.com/signup using your admin email

  2. Confirm the email address via the confirmation link

  3. In Supabase SQL Editor, approve the account and assign the admin role:

UPDATE users 
SET role = 'admin', 
    approved_at = now()
WHERE email = 'your@email.com';

After this the account can log in and access the full dashboard. Subsequent staff accounts can be approved from Dashboard β†’ Pending Approval without needing SQL access.