Open MercatoDocsSearch docsAPI reference

Architecture

Module dependency graph

Before enabling or removing a module, check what it requires and which modules rely on it. The dependency graph explains both relationships.

Open Mercato is composed of independent modules that you enable per app in apps/mercato/src/modules.ts. Most modules can be disabled freely – but a small subset of foundational modules are pulled in transitively because other modules declare them via ModuleInfo.requires. This page enumerates every module that ships in the monorepo, names its declared dependencies, and explains how the platform enforces the graph.

TL;DR

Version. This graph follows the development branch. On v0.10.0 the Akeneo integration requires sales where the newer manifest requires progress. Consult the module declaration in your installed version before changing enabled modules.

Where dependencies are declared

Each module's root index.ts may export a ModuleInfo metadata object. The requires array names the module ids (the same id you'd put in enabledModules) that must be co-enabled:

// packages/core/src/modules/sales/index.ts
import type { ModuleInfo } from '@open-mercato/shared/modules/registry'

export const metadata: ModuleInfo = {
  name: 'sales',
  title: 'Sales Management',
  version: '0.1.0',
  description: 'Quoting, ordering, fulfillment, and billing.',
  requires: ['catalog', 'customers', 'dictionaries'],
  ejectable: true,
}

The shape lives in packages/shared/src/modules/registry.ts (ModuleInfo). Only the requires field participates in the dependency graph; the other fields (title, description, author, license, ejectable, …) are descriptive metadata.

Enforcement

The generator reads requires statically: it parses the module's index.ts (or the compiled index.js of a packaged module) and never executes it, so module side effects do not run and packaged TypeScript sources are supported. Only the exported metadata object counts, and requires must be an array of string literals. A declaration built dynamically – a spread, a constant, a computed entry – cannot be read; the generator prints a [generate] ⚠ warning naming the file and skips the check for that module rather than guessing.

The check runs at code-generation time, not at HTTP request time, but the effect on the running app is the same: if a required module is missing the generator refuses to write modules.generated.ts.

Module dependency check failed:
- Module "sales" requires: catalog, customers, dictionaries
Fix: Enable module 'catalog' in src/modules.ts.
Fix: Enable module 'customers' in src/modules.ts.
Fix: Enable module 'dictionaries' in src/modules.ts.

(See extractModuleRequiresFromSource and findMissingModuleRequires in packages/cli/src/lib/generators/module-registry.ts.) Because the generator emits the registry that the Next.js dispatcher imports, a failed yarn generate means the app cannot boot until the dependency is satisfied.

In addition, seedDefaults and seedExamples hooks in each module's setup.ts are executed in topological order derived from requires so that a dependent module sees the data its dependency seeded.

Module catalog

The tables below list the modules that ship in the monorepo and the create-app templates, including every module that declares or is the target of a requires edge (the edge list under Reading the graph is the complete, enforced set). The Requires column reproduces the module's declared metadata.requires; an empty cell means the module has no declared hard dependencies. Foundational marks modules that another module declares as a dependency – disabling one of these is only safe if every dependent module is also disabled.

Core platform (@open-mercato/core)

Module idTitleRequiresFoundational?
api_docsAPI Documentation –
api_keysAPI Keysauth
attachmentsAttachments – (catalog, documents, forms)
audit_logsAudit & Action Logs –
authAuthentication & Accounts – (api_keys, devices, documents, push_notifications)
business_rulesBusiness Rules – (workflows)
cartCartcatalog, sales, customer_groups, promotions
catalogProduct Catalogattachments, currencies, dictionaries, entities(cart, ecommerce, eudr, sales, sync_akeneo, wms)
communication_channelsCommunication Channelsprogress(channel_resend, channel_ses, channel_smtp, push_notifications)
configsConfiguration –
currenciesCurrencies – (catalog)
customer_accountsCustomer Identity & Portal Authentication – (ecommerce, forms, portal)
customer_groupsCustomer Groups & B2B Terms – (cart, ecommerce)
customersCustomer Relationship Managementprogress, dictionaries, feature_toggles(sales, sync_excel, wms)
dashboardsAdmin Dashboards –
data_syncData Sync – (sync_akeneo, sync_excel)
devicesDevicesauth(push_notifications)
dictionariesShared Dictionaries – (catalog, customers, sales, staff)
directoryDirectory (Tenants & Organizations) – (documents)
ecommerceEcommerce Storescatalog, sales, customer_accounts, customer_groups
entitiesCustom Entities & Fieldsquery_index(catalog)
eudrEUDR Compliancecatalog
feature_togglesFeature Toggles – (customers, portal, wms)
formsFormsattachments, customer_accounts
inbox_opsInboxOps – Email-to-ERP Agent –
integrationsIntegrations – (channel_resend, channel_ses, channel_smtp, push_notifications, sync_akeneo, tillio)
messagesMessages –
notificationsNotifications – (push_notifications)
payment_gatewaysPayment Gateways –
perspectivesTable perspectives –
phone_callsPhone Calls – (tillio)
plannerWorktime / Availabilities – (resources, staff)
portalCustomer Portalcustomer_accounts, feature_toggles
progressProgress – (communication_channels, customers, sync_akeneo)
promotionsPromotions – (cart)
push_notificationsPush Notificationsauth, devices, notifications, communication_channels, integrations
query_indexQuery Indexes – (entities)
resourcesResource planningplanner(staff)
salesSales Managementcatalog, customers, dictionaries(cart, ecommerce, wms)
shipping_carriersShipping Carriers –
staffEmployeesplanner, resources, dictionaries
sync_excelExcel / CSV Importcustomers, data_sync
translationsEntity Translations –
wmsWarehouse Management Systemcatalog, customers, sales, feature_toggles
workflowsWorkflow Enginebusiness_rules

Other first-party packages

Module idPackageRequiresFoundational?
ai_assistant@open-mercato/ai-assistant –
channel_resend@open-mercato/channel-resendcommunication_channels, integrations
channel_ses@open-mercato/channel-sescommunication_channels, integrations
channel_smtp@open-mercato/channel-smtpcommunication_channels, integrations
checkout@open-mercato/checkout –
content@open-mercato/content –
documents@open-mercato/documentsauth, directory, attachments
events@open-mercato/events –
gateway_stripe@open-mercato/gateway-stripe –
onboarding@open-mercato/onboarding –
scheduler@open-mercato/scheduler –
search@open-mercato/search –
sync_akeneo@open-mercato/sync-akeneointegrations, data_sync, catalog, progress
tillio@open-mercato/tilliointegrations, phone_calls
webhooks@open-mercato/webhooks –

Enterprise (@open-mercato/enterprise)

Enterprise modules are off by default. Toggle them via OM_ENABLE_ENTERPRISE_MODULES, OM_ENABLE_ENTERPRISE_MODULES_SSO, OM_ENABLE_ENTERPRISE_MODULES_SECURITY, and OM_ENABLE_ENTERPRISE_MODULES_AGENTS.

Module idTitleRequires
agent_orchestratorAgent Orchestrator –
record_locksRecord Locking –
securitySecurity –
ssoSingle Sign-On –
system_status_overlaysSystem Status Overlays –

Templates and examples

These are scaffolded into new apps by create-app but are not enabled in the monorepo dev app.

Module idPackageRequires
example@open-mercato/create-app template –
example_customers_sync@open-mercato/create-app template –

Reading the graph

The current declared edges are:

api_keys               → auth
cart                   → catalog, sales, customer_groups, promotions
catalog                → attachments, currencies, dictionaries, entities
channel_resend         → communication_channels, integrations
channel_ses            → communication_channels, integrations
channel_smtp           → communication_channels, integrations
communication_channels → progress
customers              → progress, dictionaries, feature_toggles
devices                → auth
documents              → auth, directory, attachments
ecommerce              → catalog, sales, customer_accounts, customer_groups
entities               → query_index
eudr                   → catalog
forms                  → attachments, customer_accounts
portal                 → customer_accounts, feature_toggles
push_notifications     → auth, devices, notifications, communication_channels, integrations
resources              → planner
sales                  → catalog, customers, dictionaries
staff                  → planner, resources, dictionaries
sync_akeneo            → integrations, data_sync, catalog, progress
sync_excel             → customers, data_sync
tillio                 → integrations, phone_calls
wms                    → catalog, customers, sales, feature_toggles
workflows              → business_rules

Transitive closures worth noting:

A module that does not appear on the right-hand side of any arrow (no module has it as requires) is safe to remove from enabledModules without breaking another enabled module. That said, individual modules may still have soft runtime expectations (for example, a module's UI might link to another module's page) that the dependency graph does not capture – treat the graph as the floor, not the ceiling.

Adding a new dependency

When you build a module that depends on another:

  1. Edit your module's index.ts and add the dependency id to metadata.requires.
  2. Run yarn generate. If the dependency is not enabled in the consuming app, the generator will fail with the message above.
  3. If your module relies on a dependency's setup data (currencies, dictionaries, statuses, …), put that logic in setup.ts under seedDefaults/seedExamples; the platform already invokes those hooks in dependency order.
  4. Document the new dependency in your module's AGENTS.md or matching framework/modules/<module>.mdx page so other contributors can discover it.

Never reach across modules with direct ORM relationships – declare the dependency in requires and load data via the dependency's public services or the query engine. See AGENTS.md → Critical Rules → Architecture for the broader rule set.

See also

Previous: Glossary · Next: Track catalog price history and preview a reference price