Skip to content
Farivar ZarvandehAI · PRODUCT · SYSTEMS
About meMy projectsMy skillsContact

Farivar ZarvandehAI · PRODUCT · SYSTEMS

Full-stack AI Developer & Technical Product Manager. Hamburg, Germany.

Products

  • Prodcommerce
  • ProdBusiness
  • ProdEngine
  • Prodinvoice
  • StoryBrook
  • Letterman
  • JobXentral
  • BI Next

Elsewhere

  • Contact form
Built by Farivar — Next.js, React Three Fiber, custom GLSL, ElevenLabs Agents.
AboutProjectsSkillsContact
My projects/02

Enterprise B2B ERP

ProdBusiness

Designed & built full-stack by Farivar Zarvandeh

Explainable enterprise B2B ERP with database-enforced correctness.

PrototypeWholesalers and distributorsIndustrial suppliersPurchasing, sales and warehouse teams
Explainable price waterfallInteractive mechanism · illustrative data
0255075100€100List-14Contractv1-6Volumev2-4Promotionv3+3Alloyv1-2Year-endv2€77Net
Toggle a rule to re-price. Every step explains itself.
Database tables
480
Domain schemas
32
Foreign keys
2,638
RLS policies
474
UI routes
90
Passing DB validation checks
30

Figures counted from the repository; maturity note: Navigable mock-data frontend and executable, validated PostgreSQL reference schema. The FastAPI backend, integrations and live AI are planned across a 60-sprint roadmap.

01

Product introduction

ProdBusiness is an enterprise B2B ERP for wholesalers, distributors and industrial suppliers. One explainable engine covers pricing, procurement, stock and finance. A navigable workspace prototype and a 480-table PostgreSQL model that enforces correctness and tenant isolation in the database are built; the FastAPI backend is planned.

02

The problem

Many ERPs keep price, invoice and stock truth separately for each channel. Staff orders, portals, EDI and field agents can then disagree. Multi-company books, warehouse-scoped stock and B2B exceptions (credit holds, price mismatches, missing receipts) end up spread across modules and spreadsheets. AI features are often bolted on without evidence, approvals or an audit trail. ProdBusiness's own predecessor showed these limits: one legal company, globally keyed stock and a scheduler tied to the web process.

03

The solution

ProdBusiness is designed around one authoritative calculation and execution core shared by every channel. PostgreSQL itself enforces balanced journals, immutable posted ledgers, sealed price decisions, single-reservation stock and tenant/company row-level security. The UI is role-first and explainable: work queues, entity workspaces, a price waterfall showing applied and skipped rules, plain-language invoice-match explanations and decision previews before any commit. AI is limited to proposals: it shows evidence and a before/after diff, and a human approves before any action, which is recorded as an action receipt.

04

Core features

  • Role-first workspaces

    Implemented

    Twelve module workspaces (Sell, Buy, Stock & Ship, Finance and more) across 90 routes. They include a command palette, persona switcher, record timeline drawer and English/French UI.

  • Procurement suite

    Partial

    Requisitions, RFQs with a bid comparison matrix, purchase orders, proforma invoices and landed cost, all built as working mock screens.

  • Explainable invoice matching

    Partial

    Price, quantity, tax, duplicate and missing-receipt mismatches are explained in plain language, with status and next step.

  • Price waterfall

    Partial

    Each pricing step shows whether it was applied or skipped, why, and which rule version produced it.

  • Warehouse and shipping

    Partial

    Receiving and two-stage receipt, bin positions, scan-based picks, blind counts, shipments, carriers and load planning.

  • Finance workspace

    Partial

    Chart of accounts, journals, open items, a bank reconciliation split view, period close and e-invoicing queues.

  • Database-enforced invariants

    Implemented

    Balanced journals, immutable ledgers, sealed pricing, idempotent commands and no double stock reservation, verified by 30 passing checks on embedded PostgreSQL.

  • Tenant and company isolation

    Implemented

    Forced row-level security with restricted runtime roles. A missing tenant context fails closed.

  • AI proposal drawer

    Partial

    AI suggestions appear as uncommitted proposals with purpose, evidence, a before/after diff, uncertainty and an approval boundary.

  • FastAPI domain services and workers

    Planned

    A versioned /api/v1 command API, a durable outbox, integration workers and Redis-assisted caching.

  • EDI, carrier and e-invoice integrations

    Planned

    EDI partner onboarding, DHL/freight booking, structured e-invoices and bank feeds through certified adapters.

05

System architecture

Two layers are built today: a Next.js App Router workspace prototype running on an in-memory mock store, and an executable PostgreSQL reference model validated in embedded Postgres. The target runtime is a domain-modular FastAPI monolith. It writes canonical state to PostgreSQL, publishes through a durable outbox to separate domain and integration workers, and uses Redis only for reconstructable caches and rate limits. AI tools may only call allowlisted domain commands through approval-gated proposals.

Hover or focus a component to trace its real connections.

EXPERIENCESERVICES & RUNTIMEINTELLIGENCEDATA & INTEGRATIONSStaff workspacesBuyer / supplier / agen…FastAPI domain APIsOutbox & integration wo…PostgreSQL canonical st…RedisDocument storageAI proposal layerEDI, carriers, banksPGlite schema validator

10 components · 10 connections, as found in the repository.

06

Technology stack

frontend
Next.js (App Router, Turbopack)ReactTypeScriptlucide-reactIBM Plex
backend
FastAPI (planned)Python (planned)SQLAlchemy / Alembic (planned)
data
PostgreSQLRow-level securityRedis (planned)
ai
Policy-bound proposal and receipt modelProvider-agnostic (planned)
infra
PGlite validation harnessNode.js toolingS3-compatible storage (planned)
integrations
EDI / Peppol (planned)DHL and freight (planned)ZUGFeRD / XRechnung (planned)DATEV and FEC exports (planned)

07

Product experience

An AI core with BI and workflow rings connects import, export, warehouse, marketing, regulation and omnichannel sales stations
ConceptAn illustration of how ProdBusiness works — real product screens will be added here soon.

Procure-to-pay

  1. 1Raise requisition
  2. 2Run RFQ and compare bids
  3. 3Issue purchase order
  4. 4Receive goods
  5. 5Capture supplier invoice
  6. 6Resolve explained match exception
  7. 7Approve and pay

Quote-to-order

  1. 1Qualify lead
  2. 2Track opportunity
  3. 3Build quote with price waterfall
  4. 4Apply contract or price book
  5. 5Release sales order

Warehouse cycle

  1. 1Receive and inspect
  2. 2Put away to bin
  3. 3Pick with scan task
  4. 4Blind count
  5. 5Plan load and ship

AI-assisted change

  1. 1Open AI proposal
  2. 2Review evidence and diff
  3. 3Check uncertainty and boundary
  4. 4Prepare draft for approval

07b

AI capabilities

  • Reviewable AI proposals

    A dedicated drawer shows an AI suggestion's purpose, supporting evidence, before/after diff and uncertainty. It is clearly marked as not committed until a human approves.

  • Governed AI data model

    Thirteen schema tables cover model policies with spend limits, allowlisted tools and grants, budgeted runs, proposals, evidence citations, action receipts and safety evaluations.

  • Planned grounded assistance

    Roadmap items: document extraction with citations, quote and price explanation, bid summaries, forecasting and exception triage. Autonomy is tiered from read-only up to approval-required financial actions.

08

Engineering challenges

  1. 01

    Ledger correctness inside the database

    Deferred constraint triggers reject unbalanced journals at commit and block mutation of posted lines. Accounting truth does not depend on application code.

  2. 02

    Concurrency-safe stock reservation

    Scoped writers and guards ensure the last unit cannot be reserved twice and a retried posting batch cannot deduct stock twice.

  3. 03

    Multi-tenant, multi-company isolation

    474 row-level security policies with restricted roles, composite scoped foreign keys and fail-closed empty context, all checked by automated tests.

  4. 04

    Keeping 480 tables coherent

    A machine-readable schema model, a feature-to-entity map and Node validators keep table, column and FK counts consistent with the docs and 32 ER diagrams.

09

Technical differentiators

  • Explainability first

    Price waterfalls, plain-language match explanations and decision previews show users why something happens before they commit.

  • Correctness by construction

    Money, stock, idempotency and isolation rules live in PostgreSQL guards rather than only in services.

  • AI that proposes, never silently acts

    Every AI suggestion carries evidence and a diff and requires approval. Executed actions leave a permanent receipt.

  • Falsifiable product goals

    Each candidate differentiator has a measurable pass/fail evidence gate instead of a marketing claim.

10

Explore further

Request a walkthrough

The source repository is private. A live walkthrough is available on request.

Previous · 01ProdcommerceSelf-hosted multichannel ERP for merchants selling everywhereNext · 03ProdEngineGoverned task loop that keeps AI coding agents accountable