Prerequisites
Ensure the following tools are installed on your machine:
| Tool | Minimum Version | Purpose |
|---|---|---|
| Node.js | 20.18 or later (.nvmrc pins 22) |
JavaScript build tools |
| npm | 10 or later | Package management |
| PHP | 8.1 or later | Theme runtime and testing |
| Composer | 2 or later | PHP dependency management |
| Git | Any recent version | Version control |
| Docker | Latest | WordPress local environment (wp-env) |
Checking Installed Versions
Copied!Shellnode --version # Should output v20.x or laternpm --version # Should output 9.x or laterphp --version # Should output 8.1.x or latercomposer --version # Should output 2.xgit --version # Any recent versiondocker --version # Latest stable
Get the Source
Place the Aegis source in wp-content/themes/aegis, then open that folder:
Copied!Shellcd wp-content/themes/aegis
Install Dependencies
PHP Dependencies
Copied!Shellcomposer install
This installs all PHP packages into the vendor/ directory, including:
- PSR-4 autoloader configuration.
- Development tools (PHPUnit, PHPCS).
- Any required libraries.
Node.js Dependencies
Copied!Shellnpm install
This installs all JavaScript packages into the node_modules/ directory, including:
-
@wordpress/scripts— Build toolchain. - ESLint and stylelint — Code quality tools.
- Testing utilities.
Node Version Management
The repository includes an .nvmrc file. If you use nvm:
Copied!Shellnvm use
This switches to the correct Node.js version automatically.
Local WordPress Environment
Aegis uses wp-env (powered by Docker) for local development. This provides a complete WordPress installation with zero manual configuration.
Starting the Environment
Copied!Shellnpm run env:start
Or directly:
Copied!Shellnpm run env:start
This starts:
- WordPress on http://localhost:8888
- WordPress admin at http://localhost:8888/wp-admin/
- MySQL database on port 3306 (internal to Docker)
Default Credentials
| Field | Value |
|---|---|
| Admin URL | http://localhost:8888/wp-admin/ |
| Username | admin |
| Password | password |
Stopping the Environment
Copied!Shellnpm run env:stop
Or:
Copied!Shellnpx wp-env stop
Resetting the Environment
To start fresh with a clean WordPress installation:
Copied!Shellnpx wp-env clean all
Environment Configuration
The .wp-env.json file configures the local environment:
Copied!JSON{ "core": null, "phpVersion": "8.1", "plugins": [], "themes": ["."], "port": 8888, "config": { "WP_DEBUG": true, "WP_DEBUG_LOG": true, "SCRIPT_DEBUG": true }}
Building Assets
After installing dependencies, build the theme assets:
Copied!Shellnpm run build
For development with file watching:
Copied!Shellnpm run dev
See Building Assets for detailed build documentation.
Directory Structure
After setup, your workspace should look like:
Copied!Directory treeaegis/├── .wp-env.json # wp-env configuration├── composer.json # PHP dependencies├── package.json # Node.js dependencies├── node_modules/ # Installed Node packages├── vendor/ # Installed PHP packages├── assets/ # Source files│ ├── css/ # Source stylesheets│ └── js/ # Source JavaScript├── src/ # Theme glue + block sources (compiled in place)├── parts/ # Template parts├── patterns/ # Block patterns├── styles/ # Style variations├── templates/ # Page templates└── theme.json # Theme configuration
Development Workflow
A typical development session:
-
Start the environment:
npm run env:start -
Start the theme watcher:
npm run dev(inwp-content/themes/aegis) -
Plugin changes: run
npm run devornpm run buildinwp-content/plugins/aegis-dashwhen editing map/modal/admin assets - Open the site: http://localhost:8888
- Make changes to source files.
- View changes in the browser (auto-refreshed by the watcher).
-
Run tests before committing:
npm run test - Commit changes using conventional commit messages.
IDE Configuration
VS Code
Recommended extensions:
- PHP Intelephense — PHP language support.
- ESLint — JavaScript linting.
- Stylelint — CSS linting.
- WordPress Snippets — WordPress function completion.
- EditorConfig — Consistent formatting.
PhpStorm
- Configure the PHP interpreter to use 8.1+.
- Set the WordPress source as an include path for autocompletion.
- Configure PHPCS with the WordPress coding standards.
Aegis plugins (Optional)
To develop with the full Aegis ecosystem:
Place Aegis Dash source in wp-content/plugins/aegis-dash and, if you have access, the Pro source in wp-content/plugins/aegis-pro.
Then add them to .wp-env.json:
Copied!JSON{ "plugins": [ "../../../plugins/aegis", "../../../plugins/aegis-pro" ]}
Troubleshooting
Docker Not Running
Ensure Docker Desktop is running before starting wp-env.
Port 8888 Already in Use
Stop any other service using port 8888, or change the port in .wp-env.json.
Permission Issues
On Linux/macOS, you may need to run Docker commands with appropriate permissions.
Node.js Version Mismatch
Use nvm use to switch to the correct version specified in .nvmrc.
Next Steps
- Building Assets — Learn about the build process.
- Code Quality — Set up linting and formatting.
- Testing — Run the test suite.
- Contributing — Contribution guidelines.