The complete open source platform to run your entire marketplace. Storefront, vendor panel, admin console, and integrations in one enterprise-grade platform you own.
TypeScript b2b-marketplacecomposable-commerceecommerceenterpriseheadless-commercemarketplacemedusamedusajsmulti-vendortypescript
Registry Source Files
This directory contains the source files for your registry blocks. Each block should be organized in its own directory.
Learn more about building blocks in the Mercur documentation.
Block Structure
Each block directory should follow this structure:
src/
└── my-block/
├── modules/ # Custom modules with data models and services
├── links/ # Module link definitions
├── workflows/ # Business workflow definitions
└── api/ # Custom API route handlers
Creating a New Block
- Create a new directory under
src/with your block name - Add the necessary subdirectories for your block's functionality
- Register your block in
registry.json
Block Components
Modules
Modules contain your data models and business logic. Each module should have:
models/- Data model definitionsservice.ts- Service class with business methodsindex.ts- Module export and registration
Links
Links define relationships between modules from different packages.
Workflows
Workflows define multi-step business processes with compensation logic.
API Routes
API routes expose HTTP endpoints for your block's functionality.