Skip to main content
ABScaleForge
Back to blog
2 min read

Building Customer Flow — A Multi-Tenant Cloud ERP

How we architected Customer Flow as a multi-tenant ERP for import/export, manufacturing, and enterprise operations with Next.js, FastAPI, PostgreSQL, and Redis.

FastAPINext.jsPostgreSQLRedisSaaSERP

Import and export teams often split one job across email, Excel, and shared folders. When customs, a bank, or an auditor asks for a complete shipment record, nobody has one file. Customer Flow solves that with a private workspace per company on a shared platform.

The core problem

Documents live in inboxes, costs sit in spreadsheets, and PDFs sit in drives. The same pain hits manufacturers, NGOs, and logistics teams who need approvals and audit history — not scattered files.

Customer Flow runs one import from purchase through shipping papers, customs, duty, and warehouse receipt, with true landed cost on the same file. Export runs go from contract through export forms, packing, shipping, and payment close-out.

Architecture decisions

Each company is a tenant. Data is scoped by organization_id so companies never see each other's records. Platform admins can create tenants, manage users, and support customers safely.

The stack:

  • Next.js + TypeScript for screens and server rendering
  • Python FastAPI for the API layer with OpenAPI docs
  • PostgreSQL for transactional data
  • Redis + Celery for background jobs and caching
  • Docker + GitHub Actions deploying to DigitalOcean

Country rules for Pakistan, UAE, and other markets plug in as replaceable packs — so compliance logic stays modular instead of hard-coded.

What every action logs

Every important action — document upload, approval, PDF generation, secure link share — is logged in a permanent audit trail. That is not a nice-to-have for trade finance; it is the product.

Lessons learned

Multi-tenant ERP is less about CRUD and more about boundaries: tenant isolation, role permissions per company, optional 2FA, and auditability by default. Start with the compliance story, then build features around it.

If you are building SaaS for regulated industries, design the audit trail first. Everything else attaches to it.