Repository Structure
Understand the top-level layout of erxes/erxes so you can find backend services, frontend projects, plugins, and standalone apps. This guide follows version 3.1.7 (03acdf712c).
For running the product from source, use Local Setup. For the service runtime, see Backend & API Gateway.
Top-level directories
erxes/
├── backend/
│ ├── core-api/ Core business logic (port 3300)
│ ├── gateway/ API gateway + Apollo Router (port 4000)
│ ├── erxes-api-shared/ Shared library for all services
│ ├── plugins/ Plugin microservices (*_api)
│ └── services/ Background services (automations, logs)
├── frontend/
│ ├── core-ui/ Module Federation host (port 3001)
│ ├── libs/ erxes-ui + ui-modules shared UI
│ └── plugins/ Frontend remotes (*_ui)
├── apps/ Standalone apps (not started by dev:apis/dev:uis)
│ ├── client-portal-template/
│ ├── help-center/
│ ├── frontline-widgets/
│ └── posclient-front/
├── scripts/ create-plugin, start-api-dev, start-ui-dev
├── .github/workflows/ CI image builds per service/app
├── nx.json Nx task orchestration
├── pnpm-workspace.yaml Includes backend/** and frontend/**
└── AGENTS.md Contributor and agent rules
Backend
backend/core-api/src/main.tsstarts Core API onPORT || 3300and joins the gateway viajoinErxesGateway.backend/gateway/src/main.tslistens on4000, proxies/graphqlto the internal Apollo Router on50000.backend/erxes-api-shared/src/holdsutils/(service discovery, Redis, tRPC, agent-tools),core-modules/(reusable domain logic), andcore-types/.backend/plugins/*_api/src/main.tsstarts each plugin withstartPlugin({ name, port }). For example Sales uses port3305.backend/services/automationsandbackend/services/logsrun queue workers; they are not plugin APIs.
Frontend
frontend/core-ui/src/bootstrap.tsxis the browser entry. In development it renders directly; in production it fetches/get-frontend-pluginsand loads remotes.frontend/core-ui/module-federation.config.tsmapsENABLED_PLUGINSto<name>_uiremotes. The host runs on port3001.frontend/libs/erxes-ui/srcprovides generic UI primitives;frontend/libs/ui-modules/srcprovides business-domain UI. Import them aserxes-uiandui-modules.frontend/plugins/*_ui/src/holdsconfig.tsx,modules/,pages/, andwidgets/per plugin.
Apps and scripts
Standalone apps under apps/ have their own dependencies and ports (3800, 3900, 7002, widgets build). They are deployed separately; see Client Portal, Help Center, POS Client, and Messenger Installation.
scripts/start-api-dev.js maps ENABLED_PLUGINS to *_api projects plus gateway; scripts/start-ui-dev.js maps them to *_ui remotes for Core UI.