# Building a Farmers-Market Marketplace That Handles Real Inventory

Local food marketplaces look simple from the outside: shoppers browse tomatoes, eggs, bread, and flowers, then pick up an order at Saturday market. The hard part is that inventory is physical, seasonal, and often updated by vendors from a phone between harvest, packing, and travel. A useful system needs to treat availability as a living number, not a static catalog field.

## Inventory as a First-Class Model

In our marketplace, products are separate from inventory lots. A vendor may always sell “pasture-raised eggs,” but this week’s lot has its own quantity, pickup window, price, and cutoff time. That lets the platform preserve product history while allowing each market day to behave like a fresh selling event.

```yaml
pickup_window:
  market_id: downtown-saturday
  opens_at: 2026-07-18T08:00:00-04:00
  closes_at: 2026-07-18T13:00:00-04:00
  order_cutoff: 2026-07-17T18:00:00-04:00
```

## Checkout Under Contention

The checkout flow reserves inventory for a short period before payment confirmation. This avoids overselling when two shoppers add the last three pints of blueberries at nearly the same time. Reservations expire automatically if payment fails or the shopper abandons checkout, returning the stock to the available pool without requiring vendor intervention.

## Vendor Operations

The vendor dashboard is intentionally compact: update quantities, pause a lot, print packing lists, and mark orders fulfilled. Most vendors are not managing a warehouse; they are loading crates into a van. The interface should optimize for quick corrections and clear totals rather than deep merchandising controls.

## Reliability at Market Time

Saturday morning traffic is spiky, especially when reminder emails go out or pickup starts. Caching read-heavy catalog pages helps, but order placement must still hit transactional storage. The most important monitoring signals are reservation failures, payment webhook delays, and fulfillment queue lag, because those directly affect whether vendors can trust the system.

## What Makes It Work

A farmers-market marketplace succeeds when the software respects the operational rhythm of local food. Seasonal catalogs, limited lots, pickup windows, and vendor-friendly workflows are not edge cases; they are the core domain. Treating those constraints explicitly leads to a platform that feels reliable for shoppers and practical for producers.