Template Developers: Installation
Run the selected template against local fixtures or an erxes instance. Complete Local Setup only if you also need the product backend on your machine.
Template paths and editor controls depend on the separate template repository. Confirm them in your checkout; see what the product defines.
Identify the repositories and toolchain
Get the repository URL, branch or commit, supported Node.js version, and package manager from the template maintainer. Inspect its README, package.json, lockfile, and workspace configuration before installing dependencies.
The existing template workflow references pages-web/web-builder and boilerplates such as erxes-web-templates/ecommerce-boilerplate and erxes-web-templates/tour-boilerplate. Ask the maintainer for repository access and supported branches. Do not assume a saas-dependent branch exists in every template.
Two toolchain facts come from the product's deployer, not from the template: a deployed site builds with yarn install and next build, and the deployer patches next to 15.3.8 and deletes package-lock.json before upload. Develop against a Node and package setup that survives those constraints. See deploy.
Clone the selected template
For example, if you have access to the ecommerce boilerplate:
git clone [email protected]:erxes-web-templates/ecommerce-boilerplate.git
cd ecommerce-boilerplate
For a builder-managed workspace, follow its instructions for placing templates under apps/templates/. Install at the workspace root if its workspace configuration handles dependency installation; a standalone template may install from its own root.
Use the package manager and version declared by the chosen repository. The product monorepo requires pnpm, while deployed templates build with Yarn. Do not generate competing lockfiles by switching between npm, Yarn, and pnpm inside one project.
Configure data access
Copy the selected repository's example environment file if one is provided. Use its documented variable names and fill in values for your own development instance.
The deployer writes a fixed set of variables into next.config.ts at deploy time: ERXES_API_URL, NEXT_PUBLIC_ERXES_API_URL, ERXES_URL, ERXES_FILE_URL, ERXES_CP_ID, ERXES_APP_TOKEN, NEXT_PUBLIC_ERXES_APP_TOKEN, ERXES_WEB_ID, TEMPLATE_TYPE, and BUILD_MODE/NEXT_PUBLIC_BUILD_MODE set to production, plus any environmentVariables stored on the Web record. Mirror the names your template reads rather than copying this list verbatim. See the env block in deploy.
For server-side CMS examples, follow CMS Setup. Keep administrative app tokens in server-only environment variables. Do not place them in next.config's env object for local development, NEXT_PUBLIC_* variables, static JSON, or client components.
A public site should fetch only its intended published content. Use a fixed website endpoint and supported portal context through your server integration. Browser components can request the site's own narrowly scoped routes, as shown in Client-side Rendering.
Use fixture data when available to work on presentation without live services. Check how the selected template switches between fixture, builder, and live modes. BUILD_MODE is written by the deployer, but how the template branches on it is the template's own convention.
UI-only scope
Installation work stops at running the template and supplying its configuration. Do not edit query documents, portal token handling, or adapter logic to make a connection succeed. Fix the environment values instead. Changes to data access are out of scope for template work.
Start the template
Inspect the available scripts:
node -p 'JSON.stringify(require("./package.json").scripts, null, 2)'
Run the documented development script with the selected package manager.
Check it works
- Open the URL the dev server reports. Check the shared layout, a content page, a data-backed list, and hot reload.
- If the template talks to a live erxes instance, query the site scope directly. The
cpPagesquery resolves the portal from yourx-app-tokenand lists that site's pages:
query CpPages($language: String) {
cpPages(language: $language) {
_id
name
slug
status
}
}
- On failure, check the server logs and the browser Network panel. Fix endpoint, token, portal, or gateway configuration at its source. Do not install a CORS-disabling browser extension; use the server integration and the deployment's configured origins.
Run the available checks
Run the template's declared lint, type-check, test, and production-build scripts where present. Preview with empty content and a failed request as well as the normal data set. Record which checks ran and whether a live erxes instance was used.