A portfolio-ready order integration control tower that normalizes commerce orders, applies configurable routing rules, delivers them through background workers, and exposes failures through a polished operations dashboard.
A merchant receives orders from Shopify, Amazon, Magento, and B2B sales channels. OrderFlow validates each payload, chooses the correct ERP, warehouse, or shipping connector, and records every decision in a durable audit trail. Failed deliveries are retried automatically and remain visible for manual recovery.
- PostgreSQL persistence with SQLAlchemy 2 and Alembic migrations
- Redis-backed Celery worker with exponential retry behavior
- Deterministic mock NetSuite, SAP S/4HANA, ShipStation, and WMS connectors
- Priority-based routing by channel, destination, and order value
- API-key-protected webhook ingestion and bulk CSV imports
- Searchable responsive dashboard with metrics, failures, and live routing state
- Five-order demo scenario, including a deliberate dead-letter example
- Health/readiness probes, non-root Docker image, and persistent volumes
- Isolated integration tests and GitHub Actions CI with Docker build verification
- Render Blueprint for a public web service, worker, PostgreSQL, and Key Value service
flowchart LR
A[Storefronts and marketplaces] -->|Webhook / CSV / REST| B[FastAPI ingestion]
B --> C[(PostgreSQL)]
B --> D[Routing rules]
D --> E[Redis queue]
E --> F[Celery worker]
F --> G{Mock connectors}
G --> H[NetSuite ERP]
G --> I[SAP S/4HANA]
G --> J[Warehouse WMS]
G --> K[ShipStation]
F -->|Audit and retries| C
C --> L[Control Tower dashboard]
git clone https://github.com/hunterinvariants/orderflow-integrator.git
cd orderflow-integrator
docker compose up --build -dFor hosts with legacy Compose v1:
docker-compose up --build -dOpen the dashboard at http://localhost:8000 and OpenAPI at http://localhost:8000/docs. The container applies migrations and loads demo data automatically. The demo is idempotent, so restarts do not duplicate orders.
Check the stack:
docker-compose ps
curl http://localhost:8000/health
curl http://localhost:8000/readyThe included scenario demonstrates four successful paths and one repeatable failure:
| Order | Source | Routing result | Outcome |
|---|---|---|---|
SHOP-10481 |
Shopify | NetSuite ERP | Synchronized |
AMZ-77429 |
Amazon | Warehouse WMS | Synchronized |
B2B-93018 |
Salesforce | SAP, because value exceeds $1,000 | Synchronized |
SHOP-10482 |
Shopify | ShipStation | Synchronized |
FAIL-2207 |
Magento | Warehouse WMS | Failed and retryable |
Reload the scenario at any time:
curl -X POST http://localhost:8000/v1/demo/seedCreate an order:
curl -X POST http://localhost:8000/v1/orders \
-H "Content-Type: application/json" \
-d '{
"external_order_id": "SHOP-20001",
"source_system": "shopify",
"destination_system": "shipping",
"customer_id": "customer-88",
"items": [{"sku": "SKU-RED", "quantity": 2, "unit_price": "29.95"}]
}'Send an authenticated webhook:
curl -X POST http://localhost:8000/v1/webhooks/orders \
-H "X-API-Key: demo-orderflow-key" \
-H "Content-Type: application/json" \
-d @order.jsonImport the included CSV:
curl -X POST http://localhost:8000/v1/orders/import \
-F "file=@examples/demo-orders.csv"| Method | Endpoint | Purpose |
|---|---|---|
GET |
/ |
Operations dashboard |
GET |
/health and /ready |
Runtime and database checks |
GET |
/v1/metrics |
Aggregated workflow metrics |
GET/POST |
/v1/orders |
List and create orders |
POST |
/v1/orders/{id}/route |
Apply a rule or explicit connector |
POST |
/v1/orders/{id}/retry |
Requeue a failed delivery |
POST |
/v1/orders/import |
Import orders from CSV |
POST |
/v1/webhooks/orders |
Authenticated webhook ingestion |
GET |
/v1/routing-rules |
Inspect decision rules |
GET |
/v1/integrations |
Inspect connector capabilities |
python -m pip install -e ".[dev]"
python -m alembic upgrade head
python -m app.seed
uvicorn app.main:app --reloadRun verification:
python -m compileall -q app tests
python -m pytestSQLite is the zero-configuration local default. Docker Compose automatically uses PostgreSQL and Redis.
Copy .env.example to .env when running outside Compose. Change ORDERFLOW_API_KEY before exposing the service publicly. Connector implementations are deterministic mocks designed to demonstrate integration architecture without third-party credentials.
The production-like Docker stack can run on an existing Ubuntu server and be published for free through Cloudflare Tunnel. This keeps FastAPI, PostgreSQL, Redis, and Celery running together without exposing a home IP address or opening inbound router ports.
Prerequisites:
- Add your domain to a free Cloudflare account.
- Change the registrar nameservers to the two nameservers assigned by Cloudflare.
- In Cloudflare Zero Trust, create a tunnel named
orderflow-hunter-mvp. - Add a public hostname such as
orderflow.hunter-mvp.comwith service URLhttp://api:8000. - Copy the tunnel token into the server's untracked
.envfile asCLOUDFLARE_TUNNEL_TOKEN.
Start the stack and tunnel:
docker-compose -f docker-compose.yml -f docker-compose.cloudflare.yml up --build -dVerify the local services and tunnel:
docker-compose -f docker-compose.yml -f docker-compose.cloudflare.yml ps
curl http://localhost:8000/healthCloudflare provides the public HTTPS certificate and sends traffic through an outbound-only tunnel. Never commit the tunnel token or paste it into issue reports, screenshots, or chat messages.
