Content

The Content plugin is the erxes CMS and website layer. It stores posts, pages, menus, categories, tags, and custom fields per site, serves them over GraphQL, and can build and deploy a rendered website through the Web Builder.

Projects

The plugin has two projects in the erxes/erxes monorepo:

ProjectPathRuns on
content_apibackend/plugins/content_apiPlugin GraphQL service, port 3303
content_uifrontend/plugins/content_uiModule Federation remote, dev server port 3003

content_api has two modules. src/modules/cms handles websites-as-CMS-sites, posts, pages, menus, categories, tags, custom post types, custom fields, and translations. src/modules/webbuilder handles Web Builder site and page records plus the Vercel deployment pipeline in utils/utils.ts.

content_ui mounts its routes under /content and registers two entries in src/config.tsx: cms at /content/cms and web-builder at /content/web-builder. Feature internals live in src/modules/cms and src/modules/web-builder.

Key concepts

  • A Client Portal is a website's identity. CMS and Web Builder records carry a clientPortalId that ties them to one site. The portal itself is a core-api clientportal record, and the standalone Client Portal Next.js template (apps/client-portal-template) uses cp* operations with a portal token.
  • Two operation families. cp* operations such as cpPostList, cpCmsPageDetail, and cpMenus serve website integrations; the gateway identifies the portal from the x-app-token JWT and the resolvers are flagged forClientPortal. cms* operations such as cmsPageList and cmsMenus serve the admin UI, go through the permission wrapper, and require an explicit clientPortalId. cp* is not read-only; it also includes writes like cpCmsPagesAdd.
  • Pages carry sections. Page.pageItems is an ordered list of items with name, type, content, order, objectType/objectId, and a free-form JSON config. A front-end template maps those items to components.
  • Menus have a kind. The Web Builder deployer collects kind: "main" and kind: "footer" menu items to build site navigation.
  • Templates live outside this repo. cpDeployWeb clones github.com/erxes-web-templates/<templateId>, writes data/configs.json and data/pages/<slug>.json into it, and deploys to Vercel. The product repo defines the data shape; the template repositories define the rendering.

Enable the plugin

The plugin name is content. Enable it in .env, then start the dev services:

ENABLED_PLUGINS=content
pnpm dev:apis   # includes content_api on :3303
pnpm dev:uis    # serves core-ui with the content_ui remote on :3003

To run one project, use pnpm nx serve content_api or pnpm nx serve content_ui. The API gateway on port 4000 composes the plugin's GraphQL subgraph.

Guides

Pick the track that matches your role. The last card is the standalone Client Portal Next.js app, not part of the CMS or Web Builder tracks.

Was this helpful?