Marketplace Config
Switch the whole site from a directory into a single-owner marketplace — turn on the store format, then tune currency, cart, shipping and stock in one config file.
Why this matters
The boilerplate runs as exactly one format (vertical) per deployment. By default that's the directory — a catalog where the primary action is "visit the project." Flip it to store and the same core (auth, admin, payments, categories, browse grid, SEO, theming) stays in place while the listing-facing layer swaps over: items become products, cards become image-forward storefront cards, and the CTA changes from "visit" to "buy."
You don't rebuild anything — switching the format is two config values, and everything store-specific (cart, product pages, checkout, orders) is gated behind them.
File: config/platform.config.ts + config/features.config.ts + config/store.config.ts
How to switch
Two steps, both required:
1. Select the store format in config/platform.config.ts:
export const platformConfig: PlatformConfig = {
vertical: 'store', // 'directory' (default) | 'store'
};2. Enable the store feature flag in config/features.config.ts:
store: true, // off by defaultThe store format is feature-gated. If vertical: 'store' is set but the store flag is false, the platform falls back to directory. Set both before you expect to see products, a cart, or checkout.
Store settings
Once the store format is active, tune its runtime defaults in config/store.config.ts:
export const storeConfig: StoreConfig = {
currency: 'USD',
checkoutMode: 'stripe',
productSources: ['manual'],
cartEnabled: true,
taxEnabled: false,
shippingEnabled: true,
shippingCountries: ['US', 'CA', 'GB', 'AU', 'DE', 'FR', 'NL', 'ES', 'IT'],
lowStockThreshold: 5,
};| Field | Type | What it does |
|---|---|---|
currency | string | Fallback currency for products that don't set their own (e.g. 'USD'). |
checkoutMode | string | How buyers pay. 'stripe' uses native one-time Stripe Checkout. |
productSources | array | Where products come from. 'manual' = products you add yourself in the admin/submit form. |
cartEnabled | boolean | Show the cart drawer and "Add to cart" buttons. |
taxEnabled | boolean | Whether tax is calculated at checkout. |
shippingEnabled | boolean | Whether physical products collect a shipping address. |
shippingCountries | array | Allowed ship-to country codes. |
lowStockThreshold | number | Inventory level at which a product shows a low-stock hint. |
Prices are handled everywhere as integer minor units (cents). You enter them in normal units in the form; the platform stores them safely as minor units. Secrets — your Stripe keys — live in env vars, never in this config.
What changes when the store is active
With both flags on, the listing-facing layer switches over:
- Storefront cards — image-forward product cards replace the directory cards in the browse grid, with price sorting and an in-stock filter.
- Product pages — a two-column layout: a multi-image gallery beside a sticky buy box (price and compare-at, rating, variant picker, quantity stepper, Add to cart / Buy now).
- Cart — a slide-out drawer that persists in the browser, with quantity controls, remove, subtotal, and a You might also like block of related products.
- Commerce step — the submit & edit forms gain a step for price, currency, inventory, product type and variants.
- Checkout — native one-time Stripe Checkout; prices are validated server-side and stock is decremented atomically when payment completes.
- Orders — a new admin Orders screen lists every sale with status, total and line items.
The shared core (auth, admin, payments infra, categories, SEO, theming, map, analytics) is identical to the directory — only this thin layer differs.
The store format adds commerce columns to the items table plus orders / order_items tables. Run migration 0002_add_store_commerce.sql before going live.
Related configuration
- Directory Config — the default format's page size, sorting and seed categories.
- Features Config — how feature flags gate optional modules.
- Payments Config — Stripe setup that the store checkout builds on.