Installation Guide

Step-by-step instructions for installing CareNova, setting up the environment, and running the application locally.

Written By Dev010

Last updated 17 days ago

This guide walks you through every step required to install CareNova, configure your environment, initialize the database, and run the application locally.

Follow each step in order for a successful installation.

Before you begin β€” make sure you have completed the System Requirements checklist. You will need your Supabase project, Resend account, and Envato purchase code ready before starting.

Step 1 β€” Download the Package

After purchasing CareNova on CodeCanyon, download the package from your Envato Downloads page.

  1. Log in to your Envato account

  2. Go to Downloads

  3. Find CareNova and click Download

  4. Select Main Files to download the full package

Extract the downloaded archive to a location on your computer.

The extracted package contains the following structure:

carenova/
β”œβ”€β”€ carenova-app/        ← Main application (work here)
β”œβ”€β”€ documentation/       ← CareNova documentation
β”œβ”€β”€ LICENSE.txt          ← License information
β”œβ”€β”€ README-FIRST.txt     ← Quick start instructions
└── install-guide.txt    ← Basic installation notes

All setup steps are performed inside the carenova-app/ directory. Do not modify files outside this folder.

Step 2 β€” Open the Project

Open a terminal and navigate to the application directory:

cd carenova/carenova-app

Open the project in your code editor:

code .

If you do not have VS Code installed, download it from code.visualstudio.com. It is the recommended editor for working with CareNova.

Step 3 β€” Install Dependencies

Install all required packages using npm:

npm install

This installs the complete dependency tree including:

  • Next.js 14 and React 18

  • Supabase client libraries

  • Drizzle ORM

  • Tailwind CSS and shadcn/ui components

  • React Hook Form and Zod validation

  • Framer Motion

  • Recharts and dnd-kit

  • next-intl for internationalization

  • All other required packages

Installation may take 2–5 minutes depending on your internet connection. Do not interrupt the process.

If you encounter permission errors on macOS or Linux, do not use sudo. Instead, fix npm permissions:

npm install --legacy-peer-deps

Helpful resources:

Step 4 β€” Create Supabase Project

CareNova requires a Supabase project for authentication, database, and file storage.

  1. Go to supabase.com and create a free account

  2. Click New Project

  3. Choose your organization

  4. Enter a project name (e.g. carenova)

  5. Set a strong database password β€” save this password, you will need it for your connection string

  6. Select the region closest to your users

  7. Click Create new project and wait for it to provision (approximately 1–2 minutes)

Video: How to create a Supabase project

Once your project is ready, retrieve the following credentials:

From Settings β†’ API:

Variable

Where to Find

NEXT_PUBLIC_SUPABASE_URL

Project URL

NEXT_PUBLIC_SUPABASE_ANON_KEY

Project API Keys β†’ anon public

SUPABASE_SERVICE_ROLE_KEY

Project API Keys β†’ service_role

Keep SUPABASE_SERVICE_ROLE_KEY secret. Never expose it in client code or commit it to a public repository.

From Settings β†’ Database β†’ Connection String:

Select Transaction mode (port 6543) and copy the connection string. Replace [YOUR-PASSWORD] with your database password.

postgresql://postgres.[ref]:[YOUR-PASSWORD]@aws-0-[region].pooler.supabase.com:6543/postgres?pgbouncer=true

This becomes your DATABASE_URL.

The ?pgbouncer=true parameter is required. CareNova uses pgBouncer transaction mode for all database queries.

For migrations only (optional), also copy the Session mode connection string (port 5432):

postgresql://postgres.[ref]:[YOUR-PASSWORD]@aws-0-[region].pooler.supabase.com:5432/postgres

This becomes your DIRECT_DATABASE_URL.

Helpful resources:

Step 5 β€” Configure Environment Variables

Create a new file named .env.local in the root of carenova-app/:

touch .env.local

Open .env.local and add the following variables:

# ─── Supabase (Auth + Database) ─────────────────────────────
NEXT_PUBLIC_SUPABASE_URL=https://your-project.supabase.co
NEXT_PUBLIC_SUPABASE_ANON_KEY=your-anon-key

# ─── Database (Drizzle ORM) ──────────────────────────────────
DATABASE_URL=postgresql://postgres.[ref]:[PASSWORD]@aws-0-[region].pooler.supabase.com:6543/postgres?pgbouncer=true

# Optional: Direct connection for migrations
# DIRECT_DATABASE_URL=postgresql://postgres.[ref]:[PASSWORD]@aws-0-[region].pooler.supabase.com:5432/postgres

# ─── Supabase Service Role ───────────────────────────────────
SUPABASE_SERVICE_ROLE_KEY=your-service-role-key

# ─── Site URL ────────────────────────────────────────────────
NEXT_PUBLIC_SITE_URL=http://localhost:3000

# ─── Resend (Email) ──────────────────────────────────────────
RESEND_API_KEY=re_xxxxxxxxxx

# ─── Cron Protection ─────────────────────────────────────────
CRON_SECRET=your-random-secret-string

# ─── Envato License ──────────────────────────────────────────
ENVATO_PERSONAL_TOKEN=your-envato-personal-token
ENVATO_ITEM_ID=your-codecanyon-item-id

# ─── Demo Data (optional) ────────────────────────────────────
# DEMO_PASSWORD=Demo123!

# ─── Debug Logs (development only) ──────────────────────────
# CARENOVA_DEBUG=1

Replace all placeholder values with your actual credentials. Never commit .env.local to a public repository. The .gitignore file already excludes it by default.

Generating CRON_SECRET:

You can generate a secure random string using:

openssl rand -base64 32

Or use any random string generator. This value protects your cleanup endpoint from unauthorized access.

Full environment variable reference is available in the Environment Variables section.

Step 6 β€” Configure Supabase Auth

Before initializing the database, configure your Supabase authentication settings.

In Supabase Dashboard β†’ Authentication β†’ URL Configuration:

Set the following URLs:

Setting

Value

Site URL

http://localhost:3000 (dev) or your production domain

Redirect URLs

http://localhost:3000/auth/callback

Redirect URLs

http://localhost:3000/auth/confirm

Redirect URLs

https://yourdomain.com/auth/callback (production)

Redirect URLs

https://yourdomain.com/auth/confirm (production)

In Supabase Dashboard β†’ Authentication β†’ Email Templates:

Update the Confirm signup email template to use your CareNova branding. The confirmation link must use {{ .ConfirmationURL }}.

In Supabase Dashboard β†’ Authentication β†’ SMTP Settings (if using Resend):

Setting

Value

Host

smtp.resend.com

Port

465

Username

resend

Password

Your RESEND_API_KEY value

Sender email

noreply@yourdomain.com

Sender name

CareNova

Video: How to configure Supabase Auth

Step 7 β€” Initialize the Database

CareNova provides a master SQL installation file that creates all required tables, indexes, enums, and seed data in a single operation.

Option A β€” Using INSTALL.sql (Recommended)

  1. Open your Supabase project dashboard

  2. Go to SQL Editor

  3. Click New query

  4. Open INSTALL.sql from your carenova-app/ folder

  5. Copy the entire contents and paste into the SQL Editor

  6. Click Run

The script will create all 35+ tables and confirm installation with a table list at the end.

INSTALL.sql is idempotent β€” it is safe to run multiple times. Running it again will not duplicate or overwrite existing data.

Option B β€” Using Drizzle push

If you prefer to use Drizzle ORM to push the schema:

npm run db:push

Option A (INSTALL.sql) is recommended for first-time setup as it includes all indexes, enums, and constraints in the correct order.

Helpful resources:

Step 8 β€” Create Storage Buckets

CareNova includes a command that automatically creates and configures all required storage buckets in your Supabase project.

Run: bash

npm run db:buckets

This will create the following buckets:

Bucket

Public

Purpose

avatars

βœ… Yes

User profile pictures

logos

βœ… Yes

Clinic logos and favicons

medical-attachments

βœ… Yes

Medical record uploads

landing-assets

βœ… Yes

Landing page images

You should see:

βœ“ avatars bucket ready βœ“ logos bucket ready βœ“ medical-attachments bucket ready βœ“ landing-assets bucket ready

⚠️ SUPABASE_SERVICE_ROLE_KEY must be set in your .env.local before running this command.

Video: How to create Supabase storage buckets

Step 9 β€” Seed Demo Data (Optional)

CareNova includes a comprehensive demo dataset with realistic data across all modules.

Run the seed command:

npm run db:seed

This will populate your database with:

Data

Count

Patients

1,200

Appointments

1,697

Invoices

1,393

Payments

400

Medical Records

300

Prescriptions

199

Inventory Items

150

Odontograms

125

Staff Members

12

Lab Vendors

10

Blog Posts

12

It also creates four demo user accounts:

Role

Email

Password

Admin

admin@carenova.demo

Demo123!

Doctor

doctor@carenova.demo

Demo123!

Receptionist

receptionist@carenova.demo

Demo123!

Nurse

nurse@carenova.demo

Demo123!

The seed script is idempotent β€” running it multiple times will not create duplicate records. You can customize the demo password by setting DEMO_PASSWORD in your .env.local before seeding.

Note: Demo accounts require Supabase Auth users to be created separately. See the Demo Accounts guide for full instructions.

Step 10 β€” Start the Development Server

Start the local development server:

npm run dev

The application will start and display:

β–² Next.js 14.2.35 (turbo)
  - Local: http://localhost:3000
  βœ“ Ready in ~1s

Open your browser and visit:

http://localhost:3000

If this is a fresh installation with no license row in the database, you will be redirected to:

http://localhost:3000/setup

Enter your Envato purchase code to activate the platform. Once activated, you will be redirected to the dashboard.

For local development without an Envato purchase code, you can insert a test license row directly into your Supabase database. See the License Activation guide for instructions.

Step 11 β€” Verify the Installation

Confirm the installation is working correctly:

  • [ ] http://localhost:3000 loads the landing page

  • [ ] The clinic type switches correctly with ?clinic=dental, ?clinic=general, ?clinic=ophthalmology

  • [ ] The login page loads at /login

  • [ ] You can log in with a demo account

  • [ ] The dashboard loads with data visible

  • [ ] Patient, Appointment, and Invoice modules are accessible

  • [ ] No errors appear in the terminal

If everything loads correctly, your installation is complete. βœ…

Troubleshooting

Application won't start:

  • Confirm Node.js 18+ is installed: node --version

  • Delete .next/ and node_modules/ and reinstall:

  npm run clean && npm install

Database connection error:

  • Confirm DATABASE_URL uses port 6543 with ?pgbouncer=true appended

  • Confirm your Supabase project is active and not paused

  • Check that the database password in the connection string is correct and URL-encoded if it contains special characters

Login not working:

  • Confirm NEXT_PUBLIC_SUPABASE_URL and NEXT_PUBLIC_SUPABASE_ANON_KEY are correct

  • Confirm the Supabase Auth redirect URLs are configured

  • Check that the user exists in Supabase Auth β†’ Users

Email confirmation not sending:

  • Confirm RESEND_API_KEY is set and valid

  • Confirm your sending domain is verified in Resend

  • Check Supabase Auth β†’ SMTP Settings are configured

Setup screen appears on every load:

Seed command fails:

  • Confirm SUPABASE_SERVICE_ROLE_KEY is set in .env.local

  • Confirm the database tables exist (run INSTALL.sql first)

  • Check the terminal for specific error messages

Useful Commands Reference

Command

Description

npm run dev

Start development server with Turbo

npm run dev:stable

Start development server without Turbo

npm run build

Build for production

npm run start

Start production server

npm run lint

Run ESLint

npm run db:push

Push schema to database

npm run db:seed

Seed demo data

npm run db:studio

Open Drizzle Studio (database browser)

npm run clean

Clear all build caches

npm run setup:db

Full database reset + seed

Next Step

Once your local installation is running successfully, continue to the Supabase Setup guide for detailed storage bucket configuration and auth settings, or proceed directly to Deployment if you are ready to take CareNova to production.