Skip to main content

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.

B2B Import ERP is a production-grade, modular enterprise resource planning platform built for industrial B2B companies — specifically ventilation, HVAC, and industrial engineering firms. It covers the complete commercial and operational lifecycle: from initial lead capture and technical pre-engineering wizards, through quoting, multi-level approvals, and job execution, all the way to invoicing, Wompi payment processing, and post-sale warranties. The platform is architected as a true multi-tenant SaaS — every record is scoped to a tenant_id enforced at the PostgreSQL Row Level Security (RLS) layer, making it suitable for agencies, resellers, or ISVs who need to serve multiple independent clients from a single Next.js deployment.

What B2B Import ERP Covers

The platform is organized around three major areas of business operations:
  • Multi-Tenant SaaS Core — Tenant provisioning, white-label branding (logo, colors, domain — zero code changes), user and role management (RBAC), site and area hierarchies, and a full audit trail on every critical state change.
  • Commercial Lifecycle — CRM leads with scoring (CALIENTE / TIBIO / FRÍO / SPAM), B2B client profiles, technical requirements, itemised quotes with multi-level approval workflows, and a public-facing interactive pre-engineering wizard (WizardStepper) for prospect qualification and CFM calculations.
  • Operations & Finance — Work order (job) management, multi-warehouse inventory stock control with movement history, electronic invoicing, Wompi payment gateway integration with webhook processing, and post-sale warranty claim tracking.
Every tenant receives its own isolated data partition and can configure its own brand colors, logo, and domain through the white-label settings panel — no code change or redeployment required.

Roles and Access Control

The platform ships with nine pre-defined roles modelled in a full RBAC matrix. Every permission is evaluated at runtime through a three-tier cascade: role defaults → per-user exceptions (user_permissions table) → site-level restrictions.
RoleScope
SUPER_ADMINPlatform-wide — tenant provisioning, global audit
ADMIN_EMPRESAFull tenant admin — users, settings, all modules
GERENTE_GENERALMulti-site visibility — approvals, finance, ops
DIR_COMERCIALCommercial director — quotes, clients, approvals
EJECUTIVO_COMSales executive — CRM, quotes, requirements
DIR_OPERACIONESOperations director — jobs, inventory, field ops
TECNICO_CAMPOField technician — job execution, inventory movements
AUDITORRead-only audit access across commercial and finance
CLIENTEClient portal — own quotes, invoices, documents

Technology Choices

B2B Import ERP is built on a deliberately minimal, high-leverage stack chosen for long-term maintainability in enterprise contexts.
ConcernTechnology
FrameworkNext.js 16 (App Router, React 19)
DatabasePostgreSQL via Supabase
Tenant isolationRow Level Security (RLS) policies
AuthSupabase Auth (GoTrue / JWT)
UI ComponentsRadix UI (headless primitives)
StylingTailwind CSS v4
AnimationsFramer Motion (transitions < 200 ms)
FormsReact Hook Form + Zod
ChartsRecharts
PDF ExportjsPDF (dynamic import, client-side)
Excel ExportXLSX
PaymentsWompi payment gateway (webhook at /api/webhooks/wompi)

Architecture Pillars

The codebase is governed by four non-negotiable architectural rules that apply across every module:
  1. No direct database access from the UI. All data mutations flow through Next.js Server Actions. UI components never import or call Supabase directly for business operations.
  2. Domain layer owns all business rules. Validation, state transitions, approval logic, and audit recording are centralised in Server Actions and utility modules — never scattered across React components.
  3. Tenant isolation at the RLS layer. Application-level tenant_id filtering is supplementary; the RLS policies in PostgreSQL are the security boundary. A compromised application query cannot leak cross-tenant data.
  4. Every action is audited. Create, update, soft-delete, status change, approval, and rejection events are recorded to the audit_log table with actor, timestamp, and previous/next state.

Explore the Documentation

Quickstart

Clone the repo, configure environment variables, run migrations, and access your first tenant dashboard in under 10 minutes.

Architecture

Deep-dive into the layered module design, directory structure, and the rules that keep the codebase maintainable at scale.

Multi-Tenancy

Understand how tenant isolation works through PostgreSQL RLS policies and the tenant_id contract.

RBAC & Permissions

Learn how roles, permissions, and per-user exceptions are modelled and enforced across all modules.
The reference implementation ships with two pre-configured demo tenants in the ventilation and industrial engineering sector — AeroMax Industrial (acme) and Apex Logística B2B (apex). All seed data, product catalogs, and test scripts target this vertical. When deploying for a different industry, tenant settings, catalog data, and the pre-engineering wizard decision trees are fully configurable from the admin panel without touching source code.

Build docs developers (and LLMs) love