Skip to content
P

Platform architecture

PIE is a two-sided, API-first, multi-tenant B2B platform for food and agriculture, built as a TypeScript monorepo.

PIE (Product Information Exchange) is a two-sided, API-first, multi-tenant B2B SaaS platform for the food and agriculture industry.

The two sides

  • Producers (PIPs) β€” cooperatives, farms, and processors β€” manage structured product data and grant access to buyers.
  • Buyers (PICs) β€” retailers, distributors, and restaurant chains β€” subscribe to supplier product feeds and integrate the data into their systems.

The cardinal relationship is producers produce, buyers read what they're granted. Everything else β€” GS1, compliance, passports, syndication, onboarding β€” hangs off that.

The applications

PIE is delivered as several applications over one API:

  • A REST API β€” the system of record, and the integration surface. Every capability is an API endpoint; the UIs are clients of it.
  • A producer app for PIPs, a buyer portal for PICs, an admin console for platform staff, and a marketing/docs site (where you are reading this).
  • Background workers for webhooks, sync, AI ingestion, and scheduled jobs.

Supporting infrastructure: PostgreSQL (product data + tenant isolation), Redis (sessions, cache, job queues), an S3-compatible object store (assets), a search engine (synced from the database), and a reverse proxy terminating TLS.

API-first conventions

The API is versioned under /api/v1/. It uses cursor-based pagination everywhere, a consistent error envelope, a request-ID header on every response, per-plan rate limiting, and schema validation on all input. Assets are uploaded directly to object storage via presigned URLs, never through the API server. See the API guides for the details.

Built for portability

The platform is self-hosted on Docker Compose behind a reverse proxy, and is designed to migrate to a managed cloud with only connection strings and DNS changing β€” no code changes. See the operator handbook.

Where to go next