Development Setup

This page explains how to set up a local development environment for contributing to or customizing the Aegis theme.

Updated 4 min read Atmostfear Entertainment

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!
Shell
node --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!
Shell
cd wp-content/themes/aegis

Install Dependencies

PHP Dependencies

Copied!
Shell
composer 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!
Shell
npm 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!
Shell
nvm 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!
Shell
npm run env:start

Or directly:

Copied!
Shell
npm 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!
Shell
npm run env:stop

Or:

Copied!
Shell
npx wp-env stop

Resetting the Environment

To start fresh with a clean WordPress installation:

Copied!
Shell
npx 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!
Shell
npm run build

For development with file watching:

Copied!
Shell
npm run dev

See Building Assets for detailed build documentation.

Directory Structure

After setup, your workspace should look like:

Copied!
Directory tree
aegis/├── .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:

  1. Start the environment: npm run env:start
  2. Start the theme watcher: npm run dev (in wp-content/themes/aegis)
  3. Plugin changes: run npm run dev or npm run build in wp-content/plugins/aegis-dash when editing map/modal/admin assets
  4. Open the site: http://localhost:8888
  5. Make changes to source files.
  6. View changes in the browser (auto-refreshed by the watcher).
  7. Run tests before committing: npm run test
  8. 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

Was this article helpful?