Page:
templates-dolibarr
Pages
ARCHITECTURE
AUTO-BUMP
AUTO_CREATE_ORG_PROJECTS
Branching-Strategy
CLI_AUTOMATION
Coding-Standards
DEPLOY_SCRIPTS
DOLIBARR_MODULE_IDS
DRY_RUN_PATTERN
Documentation-Standards
File-Header-Standards
Home
JOOMLA_SYNC
LEGAL_DOC_GENERATOR_WEB_README
MANIFEST-STANDARD
MINIFICATION
MONITORING_SCRIPTS
NEW_SCRIPTS
QUICKSTART_ORG_PROJECTS
UPDATE-SERVER
WIKI_STANDARDS
WORKFLOW_STANDARDS
api-automation-index
api-definitions-default-index
api-definitions-sync-index
api-deploy-index
api-fix-index
api-index
api-maintenance-index.-
api-maintenance-index
api-plugin-index.-
api-plugin-index
api-tests-index.-
api-tests-sample-index.-
api-tests-sample-index
api-validate-index.-
automation-README.-
automation-branch-version-automation.-
automation-push-files.-
automation-repo-cleanup.-
client-repos.-.-
client-repos
standards-mokostandards-file-spec.-
standards-mokostandards-file-spec
templates-client-waas
templates-dolibarr
templates-generic
templates-mcp
unnamed
workflows-README.-
workflows-README
workflows-auto-release.-
workflows-auto-release
workflows-branch-protection.-
workflows-branch-protection
workflows-build-release.-
workflows-build-release
workflows-cascade-dev.-
workflows-cascade-dev
workflows-changelog-management.-
workflows-changelog-management
workflows-demo-deployment.-
workflows-demo-deployment
workflows-dev-branch-tracking.-
workflows-dev-branch-tracking
workflows-dev-deployment.-
workflows-dev-deployment
workflows-index.-
workflows-index
workflows-release-system.-
workflows-release-system
workflows-renovate.-
workflows-renovate
workflows-reusable-workflows.-
workflows-reusable-workflows
workflows-rs-deployment.-
workflows-rs-deployment
workflows-secret-scanning.-
workflows-secret-scanning
workflows-shared-workflows.-
workflows-shared-workflows
workflows-standards-compliance.-
workflows-standards-compliance
workflows-static-analysis.-
workflows-static-analysis
workflows-sub-issue-management.-
workflows-sub-issue-management
workflows-update-server.-
workflows-update-server
workflows-workflow-architecture.-
workflows-workflow-architecture
Clone
1
templates-dolibarr
Jonathan Miller edited this page 2026-05-20 01:26:22 +00:00
Template-Dolibarr Reference
Repository template for building Dolibarr ERP/CRM modules following MokoStandards. Scaffolds new module projects with a consistent directory layout, CI/CD workflows, build tooling, and governance files.
| Type | Dolibarr Module Template |
| Language | PHP |
| License | GPL-3.0-or-later |
| Repo | Template-Dolibarr |
| Wiki | Template-Dolibarr wiki |
Purpose
Template-Dolibarr is the starting point for all new Dolibarr modules in the Moko Consulting ecosystem. It provides a fully scaffolded module with sample descriptor, admin pages, library helpers, language files, icons, PHPStan config, Transifex support, and Dolibarr update-server integration.
What the Template Provides
| Component | Description |
|---|---|
| Module source scaffold | src/ with sample descriptor, admin, lib, langs, icons |
| Makefile | Build, lint, test, package, install, release targets |
| CI/CD workflows | 11 Gitea Actions workflows for the full module lifecycle |
| PHPStan config | Static analysis preconfigured for Dolibarr development |
| Governance files | LICENSE, CODE_OF_CONDUCT, CONTRIBUTING, GOVERNANCE, SECURITY |
| Update server | update.txt for Dolibarr's built-in update checker |
| Documentation stubs | Installation, development, changelog, module-id-policy guides |
Quick Start
- Click Use this template on the Template-Dolibarr repo
- Rename sample files to match your module name:
| Sample file | Rename to |
|---|---|
src/core/modules/modSample.class.php |
src/core/modules/modYourModule.class.php |
src/lib/sample.lib.php |
src/lib/yourmodule.lib.php |
src/langs/en_US/sample.lang |
src/langs/en_US/yourmodule.lang |
src/sampleindex.php |
src/yourmoduleindex.php |
- Update Makefile config:
MODULE_NAME := yourmodule
MODULE_VERSION := 1.0.0
MODULE_NUMBER := 500001 # Must be 500000+ for custom modules
- Edit the module descriptor class with your metadata
- Run
make validateandmake build
Makefile Targets
| Target | Description |
|---|---|
make help |
Show all available targets |
make install-deps |
Install Composer dev dependencies |
make lint |
PHP syntax check |
make phpcs |
PHP CodeSniffer (PSR-12) |
make phpstan |
PHPStan static analysis |
make validate |
Lint + phpcs checks |
make test |
Run PHPUnit tests |
make build |
Clean, validate, build ZIP |
make install-local |
Install to local Dolibarr |
make dev-install |
Symlink for live development |
make release |
Full release pipeline |
Workflows
| Workflow | Trigger | Purpose |
|---|---|---|
ci-dolibarr.yml |
Push | Lint, PHPStan, structure validation |
pr-check.yml |
Pull request | PR validation checks |
auto-release.yml |
Merge to main | Release with ZIP, changelog, tag |
pre-release.yml |
Push to dev | Pre-release builds |
publish-to-mokodolimods.yml |
Release created | Publish to MokoDoliMods registry |
update-server.yml |
Release created | Update update.txt for Dolibarr |
deploy-manual.yml |
Manual | Deploy to target server |
security-audit.yml |
Schedule/manual | Dependency vulnerability audit |
repo-health.yml |
Schedule | Standards compliance check |
cleanup.yml |
Schedule | Clean old artifacts/branches |
notify.yml |
Release/failure | Event notifications |
Directory Structure
Template-Dolibarr/
|-- .gitea/workflows/ # 11 CI/CD workflows
|-- src/ # Dolibarr module source (deploy this)
| |-- admin/ # Setup and about pages
| |-- core/modules/ # Module descriptor class
| |-- img/ # Icons and logos
| |-- langs/en_US/ # Language strings
| +-- lib/ # Module library helpers
|-- Makefile # Build system
|-- phpstan.neon # Static analysis config
|-- composer.json # PHP dependencies
+-- update.txt # Version for Dolibarr updater
Key Wiki Pages
| Page | Description |
|---|---|
| Installation | Installing and configuring a Dolibarr module |
| Development | Development best practices |
| Module ID Policy | Module ID assignment rules |
| Update Server | How update.txt is managed |
Related
- Template-Client-WaaS -- WaaS client site template
- Template-Generic -- generic project template
- Template-MCP -- MCP server template
- Documentation Standards -- wiki-first policy and naming
Repo: moko-platform · moko-platform wiki
| Field | Value |
|---|---|
| Minimum Version | 04.07.00 |
| Platform | dolibarr |
| Applies To | Dolibarr module repositories |
| Revision | Date | Author | Description |
|---|---|---|---|
| 1.0 | 2026-05-19 | Moko Consulting | Initial version |