E-commerce ERP / Back-office automation
ProdCommerce (Prodsystem)
Designed & built full-stack by Farivar Zarvandeh
Self-hosted multichannel ERP for merchants selling everywhere.
- Sales channel integrations
- 6 + POS
- Route modules
- 25
- Service modules
- 120+
- Data models
- ~146
- Test files
- 116
- Test functions
- ~1,500
Figures counted from the repository; maturity note: Feature-rich and in active development (168 commits in about seven weeks), with green CI covering unit tests, render smoke tests, veraPDF and Postgres. It ships as a Docker Compose deployment with a first-run setup wizard. Some go-to-market tasks are still open.
01
Product introduction
ProdCommerce brings orders from Shopify, Amazon, Shopware, WooCommerce, eBay and POS into one order book. It then runs the whole back office on top of it, from warehouse dispatch to legally compliant German e-invoicing and DATEV export.
02
The problem
Merchants who sell on several shops and marketplaces end up with orders in separate back ends. Each one has its own status model, tax convention and API quirks. On top of that, German law requires gapless, immutable invoices, Storno-only corrections, ZUGFeRD/XRechnung e-invoicing, OSS reporting and a clean handover to the tax advisor. In the warehouse, labels, stock and channel fulfilment drift apart. Refunds and returns get handled ad hoc, with no approval or audit trail.
03
The solution
ProdCommerce is a white-labelled, self-hosted Flask ERP: one deployment per company. Every channel goes through a single idempotent order upsert, so dispatch, invoicing, accounting and reporting work the same for every source. Bins are the single stock truth, and the system adds carrier labels, an approval-gated exception workflow, ZUGFeRD PDF/A-3 invoices validated in CI, DATEV export, a customer portal and a PIM that pushes product data back out to every channel. LLM-powered listing generation and an ML forecasting ensemble for Amazon FBA replenishment run on the same platform.
04
Core features
Unified order book
ImplementedShopify, Amazon FBM/FBA, Shopware 6, WooCommerce, eBay and POS orders all go through one idempotent upsert. Orders arrive by scheduled sync, HMAC-verified webhooks or flat-file import.
Warehouse dispatch workbench
ImplementedA pick, pack, ship and fulfil workflow with scan-to-pick by bin, wave planning, a packing station and a mobile picker. Fulfilment is pushed back to every channel.
Bin-level stock ledger
ImplementedBins are the stock truth, and one ledger function is the only writer. Pick suggestions follow FIFO/FEFO and priority rules.
Carrier labels and returns labels
ImplementedDHL Parcel DE shipping and Retoure labels, and Sendcloud for DPD, GLS, UPS and Hermes, chosen by priority-based shipping rules.
Compliant e-invoicing
ImplementedGapless, immutable invoices issued as ZUGFeRD PDF/A-3 with embedded EN16931 XML, plus an XRechnung profile and multi-currency support. Every build validates them with veraPDF.
Invoice corrections with four-eyes approval
ImplementedStorno and partial correction documents with caps per line and VAT rate. Refunds generate proposals automatically, and corrected invoices can be re-issued.
DATEV, OSS and receivables
ImplementedDATEV EXTF batches, the EU One-Stop-Shop report, CAMT.053 bank matching and configurable dunning.
Order exception workflow
ImplementedCancellations, refunds, returns, replacements and store credit become one documented case, with an approver-not-requester gate and an audit trail.
Customer self-service portal
ImplementedBuyers sign in by magic link. They can see their own orders and invoices, start returns, accept quotes and apply for B2B terms.
PIM with channel syndication
ImplementedThe canonical product is the source of truth. Each field can be opted in, a dry-run diff runs before any push, and products can be listed on or removed from any channel.
Document designer
ImplementedDrag-and-drop layouts for invoices, delivery notes, quotes, confirmations and dunning letters. A validator blocks activation until all legally required blocks are present.
AI Magic Importer
ImplementedA LangGraph pipeline scrapes a product page, generates a validated SEO listing in one of 16 languages, and pushes it to Shopify, Shopware or the ERP.
Amazon FBA forecasting
ImplementedReorder points and replenishment recommendations from demand history. An advanced ensemble engine is available behind a feature flag.
Order-edit overlays for every channel
PartialLine adjustments for Shopware, WooCommerce and eBay orders exist, but invoicing and pick lists do not read them yet, so that UI stays hidden.
05
System architecture
ProdCommerce is a single Flask application in a Docker container, backed by PostgreSQL. Channel connectors feed an idempotent order upsert. An in-process APScheduler runs about 30 sync, forecast and retry jobs. Domain services (dispatch, invoicing, DATEV, PIM, portal) sit on top of one shared data model. Server-rendered Jinja UIs serve three separate auth realms: public, staff (RBAC) and the customer portal. Gunicorn runs one process with four threads, so there is exactly one scheduler and slow carrier calls do not block the UI.
Hover or focus a component to trace its real connections.
12 components · 12 connections, as found in the repository.
06
Technology stack
- frontend
- Jinja2Tailwind CSSVanilla JavaScriptSortableJSFlask-Babel (DE/EN)
- backend
- PythonFlask 3SQLAlchemy 2APSchedulerGunicorn (gthread)Pydantic
- data
- PostgreSQL 16Fernet-encrypted credentials
- ai
- LangChainLangGraphOpenAIGoogle GeminiAnthropicstatsmodelspmdarimaLightGBMSciPy
- infra
- DockerDocker ComposeGitHub ActionsveraPDFnginx (landing)
- integrations
- Shopify GraphQLAmazon SP-APIBaseLinkerShopware 6WooCommerceeBayDHL Parcel DESendcloudDATEV EXTFZUGFeRD / XRechnungECB FX ratesTwilio WhatsApp
07
Product experience

Order to cash
- 1Channel order synced or received by webhook
- 2Upserted into the unified order book
- 3Picked by bin with barcode scan
- 4Label created via DHL or Sendcloud
- 5Fulfilment pushed back to the channel
- 6ZUGFeRD invoice issued
- 7Payment matched and booked to DATEV
Customer return
- 1Customer starts a return in the portal
- 2Exception case and return label created
- 3Second person approves the refund
- 4Stock booked back into the returns zone
- 5Invoice correction proposed and issued
AI product listing
- 1Paste a product URL
- 2Page scraped for content and images
- 3LLM generates a structured listing in the shop language
- 4Operator reviews
- 5Pushed to Shopify, Shopware or ERP only
FBA replenishment
- 1Inventory and sales synced from Amazon
- 2Demand history built
- 3Forecast ensemble selects the best model
- 4Reorder point and quantity calculated
- 5Alert raised and purchase order created
07b
AI capabilities
Magic Importer pipeline
A LangGraph state graph (scrape, LLM processing, shop push) turns any product URL into a Pydantic-validated, SEO-optimised listing in one of 16 languages, preserving the merchant's SKU and barcode.
Provider-agnostic LLM layer
Admins choose OpenAI, Gemini or Anthropic and can edit the system and user prompts. API keys are stored encrypted.
PIM content assistant
Generates a title, HTML description and tags for a product from its known facts and image, as a suggestion the operator reviews before it is syndicated.
FBA demand forecasting ensemble
Holt-Winters, SARIMA, LightGBM and Croston SBA models with STL decomposition, Prime Day and Black Friday event multipliers, and backtest-based model selection, which feed service-level safety stock and reorder quantities.
08
Engineering challenges
- 01
PDF/A-3 conformance for legal invoices
Embedded fonts, a Microsoft Symbol (3,0) cmap patch for reportlab subsets, and sRGB re-encoding of CMYK logos were needed to pass veraPDF. CI now validates real and designer-built invoices on every push.
- 02
Unstable line-item keys across re-syncs
Sync deletes and re-inserts line items, so durable workflow data is keyed on stable platform line IDs with a SKU fallback, never on database primary keys.
- 03
Single-process scheduling
An in-process scheduler and rate limiter require exactly one Gunicorn process. Four threads keep slow carrier APIs from blocking every request.
- 04
Channel tax conventions
Invoices take the VAT each channel actually charged rather than recalculating it. Cent-level rounding is absorbed, and larger mismatches stop issuing before an invoice number is used up.
- 05
Migrations without Alembic
The schema evolves through an idempotent ADD COLUMN list run at boot. A test checks that every migration line maps to a declared model column.
09
Technical differentiators
Source-agnostic back office
Every channel converges on one order upsert, so adding a connector requires no change to dispatch, invoicing or reports.
Legal rules enforced as tests
One invoicing system, gapless numbering, immutability and a single stock writer are guarded by dedicated tests and CI validation.
Self-hosted and white-label
One deployment per company, with branding and legal identity from a single profile and no per-order metering.
Failures are surfaced, not swallowed
Unreported labels, failed auto-issues and e-invoice coverage gaps get their own retry queues and dashboard panels.
10