Minnow

Minnow Documentation

Minnow is a modern PHP content management system with WordPress database compatibility. It replaces the WordPress runtime with a clean, declarative architecture while keeping your existing content, users, and database intact.


Core Concepts

WordPress-compatible database — Minnow reads and writes the same wp_posts, wp_users, wp_options, and wp_postmeta tables. You can migrate a WordPress site by pointing Minnow at the existing database.

Declarative configuration — Plugins, themes, post types, and settings are defined in YAML manifests instead of PHP function calls. A plugin.yaml replaces functions.php hooks and filters.

Template engine — Themes use simple {{ variable }} syntax in HTML files. No PHP in templates. Loops, conditionals, and part includes cover common patterns.

Entity ORM — A lightweight ActiveRecord layer maps database tables to PHP objects with query building, relationships, and meta data support.

Admin SPA — The admin panel is a Vue 3 single-page application with a REST API backend. Plugins define their admin pages, menus, and settings in YAML.


Architecture

public/
  admin/
    index.php          # Admin SPA entry point
    boot.php           # Bootstrap (DB, auth, plugins, themes)
    api/data.php       # REST API endpoints
  core/
    Api/               # Router, Request, Response
    Auth/              # Authentication, roles, sessions
    Database/          # Connection, QueryBuilder, Schema
    Entity/            # Post, User, Term, Comment, Attachment
    Plugin/            # Plugin loader, manifest, registries
    PostType/          # Post type registry
    Taxonomy/          # Taxonomy registry
    Theme/             # Theme engine, template rendering
    Menu/              # Navigation menus
    Shortcode/         # Shortcode processing
    Hook/              # Event dispatcher
  data/
    plugins/           # Plugin directories
    themes/            # Theme directories
    docs/              # Documentation files
    uploads/           # Media uploads

Boot Order

  1. Database connection initialized
  2. Authentication session started
  3. Post type and taxonomy registries initialized with built-in types
  4. Plugins loaded and activated
  5. Theme content types registered (post types, taxonomies from theme.yaml)
  6. Admin-defined custom post types loaded from database
  7. init hook fired

Documentation

Guide Description
Installing Minnow Setup and configuration
Plugin Development Building plugins with plugin.yaml
Theme Development Templates, context variables, and theme configuration
Custom Post Types Registering content types via theme, plugin, or admin UI
Database & Entities Connection, query builder, schema, and entity ORM
Authentication Login, roles, capabilities, sessions, and CSRF
Composite Blocks Building dashboard and composite admin pages
Developer Docs Additional developer reference

Quick Start

1. Install

See the installation guide for full instructions.

2. Create a Theme

Create data/themes/my-theme/theme.yaml:

name: My Theme
version: 1.0.0

templates:
  default: templates/default.html
  home: templates/home.html
  post: templates/post.html

Create data/themes/my-theme/templates/home.html:

<!DOCTYPE html>
<html>
<head><title>{{ site.name }}</title></head>
<body>
  <h1>{{ site.name }}</h1>
  {{ #posts }}
    <article>
      <h2><a href="{{ url }}">{{ title }}</a></h2>
      <p>{{ excerpt }}</p>
    </article>
  {{ /posts }}
  {{ pagination }}
</body>
</html>

3. Create a Plugin

Create data/plugins/my-plugin/plugin.yaml:

name: My Plugin
version: 1.0.0

settings:
  - key: greeting
    type: text
    group: general
    default: Hello World

admin:
  menu:
    - title: My Plugin
      slug: my-plugin
      icon: sparkles
  pages:
    - slug: my-plugin
      title: My Plugin
      type: settings

Activate the plugin from Settings > Plugins in the admin panel.