Next.js + Payload CMS storefront and admin for a multi-tenant e‑commerce and inventory system. Uses block-based rendering, HeroUI, and Payload collections/globals.
- Node.js/Bun installed (this repo uses Bun scripts)
- MongoDB or your configured DB available for Payload
- .env at repo root with Payload/Next settings (PAYLOAD_SECRET, NEXT_PUBLIC_SERVER_URL, etc.)
- Install dependencies at the repo root
- Generate Payload types and importmap for this app
- run inside apps/multi-store: bun run gen
- Start dev server
- run inside apps/multi-store: bun run dev
- dev: Next dev (Turbopack)
- dev:webpack: Next dev (webpack)
- build: Next build (Turbopack)
- start: Next start
- gen: Generates Payload importmap and types
- lint: Biome lint for src (auto-fix)
Common vars (root .env):
- Shop home powered by a Shop global with blocks (hero, search, product grid)
- Product detail pages built from blocks (gallery, details, rich text, related products)
- Shared slugField() helper for consistent slugs
- RenderBlocks passes tenantSlug/searchParams/product context to blocks
- Docs portal at /docs (renders project .md files with Mermaid diagrams)
- Tasks module (Projects & Tasks) with admin colored cells; Tasks page global + route /[slug]/tasks
See ../../todo.md for the full plan.
- Phase 0: Schema foundations (UOM, Brands, Categories, TaxRates, Warehouses/Bins, Items, Products)
- Phase 1: Purchasing (Vendors, POs, PO Lines, GRN, GRN Lines + hooks)
- Phase 2: Inventory (Serials, Batches, DigitalLicenses, StockLedger, Reservations)
- Phase 3: Stock Ops (Transfers, Adjustments, RTV)
- Phase 4: Sales (Orders, Reservations, Shipments)
- Phase 5: Admin UX (stock tabs, movement history)
- Phase 6: Docs & tests
- src/app/(frontend)/[slug]/(shop)/shop
- src/blocks (ShopBlocks, ProductBlocks, RenderBlocks)
- src/collections (Products, Inventory, etc.)
- src/globals (Shop)
- src/lib (collections registry, admin config, plugins)
- Keep interactive UI in client components to avoid RSC boundary issues
- Payload queries use status filters (avoid deprecated fields)
- Prefer HeroUI components
- After editing collections/globals, run bun run gen to refresh types
- Project documentation is located in the
../../docs directory.
- See the Documentation Index for a complete list of documents.
Docs portal UI:
Changelog: see ../../CHANGELOG.md
- bun run gen
- bun run dev
- Open http://localhost:3000 and Payload admin at /admin
- Configure Shop global and add some Products/Items