Core Platform

The shared records and services every erxes plugin builds on: organizations and permissions, contacts, products, custom fields and segments, forms and documents, automations, broadcasts, email delivery, and bulk import/export.

Core API (backend/core-api, port 3300) is the always-on service behind the core subgraph. It registers with the gateway the same way a plugin API does, through its own bootstrap in src/main.ts, but holds the platform's shared data model: the collections plugins link to rather than duplicate. Everything in this section is a core-api module or a shared pipeline it runs; plugin APIs reach them through shared service interfaces, never by reading core's collections directly.

How plugins use core

  • tRPC. init-trpc.ts merges each module's router into the core appRouter, served at /trpc. A plugin builds a typed client through getPlugin('core'); the generator writes one into src/trpc/trpcClients.ts. It calls procedures such as users.findOne or customers.count.
  • meta hooks. The meta object a plugin passes to startPlugin (permissions, automations, segments, notifications, importExport, afterProcess, references) is serialized into the Redis key erxesservice:config:<name> and read back by core-api, the gateway, and the background services. That is how a plugin adds permission actions, automation triggers and actions, segment types, notification types, and import/export handlers without touching core code. See Plugin Metadata & Extensions for the full meta registration.
  • Shared interfaces. erxes-api-shared/core-modules holds the domain interfaces and producer helpers (automations, segments, permissions, properties, forms, import-export, and more) that both core and plugins compile against.

Module map

Each guide covers one area's data model, GraphQL API, permissions, and extension hooks.

Areacore-api locationGuide
Team members, structure, brands, RBACmodules/organization, modules/permissions, modules/authOrganizations, Users & Permissions
Customers and companiesmodules/contactsContacts
Catalog, categories, units of measuremodules/productsProducts
Custom fields, tags, dynamic audiencesmodules/properties, modules/tags, modules/segmentsProperties, Tags & Segments
Document templates with placeholdersmodules/documents (modules/forms is a legacy shell; the working forms module is in frontline_api. See Forms & Surveys)Documents
Workflow engine and approval locksmodules/automations, modules/approval, plus the services/automations worker (see Background Services)Automations & Approvals
Campaigns and in-app/email notificationsmodules/broadcast, modules/notificationsBroadcasts & Notifications
Outbound transports and inbound mailsrc/utils/email and erxes-api-shared/src/utils/email; inbound via cloudflare/mail-worker into frontline_apiEmail Delivery
Bulk CSV load and extractionmodules/import-exportImport & Export

Core API also contains modules without a dedicated page: clientportal (portal records and portal-user auth, see Client Portal), apps (machine tokens), conformities and relations (record linking), internalNote, search, template, and logs.

Guides

Was this helpful?