erxes Docs

Getting started with plugin

Learn how to create an erxes plugin from scratch

Create a new plugin

Start plugin

Configure environment variable

# Database connection
MONGO_URL=mongodb://localhost:27017/erxes?directConnection=true

# Node.js configuration
NODE_OPTIONS=--max-old-space-size=1536
NODE_ENV=development

# Plugin configuration (optional) (if you want to enable a plugin)
ENABLED_PLUGINS=yourpluginname,otherpluginname
nano .env
ENABLED_PLUGINS=yourpluginname,otherpluginname

Start the plugin

Important

If erxes is running, you need to stop it.

If you have configured the plugin correctly in your .env file, you need to start erxes

local setup guide.

Use the plugin

Important

create-plugin command will create plugins same ports, if you want more plugin you can configure the ports in plugins api main.ts

Frontend

Your plugin will be located at /frontend/plugins/yourpluginname_ui

main.ts
bootstrap.tsx
index.html
config.ts
eslint.config.js
jest.config.ts
module-federation.config.json
project.json
rspack.config.prod.json
rspack.config.json
tsconfig.json
tsconfig.app.json
tsconfig.spec.json

Backend

main.ts
connectionResolvers.ts
.gitignore
package.json
tsconfig.json
tsconfig.build.json
project.json

Your plugin will be located at /backend/plugins/yourpluginname_api