Brigade · ChefBridge system architecture
Technical system view · working proposal

How Brigade sends data into ChefTec.

This separates the customer experience, Brigade’s existing application, the proposed AWS integration layer, and Dan’s ChefTec importer. It covers account linking, recipe transfer, invoice transfer, and the receipt back to the chef.

Exists in Brigade Proposed ChefBridge component ChefTec-owned component
The browser talks only to Brigade. An explicit publish creates the transfer operation and outbox record in one Brigade transaction. A background worker handles ChefTec; the chef sees local status and never waits on the legacy system.
System architecture

Brigade handles the experience. ChefBridge handles the transfer.

The chef saves first, then explicitly sends approved data. The transfer continues in the background.

ChefBridge architecture from Brigade to ChefTec The Brigade web app talks to the Brigade server. Brigade stores approved recipe and invoice work locally, then a background worker sends it through the ChefBridge API. ChefBridge checks the customer through Calypso, stores transfer state in its SQL Server integration database, and lets a Dan-built ChefTec connector claim and import approved work. Status returns to Brigade for the chef. BRIGADE WE BUILD CHEFBRIDGE · AWS PROPOSED protected HTTPS edge → private service CHEFTEC Brigade Web app Recipe approvedready to send Invoice confirmedready to send Send to ChefTec BRIGADE SERVER Django API save · review · authorize browser talks only here Brigade DB recipes · invoices transfer status BACKGROUND SYNC Send + check status continues after the chef leaves CHEFBRIDGE API Check + route private Django service links · transfers · status Integration DB RDS SQL Server Express connections · transfers · receipts EXISTING Calypso supported read-only authorization supported account check DAN PROVIDES Supported contract · customer/site fields Network path · meanings · test account DAN BUILDS ChefTec connector get approved work run existing importer · return result Customer ChefTec DB import
Product and transfer flow Account check Badges identify who builds or provides each part.
STATUS RETURNS Chef sees resultBrigade statusChefBridge receiptChefTec import result
Pilot tech stackCurrent → proposed → existing
Brigade · currentDjango/DRF + PostgresCelery/Redis runs background delivery.
ChefBridge · proposedAPI Gateway or ALBProtected HTTPS → private Django/DRF service → RDS SQL Server Express.
ChefTec · existingDan’s connectorImports into the customer’s ChefTec SQL Server.
ChefBridge tracks transfers and receipts. The customer’s ChefTec database remains the system of record.
Open the detailed component and endpoint map
Holistic architecture

Detailed component reference.

Use the controls to isolate one path. The full view shows where each service runs and which system owns each record.

1 · Brigade productChef-visible web experience
2 · Brigade applicationExisting Django/DRF + workers
3 · Brigade dataApplication truth and artifacts
4 · ChefBridge on AWSProposed delivery and receipt boundary
5 · ChefTecExisting systems + Dan-built connector
Current React / Vite web app Runs in desktop or mobile browser. Camera and file upload stay in the same product.
Proposed screen ChefTec connection Chef chooses Connect ChefTec and confirms the authorized customer/location.
Current + extension Recipe review Review content, yield, cost, and attention items. Publish is an explicit action.
Current + extension Invoice review Confirm totals and exceptions, learn prices and packs, then publish.
Proposed screen Transfer status Queued, importing, imported, needs review, or failed—with an action.
Current Brigade HTTPS API Django + DRF remains the browser-facing product API. The browser does not call ChefBridge or ChefTec.
  • POST /api/v1/recipes/capture/
  • POST /api/v1/invoices/capture/
  • GET  /api/v1/.../status
Current Capture + extraction Stores the source, extracts structured content, then sends deterministic facts to costing and review.
Current + proposed dispatch Celery worker + Redis Runs capture and costing today. The ChefBridge extension dispatches committed outbox records and retries independently of the browser.
Proposed endpoints ChefTec integration API
  • POST /integrations/cheftec/link/
  • POST /integrations/cheftec/operations/
  • GET  /integrations/cheftec/operations/{id}/
Current database Brigade Postgres Current product truth for recipes, invoices, decisions, and costing. ChefBridge records below are a proposed extension.
Current / target Object storage Original recipe photos and invoice PDFs. AWS deployment should use S3 with tenant-scoped keys and retention rules.
Proposed record ChefTec connection record Brigade org → authorized CustDetID + site scope + token reference. No ChefTec password.
Proposed record Operation + transactional outbox Approved content, operation UUID, payload digest, destination, and needs-delivery record commit atomically. A saved operation cannot be lost before dispatch.
AWS · proposed Protected edge + ChefBridge API API Gateway or ALB exposes protected HTTPS. A separately permissioned private Django service handles link checks, versioned transfers, and read-back.
AWS · proposed Private ChefBridge service Validates service identity, customer/site scope, schema version, request digest, and idempotency key. It fails closed.
Not in pilot SQS scale layer Not part of the first pilot. Add only if volume or worker isolation requires another queue.
Pilot decision ChefBridge Integration DB Private Amazon RDS for SQL Server 2022 Express stores account connections, transfer operations, and result receipts. Pilot: db.t3.small, Single-AZ, encrypted 20 GiB gp3, seven-day backups. Least-privilege SQL users rotate through Secrets Manager; RDS SQL Server has no IAM database authentication. A future centralized database requires a separate source-of-truth schema and architecture decision.
Existing · Dan provides contract Calypso ChefBridge may check customer and site authorization directly only through a Dan-supported read-only contract and network path. Missing or failed authorization blocks transfer.
Dan builds ChefTec connector Claims authorized work through the protected ChefBridge API and returns the import result.
Existing logic ChefTec importer The Dan-built connector invokes existing mapping, duplicate, ID, and transaction-safe import routines.
ChefTec truth Customer SQL Server Local or hosted customer database. Brigade never connects to or edits these business tables directly.
Account link
Chef initiatesConnect ChefTec
Brigade requestAuthenticated link call
Store routeOrg + scoped customer
ValidateChefBridge checks route
Existing systemCalypso confirms scope
Recipe publish
ReviewChef approves version
Publish requestWait for local commit
Commit atomicallyOperation + outbox
After commit202 Queued; worker dispatches
ImportChefTec writes recipe
Invoice publish
ConfirmTotals + exceptions
Publish requestWait for local commit
Commit atomicallyOperation + outbox
After commit202 Queued; worker dispatches
PostChefTec writes invoice
Status return
Chef sees resultActionable state
Brigade readsGET operation status
Receipt storedIDs + warnings + time
Bridge updatedResult callback
Read-backChefTec confirms write

Target: the ChefTec connector claims work and returns results through the protected ChefBridge API. Direct SQL polling is permitted only for a restricted, disposable pilot.

Data ownership

Each store has one job.

Brigade Postgres

Product truth
  • Recipes and invoice captures
  • Chef decisions and kitchen memory
  • Cost projections and evidence
  • Connection and operation receipts (proposed)

S3

Source artifacts
  • Recipe photos/files
  • Invoice PDFs/images
  • Checksums and retention policy
  • No customer SQL tables

ChefBridge Integration DB

Pilot transfer truth
  • Authorized customer/site connections
  • Versioned transfer envelopes
  • Queued/claimed/result states
  • ChefTec read-back receipts

ChefTec SQL Server

Legacy truth
  • ChefTec recipe/item IDs
  • Imported invoices and mappings
  • Local or hosted customer data
  • Written only by ChefTec code
No browser-to-database connection. No Brigade database IDs become ChefTec IDs. Queued means Brigade safely accepted the request; imported appears only after ChefTec read-back.
Endpoint map

What exists and what must be added.

Brigade product API

StatusEndpointJob
CurrentPOST /api/v1/recipes/capture/Upload one recipe source.
CurrentGET /api/v1/recipes/capture/{id}/statusReturn recipe extraction state.
CurrentPOST /api/v1/invoices/capture/Upload an invoice source.
CurrentPOST /api/v1/invoices/{id}/confirm/Confirm invoice and learn eligible evidence.
ProposedPOST /api/v1/integrations/cheftec/link/Create a scoped ChefTec account connection.
ProposedPOST /api/v1/integrations/cheftec/operations/Create an approved recipe or invoice transfer.
ProposedGET /api/v1/integrations/cheftec/operations/{id}/Return the server-owned transfer state.

ChefBridge / ChefTec contract

OwnerEndpoint or operationJob
ChefBridgePOST /v1/connections/validateValidate route through the supported read-only Calypso contract; fail closed.
ChefBridgePOST /v1/operationsAccept recipe.create.v1 or invoice.post.v1.
ChefTecPOST /v1/operations/{id}/claimClaim work once for an authorized customer.
ChefTecPOST /v1/operations/{id}/resultReturn imported, needs-review, or failed receipt.
ChefBridgeGET /v1/operations/{id}Return status and read-back evidence.
Pilot fallbackrestricted SQL claimTime-boxed only: private connectivity, restricted stored procedures, per-installation least-privilege SQL credentials, and a documented removal date.
Runtime sequences

Recipe and invoice use the same delivery controls.

Recipe → ChefTec

recipe.create.v1
1
Capture and reviewBrigade extracts content, costs the recipe, and asks only material questions.
2
Approve destinationChef selects the connected customer/site and explicitly publishes.
3
Commit locallyBrigade atomically stores the approved version, immutable transfer operation, and outbox record, then returns 202 Queued.
4
Dispatch and importA background worker sends the retry-safe operation. ChefTec assigns its own IDs and applies duplicate rules.
5
Update local statusRead-back updates the Brigade operation. The browser reads queued, importing, needs review, failed, or imported from Brigade.

Invoice → ChefTec

invoice.post.v1
1
Capture and reconcileBrigade extracts vendor, dates, totals, products, fees, credits, and line exceptions.
2
Confirm and learnChef reviews exceptions; eligible prices and pack facts update Brigade.
3
Commit locallyBrigade atomically stores the confirmed invoice, immutable transfer operation, and outbox record, then returns 202 Queued.
4
Dispatch and postA background worker sends the retry-safe operation. ChefTec maps vendors, items, and accounts and writes transactionally.
5
Update local statusRead-back updates Brigade to posted, needs review, or failed. Valid invoice learning remains even if ChefTec posting fails.
Shared transport controls: explicit approval, atomic operation + outbox, customer scope, versioned payloads, idempotency, retry-safe dispatch, typed errors, and read-back. Recipe and invoice business schemas remain separate.
Build ownership

Who builds which connection.

Brigade product

Connection UI, recipe/invoice review, explicit publish action, progress, result, retry, and history.

Brigade platform

Product endpoints and local transfer records; transactional outbox; Celery dispatcher; protected edge; private ChefBridge Django service; private RDS SQL Server; security and observability.

Dan provides

A supported read-only Calypso contract and network path; validation rules; CustDetID/site meanings; test account; mapping rules; and expected responses.

Dan builds

The ChefTec connector that claims approved work, invokes existing import logic, and returns ChefTec IDs, warnings, and final status.

Decisions to close before implementation

Five items determine the exact pilot build.

1 · Connector edgeAPI Gateway or existing ALB/WAF in front of the separate ChefBridge connector API?
2 · Dispatch runtimeWorker schedule, retry backoff, dead-letter handling, and operational alerts?
3 · Calypso contractWhich call confirms CustDetID, site scope, and current authorization without storing a ChefTec password?
4 · Mapping contractExact customer/site identifiers, units, categories, duplicates, updates, and warnings?
5 · Pilot environmentWhich disposable hosted customer proves recipe first, then invoice, with read-back?