Full Stack & Backend Engineer: Architecting a Real-Time Bill of Materials (BOM) Upload & Quoting Engine

In electronics manufacturing and industrial procurement, customers upload messy Excel (`.xlsx`) and CSV Bills of Materials (BOMs) containing hundreds of line items with inconsistent column headers, vendor-specific Manufacturer Part Numbers (MPNs), and tiered quantity breaks (`100`, `1,000`, `10,000` units). Querying 8 external distributor APIs (DigiKey, Mouser, Arrow, Element14) sequentially per line item takes 15+ minutes and times out HTTP connections. As a Full Stack Engineer and Backend Engineer, I architect streaming BOM ingestion and parallel distributor quoting engines that price 500-line BOMs in seconds.

1. Heuristic Header Detection & MPN Canonicalization

Uploaded customer spreadsheets rarely follow a strict template. Our ingestion parser normalizes Unicode punctuation, strips packaging suffixes (`-TR`, `-ND`, `/REEL`) to extract canonical base MPNs, deduplicates identical part requests across sub-assemblies, and fans out supplier lookups over bounded async worker pools:

import asyncio
import re
from dataclasses import dataclass

MPN_PACKAGING_SUFFIX_RE = re.compile(r"(-TR|-CT|-DKR|-ND|/REEL)$", re.IGNORECASE)

@dataclass(frozen=True)
class NormalizedBomLine:
    line_number: int
    raw_mpn: str
    canonical_mpn: str
    requested_qty: int

def canonicalize_mpn(raw_mpn: str) -> str:
    cleaned = re.sub(r"[^A-Za-z0-9.\-/]", "", raw_mpn.strip()).upper()
    return MPN_PACKAGING_SUFFIX_RE.sub("", cleaned)

async def quote_bom_lines_parallel(
    lines: list[NormalizedBomLine],
    supplier_client: object,
    concurrency_limit: int = 20,
) -> dict[str, dict]:
    sem = asyncio.Semaphore(concurrency_limit)
    unique_mpns = sorted({line.canonical_mpn for line in lines if line.canonical_mpn})

    async def fetch_mpn_offers(mpn: str) -> tuple[str, dict]:
        async with sem:
            offers = await supplier_client.fetch_tiered_pricing(mpn)
            return mpn, select_optimal_price_break(offers)

    results = await asyncio.gather(*(fetch_mpn_offers(mpn) for mpn in unique_mpns))
    return dict(results)

2. Real-Time Server-Sent Events (SSE) Progress & Price-Break Optimization

Rather than blocking the browser while supplier APIs respond, the backend immediately persists the parsed BOM in PostgreSQL, streams line-by-line pricing updates to the React / Next.js UI via Server-Sent Events (SSE), and caches normalized MPN price-break curves in Redis—integrating with our bounded-backpressure asyncio ingestion pipelines and secured API Gateway quoting endpoints.

Need a Full Stack Engineer or Backend Engineer to build a high-speed BOM quoting or B2B procurement engine? Book a 1-Day Engineering Sprint.


About the Author — Hire Aldian Fazrihady (Cloud Engineer, GCP Professional Cloud Architect, GCP Professional Data Engineer, Backend, AI & Full Stack Engineer)

Aldian Fazrihady is a Top-Rated Senior Cloud Engineer, GCP Professional Cloud Architect (Google Cloud Certified), GCP Professional Data Engineer (Google Cloud Certified), Backend Engineer (Python, Django, FastAPI, Go, PostgreSQL), AI Application Engineer (LLMs, RAG, MCP, Google ADK, LangGraph), and Full Stack Engineer (React, Next.js, TypeScript) with 15+ years of production software engineering experience.

Hire Aldian Fazrihady on Upwork | Book 1-Day Programming Service ($100 USD / Rp 1.000.000) | View Live AI Portfolio | Send a Direct Message

Related Engineering Articles

Engineering Role Pillar Guides & Category Hubs