Apps

Apps · NocoCRM · Development

Common customisations

This page lists the most common customisations and where each one is made. To change fields, options or tables, see Data model. Many adjustments can be made in the interface without touching code. When code does need to change, hand it to a coding agent: it follows the repository's AGENTS.md for the details and checks.

Rules before you change code

  • Text goes through translation: every string in the interface lives in client/locales/crm/. index.ts holds English and Chinese, and each of the other 10 languages has its own file; if one is missing, the type check fails. Text the AI writes (task names, stage names, plan titles, the built-in business guidance and so on) lives in server/locales/crm-ai/texts/, one file for each of the 12 languages, and a test checks that every language is complete. See Localization.
  • Endpoints own their security: a new /api endpoint does its own sign-in and permission checks, is declared in the API document, and uses the shared error structure. See HTTP routes and APIs and Authentication, permissions and data scopes.
  • Tests go in tests/: test each endpoint signed in, signed out, and without permission.

Add a page or report

Pages

  1. Create the page component in client/pages/ and export it as the default; see Pages, routes and navigation. When a page has child pages or helper files of its own, use a folder with an index.tsx.
  2. Declare the route in client/routes.ts: its name, path, auth: 'required', authz: page('<name>'), a lazily loaded componentLoader, and navigation for the menu group it goes in. Settings pages are declared in client/pages/settings/routes.ts.
  3. When the page needs data from the server, add an endpoint in server/routes/, register it in server/routes/crm.ts, and add its path to server/routes/crm-paths.ts so the sign-in check covers it. Put the business logic in a service in server/providers/crm/, and read data through CrmService as the current user, so record permissions apply.
  4. Let the sales roles see the page: a page without a grant opens only for administrators. Add the page to crmPages in server/providers/crm/resources.ts, and new installations grant it automatically. The permission sets of an existing system are not rewritten, so an administrator ticks it in System settings › Roles & permissions.

Reports

The existing reports are calculated in server/providers/crm/reports.ts, statistics.ts and dashboard.ts, returned through /api/dashboard, and drawn by client/components/crm/dashboard-reports.tsx. To add a report, add a calculation function there, include its result in the endpoint's response, add a chart card, and add its text.

Adjust approvals and permissions

What you can change in the interface

What to changeWhere
Who can approveSystem settings › Approval process: set approvers by role or by named members; the default is sales managers. Each approval keeps the rules in force when it was created
Each person's rolesSystem settings › Users
What each role can doSystem settings › Roles & permissions: viewing, creating, editing and deleting each kind of record, and the record scope; capabilities such as assigning, approving, exporting and sending WhatsApp; and page grants
When approval is neededSystem settings › AI › Skills: change the approval standards in the two skills opportunity-follow-up and approval-review, and keep them the same. Opportunity follow-up uses them to decide which terms need approval, and Approval review uses them for its recommendation

The approval standards are guidance for the Agents, not enforced rules: nothing in the code requires an approval before an opportunity moves on.

What needs code changes

  • Approval statuses and transitions: in server/lifecycles/approvals.ts. Version 1 of the process is frozen, because existing approvals refer to it. To change statuses, transitions or validation conditions, add a version 2 definition and have new approvals use it.
  • Approval topics: change the topic options in schema.ts, the text in client/locales/crm/, and each language's topic names (topicNames) in server/locales/crm-ai/texts/.
  • The default sales permission sets: defined in crmPermissionSet in resources.ts. The seed writes them once on first installation, and later starts never rewrite them. When you add an object or action, also add it to the options of the role settings page (client/pages/settings/permission-workspace.ts).
  • After changing permissions, run pnpm exec vitest run tests/logic/authorization-assignment-safety.test.ts. Do not grant business permissions to every signed-in user, and do not broaden the built-in member role.

For more, see Roles and permissions and Approvals.

Change the Agents' skills and instructions

NocoCRM has seven Agents: the Sales Expert in conversations, and six background Agents: Lead follow-up, Opportunity follow-up, Approval review, Task preparation, Company signals and Form capture. They all run on the Agents plugin.

What you can change in the interface

What to changeWhere
The content of the method skillsSystem settings › AI › Skills; changes take effect at once
A background Agent's model, skills and instructionsAI › Agents: open the Agent and change them in Settings
When a background Agent runs automaticallyEach Agent's switches in AI › Agents
Company introduction, product prices, follow-up paceAI › Agents › Business guidance; conversations and background runs all follow it, except Company signals
The AI working languageSystem settings › General
Model servicesSystem settings › AI › Model services

A built-in skill you have changed is no longer updated when NocoCRM is upgraded. A skill you have not changed is updated to the new content when the new version starts.

What needs code changes

  • The initial content of the built-in skills: in ai/skills/<name>/SKILL.md, six in all. To add a skill, create a folder, add its name to METHOD_SKILLS in server/providers/crm-agents/skill.ts, and write the code that reads it.
  • The Sales Expert's system prompt: assembled in code and not editable in the interface. The base instructions are in crm-agents/preset.ts, the conversation rules in rules.ts, and the methods for querying and proposing change plans in skill.ts.
  • How the background Agents work: the shared rules are in crm-agents/background.ts. Each Agent's prompt is in server/providers/crm/: lead-evaluation.ts, opportunity-evaluation.ts, approval-review.ts, task-preparation.ts, company-signals.ts and form-capture.ts. The parts specific to the new lead and new opportunity forms are in lead-capture.ts and opportunity-capture.ts.

Whatever you change, an Agent writes data only through a change plan, carried out after a person confirms it, and an Agent sees the same data as the current user.

For more, see Agents.

NocoBase docs assistant

Ask anything about NocoBase…

You can ask follow-up questions about recent answers.