Skip to main content
This guide covers everything you need to install and deploy Hiro CRM, from setting up a local development environment to deploying to production on Vercel.

System requirements

Before installing Hiro CRM, ensure your system meets these requirements:
  • Node.js 20.0.0 or higher
  • npm 10.0.0 or higher (comes with Node.js)
  • Git for cloning the repository
  • Modern browser (Chrome, Firefox, Safari, or Edge)
  • Supabase account (free tier available)
Hiro CRM is tested on macOS, Linux, and Windows (via WSL2). For Windows users, we recommend using Windows Subsystem for Linux (WSL2) for the best experience.

Local development setup

Step 1: Clone the repository

Clone the Hiro CRM repository and navigate to the project directory:
git clone https://github.com/your-org/hiro-crm.git
cd hiro-crm
The project structure looks like this:
hiro-crm/
├── frontend/              # Next.js application
│   ├── app/               # App Router pages & API routes
│   ├── components/        # Reusable UI components
│   ├── lib/               # Services, utilities, integrations
│   └── public/            # Static assets
├── supabase/
│   ├── migrations/        # Database schema migrations
│   └── seeds/             # Demo data seeds
├── docs/                  # Documentation
└── scripts/               # Utility scripts

Step 2: Install dependencies

Navigate to the frontend directory and install all required packages:
cd frontend
npm install
This installs all dependencies defined in package.json, including:
  • Next.js 16 - React framework
  • @supabase/supabase-js - Supabase client
  • @supabase/ssr - Server-side rendering support
  • Tailwind CSS v4 - Utility-first CSS
  • Framer Motion - Animation library
  • OpenAI SDK - AI Assistant integration
  • Brevo SDK - Email/SMS campaigns
  • Inngest - Background job processing

Step 3: Set up Supabase

Create a new project

1

Sign in to Supabase

Visit supabase.com and sign in or create an account
2

Create project

Click “New Project” and fill in:
  • Name: hiro-crm (or your preferred name)
  • Database Password: Choose a strong password
  • Region: Select closest to your location (e.g., “West EU (Ireland)” for Spain)
3

Wait for provisioning

Project creation takes 1-2 minutes. Wait for the “Project is ready” notification
4

Get API credentials

Navigate to Settings > API and copy:
  • Project URL
  • anon public key
  • service_role secret key (click “Reveal” to see it)

Apply database migrations

Hiro CRM uses PostgreSQL migrations to create the database schema. You’ll need to run these in order.
Migrations must be run in numerical order. Running them out of order may cause errors due to missing dependencies.

Step 4: Configure environment variables

Create your local environment file:
cp .env.example .env.local
Edit .env.local and configure the required variables:
# =============================================================================
# REQUIRED: Supabase
# =============================================================================
NEXT_PUBLIC_SUPABASE_URL=https://your-project.supabase.co
NEXT_PUBLIC_SUPABASE_ANON_KEY=your-anon-key
SUPABASE_SERVICE_ROLE_KEY=your-service-role-key

# =============================================================================
# REQUIRED: App URL
# =============================================================================
NEXT_PUBLIC_APP_URL=http://localhost:3000

Step 5: Seed demo data (optional)

To test Hiro CRM with realistic data, you can seed the database:
# Start the dev server
npm run dev

# In another terminal, seed basic data
curl http://localhost:3000/api/admin/seed-locations

Step 6: Start development server

Start the Next.js development server:
npm run dev
The application will be available at http://localhost:3000.
Use npm run dev:webpack if you experience issues with Turbopack (Next.js 16’s default bundler).

Production deployment

Deploy to Vercel

Hiro CRM is optimized for deployment on Vercel:
1

Push to GitHub

Push your Hiro CRM fork to GitHub:
git remote set-url origin https://github.com/your-username/hiro-crm.git
git push -u origin main
2

Import to Vercel

  • Go to vercel.com and sign in
  • Click “Add New” > “Project”
  • Import your GitHub repository
  • Select the frontend directory as the root
3

Configure environment variables

Add all required environment variables from your .env.local file:
  • NEXT_PUBLIC_SUPABASE_URL
  • NEXT_PUBLIC_SUPABASE_ANON_KEY
  • SUPABASE_SERVICE_ROLE_KEY
  • NEXT_PUBLIC_APP_URL (set to your Vercel domain)
  • Add optional variables for features you want to enable
4

Deploy

Click “Deploy” and wait for the build to complete (typically 2-3 minutes)
5

Update Supabase settings

In your Supabase project dashboard:
  • Go to Authentication > URL Configuration
  • Add your Vercel domain to Site URL and Redirect URLs
The vercel.json file in the root directory configures cron jobs for automated tasks:
  • Daily reservation sync (8:00 AM)
  • Calendar notifications (9:00 AM)
  • Ticket reminders (8:00 AM)
  • Marketing automations (every 30 minutes)

Custom domain

To use a custom domain:
1

Add domain in Vercel

In your Vercel project settings, go to Domains and add your custom domain
2

Configure DNS

Add the DNS records provided by Vercel to your domain registrar
3

Update environment variables

Change NEXT_PUBLIC_APP_URL to your custom domain and redeploy
4

Update Supabase

Add your custom domain to Supabase Authentication > URL Configuration

Additional configuration

Set up first admin user

After deployment, create your first user through the sign-up flow. Then, grant super admin permissions:
-- Run in Supabase SQL Editor
UPDATE profiles 
SET role = 'super_admin', 
    permissions = '{"super_admin": true}'::jsonb
WHERE email = '[email protected]';

Configure Supabase storage

For customer avatars and document uploads, ensure storage is configured:
1

Create avatars bucket

Migration 120_CREATE_AVATARS_BUCKET.sql creates this automatically
2

Verify storage policies

Check that Row Level Security policies allow authenticated users to upload

Enable integrations

1

Create Brevo account

Sign up at brevo.com (free tier available)
2

Generate API key

Go to Settings > API Keys and create a new key
3

Add to environment

Set BREVO_API_KEY and related variables in Vercel environment settings
4

Verify sender email

Verify your sender email in Brevo to enable sending

Development tools

Available scripts

Hiro CRM includes several npm scripts for development:
# Development
npm run dev                  # Start dev server with Turbopack
npm run dev:webpack          # Start dev server with Webpack
npm run build                # Build for production
npm run start                # Start production server

# Quality checks
npm run lint                 # Run ESLint
npm run type-check           # Check TypeScript types
npm run clean                # Clean build artifacts

# Testing
npm run test                 # Run unit tests (watch mode)
npm run test:run             # Run unit tests once
npm run test:coverage        # Generate coverage report
npm run test:e2e             # Run E2E tests with Playwright
npm run test:e2e:ui          # Run E2E tests in UI mode

# Utilities
npm run verify:schema        # Verify database schema
npm run create:user          # Create test user

Database tools

For database management:
# Using Supabase CLI
supabase db diff             # Show local schema changes
supabase db push             # Push migrations to remote
supabase db pull             # Pull remote schema changes
supabase db reset            # Reset local database

Troubleshooting

Build errors

If you encounter build errors:
# Clear cache and rebuild
npm run clean
rm -rf node_modules package-lock.json
npm install
npm run build

Database connection issues

1

Verify credentials

Double-check your Supabase URL and keys in .env.local
2

Check Supabase status

Visit status.supabase.com to check for outages
3

Test connection

Use the Supabase dashboard to run a simple query: SELECT 1;

Type errors

Run the type checker to identify TypeScript issues:
npm run type-check
Common fixes:
  • Update @types/node and @types/react packages
  • Ensure all environment variables are properly typed in lib/env.ts

Performance issues

For production performance optimization:
  • Enable Vercel Analytics to monitor Core Web Vitals
  • Review database query performance in Supabase dashboard
  • Check for missing indexes on frequently queried columns

Next steps

Now that Hiro CRM is installed and running:

Configure your brand

Set up your restaurant/hotel brands and locations in the Settings panel

Import customers

Import existing customer data via CSV upload

Create campaigns

Set up your first email or SMS marketing campaign

Set up loyalty program

Configure loyalty tiers and point rewards

Getting help

If you need assistance:

Build docs developers (and LLMs) love