Documentation Index
Fetch the complete documentation index at: https://dhanurgo.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
Supabase Setup
HostMetrics uses Supabase for PostgreSQL database, authentication, and file storage.1. Create a Supabase Project
- Go to supabase.com/dashboard
- Click “New Project”
- Choose your organization
- Set a project name (e.g., “hostmetrics-dev”)
- Set a strong database password (save it — you’ll need it for direct DB access)
- Select a region close to you
- Click “Create new project”
2. Get Your API Keys
After the project is created:- Go to Settings > API
- Copy:
- Project URL →
NEXT_PUBLIC_SUPABASE_URL - anon/public key →
NEXT_PUBLIC_SUPABASE_ANON_KEY - service_role key →
SUPABASE_SERVICE_ROLE_KEY(for admin operations only)
- Project URL →
3. Run Database Migrations
Option A: Supabase Dashboard (Recommended for first setup)
- Go to SQL Editor in your Supabase Dashboard
- Run each migration file from
supabase/in order:
Option B: Supabase CLI
4. Configure Storage Buckets
Storage buckets are created by002_storage.sql. Verify they exist:
- Go to Storage in Supabase Dashboard
- Confirm these buckets exist:
vehicle-photos— Vehicle images (public)documents— Fleet documents (private)
002_storage.sql.
5. Configure Auth Settings
- Go to Authentication > Settings
- Email Auth: Enable (default)
- Confirm email: Disable for local development (or keep enabled for production)
- Redirect URLs: Add
http://localhost:3000/**for local dev
Row Level Security (RLS)
All tables have RLS enabled. Every query filters byuser_id to ensure multi-tenant data isolation. The getCurrentUserId() helper in src/lib/db/_client.ts extracts the authenticated user’s ID from the Supabase session.