How openfoodfoundation/openfoodnetwork works
Open Food Network is a multi-store marketplace connecting local food producers and hubs with buyers. The principal customer journey is discovering a shop and its products, adding items to a cart, and checking out through a payment option. The repository also has distinct enterprise administration, APIs, reporting, and connected-app/webhook capabilities. The tree and sampled routes support the customer and payment entry points; unsampled subsystems are included where their paths identify meaningful product areas, without asserting unverified call relationships.
Main entry points: enterprises_controller.rb Enterprise admin · shop_controller.rb Shopfront · connected_app.rb Connected apps · products_controller.rb Product catalog
Components 15
Customer commerce
- Shopfront
app/controllers/shop_controller.rb - Product catalog
app/controllers/products_controller.rb - Cart endpoint
app/controllers/spree/orders_controller.rb - Cart operations
app/services/cart_service.rb - Checkout
app/controllers/checkout_controller.rb - Order lifecycle
app/models/spree/order.rb
Marketplace operations
- Order cycles
app/models/order_cycle.rb - Enterprise admin
app/controllers/admin/enterprises_controller.rb - Inventory
app/models/inventory_item.rb - Reporting
lib/reporting/report_query_template.rb
Platform interfaces
- Public API
app/controllers/api/v0/base_controller.rb
Payments and integrations
- Payment gateways
app/controllers/payment_gateways/stripe_controller.rb - Webhook delivery
app/jobs/webhook_delivery_job.rb - Connected apps
app/models/connected_app.rb
Other components
- Buyer
Connections 9
- Buyer → Shopfront: browses shops
- Shopfront → Product catalog: opens products
- Buyer → Cart endpoint: opens cart
- Buyer → Checkout: starts checkout
- Buyer → Payment gateways: returns to payment
- Buyer → Order lifecycle: views token order
- Enterprise admin → Order cycles: manages cycles
- Enterprise admin → Inventory: manages stock
- Connected apps → Webhook delivery: delivers events