This guide walks you through spinning up a fully functional local instance of B2B Import ERP — complete with a seeded multi-tenant database, RLS policies, and both demo tenant dashboards — in under 10 minutes.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/ency07/B2B-import/llms.txt
Use this file to discover all available pages before exploring further.
Steps
Configure environment variables
Create a
.env.local file in the project root and populate it with the three required Supabase credentials. All three values are available in your Supabase project dashboard under Project Settings → API..env.local
| Variable | Where to find it | Visibility |
|---|---|---|
NEXT_PUBLIC_SUPABASE_URL | Project Settings → API → Project URL | Public (safe for browser) |
NEXT_PUBLIC_SUPABASE_ANON_KEY | Project Settings → API → anon public key | Public (safe for browser) |
SUPABASE_SERVICE_ROLE_KEY | Project Settings → API → service_role secret key | Server-only — never expose |
Run database migrations
All schema definitions, RLS policies, seed data, and function declarations live in the This applies all pending migrations to your linked Supabase project in the correct order.Option B — Supabase Dashboard SQL Editor:Navigate to your project’s SQL Editor and run each file from
supabase/migrations/ directory. The project ships with 31 migration files covering every module from the core tenant schema through the pre-engineering wizard assistant.Option A — Supabase CLI (recommended):supabase/migrations/ in ascending filename order (migrations are prefixed with a timestamp, e.g. 20260617000001_seed_master_data.sql).Migrations must be applied in strict chronological order. Later migrations reference tables, functions, and RLS policies created by earlier ones. Skipping or reordering files will cause foreign-key or policy errors.
Start the development server
Launch the Next.js development server.The server starts at
http://localhost:3000. You should see the platform landing page for the default tenant.Available Test Tenants
The project ships with two fully seeded demo tenants, each with its own brand identity, product catalog, clients, quotes, invoices, and inventory records.AeroMax Industrial
Tenant code:
acmeTheme: Sky blue / industrialUUID: a0000000-0000-0000-0000-000000000000The primary reference implementation. Demonstrates the full ventilation and industrial engineering vertical, including the pre-engineering wizard, SCADA-style dashboards, and PDF diagnostic reports.Apex Logística B2B
Tenant code:
apexTheme: Green / logisticsUUID: b0000000-0000-0000-0000-000000000000A second tenant proving the white-label isolation. All brand colors, logos, and settings are independently configured. Data is completely isolated from acme at the RLS layer.Test Scripts
The project includes a comprehensive suite of per-module test scripts you can run independently. Each script seeds data and exercises its module’s Server Actions in isolation — no shared test state.Run
npm run test:multitenant first after applying migrations — it validates that RLS policies correctly isolate acme and apex data before you test individual modules.