Prerequisites
Before you begin, ensure you have the following installed:- MediaWiki 1.43+: Citizen requires MediaWiki 1.43 or higher
- Node.js: For JavaScript/Vue development and build tools
- Composer: For PHP dependency management
- Docker (recommended): For the standard development environment
Standard Development Environment
The recommended development setup uses MediaWiki’s Docker environment. This provides a consistent, isolated environment that closely matches production.Set up MediaWiki Docker environment
The standard dev environment is defined in the parent
mediawiki/ directory. Refer to ../../DEVELOPERS.md in your MediaWiki installation for detailed setup instructions.Typically, you’ll place the Citizen skin in mediawiki/skins/Citizen/.Install dependencies
Install Node.js and Composer dependencies:For Composer dependencies (if running outside Docker):
Set up Git hooks
Citizen uses Lefthook for Git hooks, which includes commit message validation and pre-commit checks:This installs hooks that:
- Validate commit messages follow Conventional Commits
- Auto-add emojis to commits based on type
- Run basic pre-commit checks
Alternative Setup (Without Docker)
If you’re using a different development environment:- Ensure you have a working MediaWiki 1.43+ installation
- Clone the Citizen repository into
mediawiki/skins/Citizen - Install dependencies with
npm installandcomposer install - Enable the skin in
LocalSettings.php
When working outside the standard Docker environment, you may need to adjust commands and paths. The documentation assumes the Docker setup unless noted otherwise.
Running Commands in Docker
When using the Docker development environment, run composer commands inside the container:Verification & Testing
Before making changes, verify your setup by running the test suite:Node.js Tests
PHP Tests
Development Workflow
-
Create a feature branch:
- Make your changes following the coding conventions
- Run relevant checks based on files changed (see Testing)
-
Commit with Conventional Commits:
The pre-commit hook will automatically add emojis and run basic checks.
- Push and create a pull request
Next Steps
- Learn about the Architecture
- Explore the Component System
- Review Testing Guidelines
- Read the Contributing Guide