MokoStandards-Template-Joomla-Module
A repository template for Joomla Module development projects following MokoStandards.
Table of Contents
- Overview
- Features
- Prerequisites
- Installation
- Usage
- Project Structure
- Development
- Testing
- Building
- Contributing
- Versioning
- License
- Support
Overview
This is a standardized template repository for creating Joomla modules that conform to Moko Consulting's development standards and best practices. It provides a consistent starting point with pre-configured tooling, documentation structure, and development workflows.
Use this template when creating new Joomla modules to ensure:
- Consistent code structure and organization
- Pre-configured development tools (linters, formatters)
- Standardized documentation and contribution guidelines
- Built-in build and deployment workflows
Features
- Standardized Structure: Pre-organized directories for source code, documentation, and scripts
- Build Automation: Makefile with common tasks (lint, build, package, install)
- Code Quality: Pre-configured PHP linting and CodeSniffer for Joomla standards
- Development Tools: EditorConfig for consistent coding styles across IDEs
- Documentation: Template structure following MokoStandards documentation practices
- Git Configuration: Pre-configured git attributes, ignore patterns, and commit message templates
Prerequisites
Before using this template, ensure you have the following installed:
- PHP: 7.4 or higher (8.0+ recommended for Joomla 4.x/5.x)
- Composer: For PHP dependency management (optional but recommended)
- Joomla: A working Joomla installation for testing (3.x, 4.x, or 5.x)
- PHP CodeSniffer: For code quality checks (
composer global require squizlabs/php_codesniffer) - Make: GNU Make for running build commands
- Git: For version control
Installation
Using This Template
-
Create a new repository from this template:
- Click "Use this template" button on GitHub
- Or clone and remove git history:
git clone https://github.com/mokoconsulting-tech/MokoStandards-Template-Joomla-Module.git my-joomla-module cd my-joomla-module rm -rf .git git init
-
Customize for your module:
- Update
Makefilewith your module name, type, and version - Update this README with your module's specific information
- Update LICENSE file with appropriate copyright holder
- Create your module files in the
src/directory
- Update
-
Initialize git:
git add . git commit -m "feat: initial commit from template"
Usage
Quick Start
-
Configure your module in the
Makefile:MODULE_NAME := yourmodulename MODULE_TYPE := site # or 'admin' for backend modules MODULE_VERSION := 1.0.0 -
Run the help command to see available tasks:
make help -
Develop your module in the
src/directory -
Validate your code:
make validate -
Build the module package:
make build
Common Tasks
See the Development Guide for detailed development workflows.
Project Structure
.
├── docs/ # Documentation files
├── scripts/ # Build and deployment scripts
├── src/ # Module source code
├── .editorconfig # Editor configuration
├── .gitignore # Git ignore patterns
├── .gitmessage # Git commit message template
├── Makefile # Build automation
└── README.md # This file
Development
Setting Up Development Environment
-
Install dependencies:
# Install PHP CodeSniffer globally composer global require squizlabs/php_codesniffer composer global require dealerdirect/phpcodesniffer-composer-installer -
Configure your IDE to use the
.editorconfigsettings -
Set up pre-commit hooks (optional):
git config commit.template .gitmessage
Development Workflow
See docs/DEVELOPMENT.md for detailed development guidelines.
Code Style
This project follows:
- Joomla Coding Standards for PHP
- Tab indentation (width: 2 spaces)
- LF line endings
- UTF-8 encoding
Testing
Manual Testing
-
Create development symlink:
# Update JOOMLA_ROOT in Makefile first make dev-install -
Test in Joomla:
- Enable the module in Joomla admin
- Assign to a module position
- Test on frontend/backend
Automated Testing
make lint # PHP syntax check
make phpcs # Code standards check
make validate # Run all checks
Building
Build Module Package
make build
This creates a ZIP package in the dist/ directory ready for installation in Joomla.
Installing to Joomla
Option 1: Upload via Joomla Admin
make install-local
Then upload the generated ZIP file via Extensions > Manage > Install
Option 2: Development Symlink
make dev-install
Creates a symlink for development (requires configured JOOMLA_ROOT)
Contributing
We welcome contributions! Please see CONTRIBUTING.md for guidelines.
Quick Contribution Guide
- Fork the repository
- Create a feature branch (
git checkout -b feat/amazing-feature) - Commit your changes using conventional commits
- Push to your branch
- Open a Pull Request
Versioning
This project uses Semantic Versioning:
- MAJOR: Incompatible API changes
- MINOR: New functionality (backward compatible)
- PATCH: Bug fixes (backward compatible)
See CHANGELOG.md for version history.
License
Copyright (C) 2026 Moko Consulting hello@mokoconsulting.tech
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see https://www.gnu.org/licenses/.
SPDX-License-Identifier: GPL-3.0-or-later
License Management
This repository includes a GitHub Actions workflow for syncing all GPL licenses (GPL-2.0, GPL-3.0, LGPL-2.1, LGPL-3.0) from www.gnu.org. The workflow must be triggered manually - automatic scheduling is disabled. The primary GPL-3.0 license is maintained in the LICENSE file, with additional licenses stored in the licenses/ directory. For enterprise environments with firewall restrictions, see Firewall Configuration Guide for required network access configuration.
Support
- Documentation: See the docs/ directory
- Issues: Report bugs and request features via GitHub Issues
- Contact: hello@mokoconsulting.tech
- Website: mokoconsulting.tech
Acknowledgments
This template is maintained by Moko Consulting and follows MokoStandards for consistent, high-quality Joomla module development.