Sign inSign up

pythonicshahdev/fastapi-commercial-source

By pythonicshahdev

•Updated 3 months ago

Image
0

961

pythonicshahdev/fastapi-commercial-source repository overview

⁠Boomi DataHub Accelerator — Commercial Source API (FastAPI)

Pre-seeded FastAPI image for the Boomi DataHub Demo Accelerator. Provides the commercial source system — Customers, Products, and Orders — as a live REST API backed by realistic seed data. Spin up in seconds, no configuration required.

Docker Pulls Image Size FastAPI Python Platform


⁠What's Inside

Three commercial domains pre-seeded and ready to serve — no external database, no setup scripts.

DomainEndpointRecordsDescription
Customer 360/customers200Commercial customer profiles with full demographic and CRM fields
Product 360/products200SAP-style material master records
Orders/orders775Orders distributed across customers with realistic buying patterns

All data is loaded from CSV at container startup and held in memory. Restart to reset to original seed data.


⁠Quick Start

docker run -d \
  --name datahub_fastapi \
  -p 4006:4005 \
  pythonicshahdev/fastapi-commercial-source:latest

Interactive API docs: http://localhost:4006/docs⁠

Port 4006 — mapped to avoid conflict with other FastAPI instances on 4005.

services:
  fastapi:
    image: pythonicshahdev/fastapi-commercial-source:latest
    container_name: datahub_fastapi
    ports:
      - "${FASTAPI_EXTERNAL_PORT:-4006}:4005"
    restart: unless-stopped

⁠Endpoints

⁠👤 Customer 360
MethodEndpointDescription
GET/customersAll customers. Filter by ?status= or ?segment=
GET/customers/{customer_id}Single customer (e.g. CUST-000001)
POST/customersCreate a customer
PUT/customers/{customer_id}Update a customer
DELETE/customers/{customer_id}Delete a customer

Key fields: customer_id · email · phone · address · customer_segment · account_type · credit_limit · payment_terms · currency · sales_org · industry · lifetime_value · preferred_channel · status

Segments: Strategic, Enterprise, Mid-Market, SMB, Government, Non-Profit, Consumer, Partner, Startup


⁠📦 Product 360
MethodEndpointDescription
GET/productsAll products. Filter by ?status= or ?material_type=
GET/products/{material_number}Single product (e.g. MAT-000001)
POST/productsCreate a product
PUT/products/{material_number}Update a product
DELETE/products/{material_number}Delete a product

Key fields: material_number · material_description · material_type (FERT/HALB/ROH/HIBE/DIEN/etc.) · material_group · base_unit_of_measure · gross_weight · net_weight · ean_upc · brand · division · sales_org · price · currency · status


⁠🛒 Orders
MethodEndpointDescription
GET/ordersAll orders. Filter by ?customer_id=
POST/orders/simulate?count=NGenerate N new orders in memory (1–500)

Key fields: order_id · customer_id · product_id · order_date · amount · customer_email

Seed distribution:

  • ~15% heavy buyers — 12–20 orders each
  • ~55% occasional buyers — 1–4 orders each
  • ~30% zero-order customers — no orders (useful for demonstrating partial enrichment)

Each order carries customer_email — pre-joined at startup from Customer360 data — so downstream consumers (e.g. Boomi Event Streams → DataHub) can match on email without a secondary lookup.

⁠Live Demo Trigger
curl -X POST "http://localhost:4006/orders/simulate?count=20"

Returns a summary of created orders and per-customer snapshots. Use this during a live demo to show data flowing through Event Streams into DataHub in real time.


⁠🏓 Health Check
GET /ping   →  { "status": "UP" }

⁠Connecting from Boomi

Designed to be consumed by a Boomi local atom running alongside it. Use host.docker.internal as the hostname from within Docker containers:

SettingValue
Base URLhttp://host.docker.internal:4006
AuthNone
Content-Typeapplication/json

Boomi Connector: REST (officialboomi-X3979C-rest-prod)


⁠Part of the Boomi DataHub Demo Accelerator

This image is the commercial source system in a multi-source DataHub demo. The full stack:

ImageRolePort
pythonicshahdev/datahub-mysql:latestAcademic SIS source — Institution, Department, Faculty, Course, Student3307
pythonicshahdev/fastapi-commercial-source:latestCommercial source — Customer, Product, Orders (this image)4006

Both source systems feed Boomi DataHub as the golden record hub via scheduled polling and event-driven enrichment:

FastAPI (this image)                    Boomi DataHub
  GET /customers  ──▶  Boomi  ──▶  Customer golden record
  GET /products   ──▶  Boomi  ──▶  Product golden record
  GET /orders     ──▶  Boomi  ──▶  Event Streams  ──▶  Customer enrichment
                                    (last_order_date, order_count)
⁠Integration Processes (pre-built)
  • DH - Customer Inbound — scheduled polling, Groovy transform, DataHub POST
  • DH - Product Inbound — scheduled polling, Groovy transform, DataHub POST
  • DH - Order Publisher — scheduled, aggregates per-customer order snapshots with email, publishes to Boomi Event Streams topic customer_orders

⁠Architecture

CSV seed files (baked into image at /data/)
    Customer360.csv  →  /customers   (200 records, CUST-000001..200)
    Product360.csv   →  /products    (200 records, MAT-000001..200)
    Orders.csv       →  /orders      (775 records, ORD-000001..775)
            |
            ▼
    In-memory store (loaded at startup)
            |
            ▼
    FastAPI (uvicorn, port 4005 internal)
            |
            ▼
    Host port 4006 (configurable via FASTAPI_EXTERNAL_PORT)

⁠API Design

Standardised error response:

{
  "errorCode": "404",
  "errorMessage": "Customer 'CUST-999999' was not found",
  "transactionId": "dd960082-abbf-47c2-8c65-f18eeb35848b",
  "timeStamp": "2026-06-18T14:32:11Z"
}

Optional x-correlation-id header on all endpoints for request tracing.

Full OpenAPI spec at /docs (Swagger UI) and /redoc.


⁠Environment Variables

VariableDefaultDescription
(none required)—Runs with zero configuration

ImagePurpose
pythonicshahdev/fastapi-commercial-source:latestDataHub demo — commercial source (this image)
pythonicshahdev/datahub-mysql:latestDataHub demo — academic SIS source
pythonicshahdev/fastapi-app-reusable:latestGeneral-purpose multi-domain API (7 domains)

⁠Source & Contact

Built and maintained by Shah

Tag summary

Content type

Image

Digest

sha256:fc5fb43e6…

Size

127.9 MB

Last updated

3 months ago

docker pull pythonicshahdev/fastapi-commercial-source