Skip to main content

Module Map

Switchyard uses a modular architecture. This document maps which modules we use, which are custom-built, and which are not needed for our use case.

Module Overview

Active Core Modules

These modules are actively used and essential to Switchyard operations.
ModulePurpose in SwitchyardKey Features Used
ProductProduct catalog from retailer scrapingProducts, variants, categories, images
InventoryStock levels at RFC and retailersQuantity tracking, reservations
Stock LocationRFC warehouse structureZones, aisles, locations
OrderCustomer orders from mobile appOrder creation, line items, status
CustomerCustomer accountsProfiles, addresses, order history
PricingRetailer costs + selling pricesPrice lists, multi-price per product
UserAdmin users and staffRoles, permissions, authentication
AuthAuthentication systemSupabase integration, JWT, sessions
API KeyAPI authenticationService accounts, publishable keys

Custom Modules

These modules are custom-built for Goods-specific functionality.

Inventory Group

Location: packages/modules/inventory-group/ Extends stock locations with a hierarchical structure for warehouse organization.
EntityDescription
ZoneTop-level warehouse area (e.g., refrigerated, dry goods)
AisleRow within a zone
BaySection within an aisle
ShelfVertical level within a bay
SlotSpecific position on a shelf
Used by: Picker app for efficient route navigation

Drivers

Location: packages/modules/drivers/ Manages drivers who perform sweeps and deliveries.
EntityDescription
DriverPerson who shops at retailers, includes contact info, vehicle info
Used by: Sweep assignment, driver apps

Sweeps

Location: packages/modules/sweeps/ Daily shopping trips to retailers to fulfill orders.
EntityDescription
SweepScheduled trip to a retailer
SweepItemItem on the sweep manifest
Used by: Order allocation, driver manifest, intake processing

Picking

Location: packages/modules/picking/ RFC warehouse picking operations.
EntityDescription
PickListAssignment of orders to a picker
PickListItemIndividual item to pick with location
Used by: Picker scanner app, warehouse operations

Modules Kept for Future

These modules are not heavily used now but will be needed as we scale.
ModuleCurrent UseFuture Use
Sales ChannelSingle storefrontMultiple storefronts, B2B
RegionSingle region (Austin)Geographic expansion
NotificationMinimalCustomer notifications, internal alerts
FulfillmentNot as designedRepurpose for sweep/pick tracking

Modules Not Used (But Kept)

These modules are not actively used in Switchyard operations, but are kept because they are tightly integrated with core functionality. Removing them would risk breaking internal workflows.
ModuleReason Not UsedWhy Kept
CartMobile app manages cartRequired by Order module internals
PaymentPayments in mobile app via StripeRequired by Order module internals
TaxSimple tax calculation in appRequired by Order validation
PromotionNo promotions currentlyMay be used in future
Gift CardsNot offeredLow overhead, future optionality
CurrencyUSD onlyRegion module dependency
Note: These modules don’t cause issues by existing. Attempting to disable them could break order creation and validation workflows. Leave them in place.

Infrastructure Modules

These support core functionality and should be kept.
ModulePurpose
Cache (Redis)Performance caching
Event Bus (Redis)Async event handling
Workflow EngineBackground job processing
LockingDistributed locks
IndexSearch indexing
FileFile/image storage

Module Dependencies

Key dependencies to be aware of:

Configuration

Modules are configured in apps/goods-backend/switchyard-config.ts. To disable a module, remove it from the modules array or set enabled: false.

Adding New Modules

When adding a custom module:
  1. Create module in packages/modules/[module-name]/
  2. Include: package.json, tsconfig.json, src/index.ts
  3. Define models in src/models/
  4. Create service in src/services/
  5. Add migrations in src/migrations/
  6. Register in switchyard-config.ts