The Universal CMS - Start as a blog, grow into anything.
Morpheus is the world's first Universal CMS that combines the simplicity of WordPress with the power of a custom application generator. Start with a blog in 60 seconds, then grow into e-commerce, CRM, or any custom application - all without migrations, plugins, or code.
๐ฏ Perfect for:
- ๐ Bloggers seeking a faster WordPress alternative
- ๐ข Businesses needing a website that grows with them
- ๐จโ๐ป Developers building client sites rapidly
- ๐ Startups prototyping MVPs in minutes
๐ช๐ธ Documentaciรณn en Espaรฑol | ๐ Universal CMS Vision | ๐บ๏ธ Complete Roadmap
- Zero-config form generation from SQL schema
- Automatic validation (server + client-side JavaScript)
- CSRF protection built-in
- SQL injection prevention with prepared statements
- Smart NULL handling for nullable fields
- File uploads with MIME type validation
- Foreign keys auto-detection with dropdown selects
- Many-to-many relationships with multi-select
- Custom display columns for related data
- CLI Tool - Command-line interface for project management
- Authentication - Register, login, logout with rate limiting
- RBAC - Role-based access control with row-level security
- Soft Deletes - Mark records as deleted, restore or permanently delete
- Multi-database support (MySQL, PostgreSQL)
- Internationalization (i18n) - 3 languages included (EN, ES, FR)
- Template System - Blade-like syntax for custom layouts
- Hooks/Events system (10 lifecycle hooks)
- Virtual fields (password confirmation, terms acceptance)
- Automatic transactions with rollback on error
- Audit logging for change tracking
- Caching system for schema metadata
- ENUM field support with auto-generated selects
- Accessibility (ARIA labels, keyboard navigation)
composer require trymorpheus/morpheusRequirements: PHP 8.0+, MySQL 5.7+ or PostgreSQL 12+, PDO extension
After installation, initialize your project:
php bin/morpheus init
php bin/morpheus list:tables
php bin/morpheus generate:metadata usersUniversal CMS Foundation - First working WordPress alternative with Blog CMS!
Blog Content Type:
- Complete WordPress-style blog with posts, categories, tags, and comments
- Frontend rendering with clean URLs and SEO optimization
- Admin panel with sidebar navigation and CRUD operations
- Automatic sitemap.xml and RSS feed generation
- Table prefixes for example isolation (e.g.,
24_posts,24_categories)
Theme System:
- 3 built-in themes (Minimal, Modern, Classic)
- Hot theme switching without data loss
- Self-contained themes with templates and styles
- Pluggable architecture for custom themes
- Database-persisted active theme
One-Click Installer:
- WordPress-style installation wizard (8 steps)
- Beautiful responsive web UI
- CLI mode (interactive + non-interactive)
- System requirements check
- Database connection testing
- Content type selection (blog/empty)
- Theme selection with previews
- Automatic config file generation
Media Library:
- Complete file management system
- Multiple file upload with drag & drop
- Folder organization and navigation
- Grid view with thumbnails
- Image editing (resize, crop, thumbnails)
- Search and filter functionality
- File statistics and storage tracking
Comment System:
- Nested replies (up to 3 levels)
- Moderation (approve/reject/delete)
- Spam detection (keywords and links)
- Gravatar integration
- Beautiful responsive UI
use Morpheus\ContentTypes\ContentTypeManager;
$manager = new ContentTypeManager($pdo);
$manager->install('blog'); // Installs 5 tables with full metadata
// Frontend (index.php)
$router = new FrontendRouter();
$renderer = new FrontendRenderer($pdo, 'blog', null, $seo);
echo $renderer->renderHome(); // Beautiful blog homepage
// Admin (admin.php)
$admin = new AdminPanel($pdo);
$admin->addTable('posts', ['icon' => '๐']);
echo $admin->render(); // Full admin panelNew Classes:
ContentTypeinterface - Contract for all content typesContentTypeManager- Manages content type lifecycleBlogContentType- Complete blog implementationFrontendRouter- Routes public URLs to contentFrontendRenderer- Renders public-facing pagesSEOManager- Meta tags, Open Graph, Schema.org, sitemap, RSSThemeinterface - Contract for all themesThemeManager- Manages theme lifecycleAbstractTheme- Base class for themesMinimalTheme,ModernTheme,ClassicTheme- Built-in themesSystemChecker- Validates system requirementsDatabaseSetup- Database connection and table creationConfigGenerator- Generates config.php fileInstallerWizard- Main installation orchestratorMediaLibrary- File upload and managementImageEditor- Image manipulation (resize, crop, thumbnails)MediaBrowser- Visual file browsing interfaceCommentManager- Comment CRUD and moderationCommentRenderer- Comment UI rendering
Features:
- ๐จ Modern Design - Professional frontend with navigation and search
- ๐ SEO Built-in - Meta tags, Open Graph, Twitter Cards, Schema.org
- ๐ก RSS Feed - Automatic RSS 2.0 feed generation
- ๐บ๏ธ Sitemap - XML sitemap with posts, categories, and tags
- ๐ Fast - 20-30x faster than WordPress
- ๐ Secure - No plugins = no vulnerabilities
๐ See Blog CMS Example
๐ See Theme Showcase Example
๐ See One-Click Installer Example
๐ See Media Library Example
๐ See Comment System Example
Core Classes Refactoring - Massive improvements to code quality and maintainability!
CRUDHandler Refactoring:
- 88% reduction in main method (250 โ 30 lines)
- Extracted 16 focused methods
- Fixed hook execution order
- Better error handling
- Single responsibility per method
ValidationEngine Refactoring:
- 13 extracted validation methods
- Type-specific validators
- Guard clauses for cleaner logic
- Consistent error handling
- Self-documenting code
SchemaAnalyzer Refactoring:
- Improved cache management
- Nullsafe operator for cleaner code
- 3 extracted cache methods
- Single source of truth
Benefits:
- โ Easier to understand and maintain
- โ Better testability
- โ Reduced cognitive load
- โ Consistent patterns
- โ All 366 tests passing (100%)
๐ See Refactoring Patterns
๐ See Release Notes
UI Classes Refactoring - Improved code quality, maintainability, and Components integration!
FormGenerator Refactoring:
- Integrated Components library for tabs and buttons
- Simplified render() method from ~70 to ~15 lines
- Extracted 8 new methods for better organization
- CSS variables support for dynamic theming
- Eliminated code duplication
ListGenerator Refactoring:
- 20% code reduction (~350 to ~280 lines)
- Modern table styling with Components::table()
- Consistent pagination with Components::pagination()
- Cleaner action button rendering
- Better separation of concerns
UI Components Library - 15 reusable, accessible, and beautiful components for building modern UIs!
use Morpheus\UI\Components;
// Set custom theme
Components::setTheme(['primary' => '#667eea']);
// Use components
echo Components::alert('Success!', 'success');
echo Components::badge('New', 'primary');
echo Components::button('Click Me', 'primary');
echo Components::card('Title', '<p>Content</p>');
echo Components::modal('id', 'Title', 'Content');
echo Components::tabs([...]);
echo Components::table(['Name', 'Email'], [[...]]);
echo Components::pagination(3, 10);Features:
- ๐จ 15 Components - Alert, Badge, Button, Card, Modal, Tabs, Accordion, Table, and more
- ๐ญ Themeable - Customize colors to match your brand
- โฟ Accessible - ARIA labels and keyboard navigation
- ๐ฑ Responsive - Mobile-first design
- ๐ Zero Dependencies - Pure PHP, no external libraries
- ๐ Modern Design - Clean, professional styling
๐ See UI Components Example
Workflow Engine - State management with transitions, permissions, and history tracking!
$crud = new Morpheus($pdo, 'orders');
$crud->enableWorkflow([
'field' => 'status',
'states' => ['pending', 'processing', 'shipped', 'delivered'],
'transitions' => [
'process' => [
'from' => 'pending',
'to' => 'processing',
'label' => 'Process Order',
'permissions' => ['admin', 'manager']
],
'ship' => [
'from' => 'processing',
'to' => 'shipped',
'permissions' => ['admin', 'warehouse']
]
],
'history' => true
]);
echo $crud->renderForm($id); // Automatic transition buttons!Features:
- ๐ State Management - Define allowed states for records
- โก๏ธ Transitions - Configure transitions between states
- ๐ Permission Control - Restrict transitions by user role
- ๐จ Automatic UI - Transition buttons rendered automatically
- ๐ History Tracking - Complete audit trail of all transitions
- ๐ช Lifecycle Hooks - Execute custom logic before/after transitions
- ๐ท๏ธ State Labels - Custom labels and colors for each state
๐ See Workflow Example
Admin Panel Generator - Complete admin panel with navigation, dashboard, and integrated CRUD!
use Morpheus\Admin\AdminPanel;
$pdo = new PDO('mysql:host=localhost;dbname=test', 'user', 'pass');
$admin = new AdminPanel($pdo, [
'title' => 'Mi Admin Panel',
'theme' => [
'primary' => '#667eea',
'sidebar_bg' => '#2d3748',
'sidebar_text' => '#e2e8f0'
]
]);
$admin->addTable('users', ['icon' => '๐ฅ', 'label' => 'Usuarios']);
$admin->addTable('products', ['icon' => '๐ฆ', 'label' => 'Productos']);
$admin->addTable('orders', ['icon' => '๐', 'label' => 'Pedidos']);
echo $admin->render(); // Full admin panel!Features:
- ๐ Dashboard - Automatic stats cards for all tables
- ๐จ Sidebar Navigation - Customizable menu with icons
- ๐ Breadcrumbs - Contextual navigation
- ๐ค User Menu - Avatar and user info
- ๐ฑ Responsive - Mobile-first design
- ๐ Full Integration - Uses Morpheus, ListGenerator, FormGenerator
REST API Generator - Automatic REST API generation with JWT authentication!
use Morpheus\API\RestAPIGenerator;
$pdo = new PDO('mysql:host=localhost;dbname=test', 'user', 'pass');
// Create API instance
$api = new RestAPIGenerator($pdo, 'your-secret-key');
$api->handleRequest();
// That's it! All tables now have REST endpoints# Login
curl -X POST http://localhost/api/v1/auth/login \
-H "Content-Type: application/json" \
-d '{"email":"admin@example.com","password":"admin123"}'
# Get users (with token)
curl -X GET http://localhost/api/v1/users \
-H "Authorization: Bearer YOUR_TOKEN"
# Create user
curl -X POST http://localhost/api/v1/users \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{"name":"John","email":"john@example.com"}'Features:
- ๐ Auto Endpoints - GET, POST, PUT, DELETE for every table
- ๐ JWT Authentication - Secure token-based auth
- ๐ OpenAPI/Swagger - Auto-generated documentation
- ๐ CORS Ready - Cross-origin requests enabled
- ๐ Pagination - Automatic list pagination
- ๐ RBAC Integration - Optional permission control
๐ See REST API Example
Multiple File Upload & Theme Integration - Upload multiple files with drag & drop + white-label theming!
// Multiple file upload with drag & drop UI
$crud = new Morpheus($pdo, 'properties');
echo $crud->renderForm(); // Automatic drag & drop for multiple_files type
// Enable global theme configuration
$crud->enableGlobalConfig();
echo $crud->renderForm(); // Applies theme from Global Config automatically-- Configure multiple file upload in column metadata
ALTER TABLE properties
MODIFY COLUMN photos TEXT
COMMENT '{"type": "multiple_files", "accept": "image/*", "max_files": 10, "max_size": 5242880}';Features:
- ๐ธ Multiple File Upload - Drag & drop interface with previews
- ๐จ Theme Integration - Apply global theme to forms automatically
- ๐ข White-label Ready - Custom colors, fonts, logos per tenant
- ๐พ JSON Storage - File paths stored as JSON array
- โ Validation - Max files, MIME types, file sizes
๐ See Multiple Files Example
๐ See Theme Integration Example
Global Config Foundation - Centralized configuration storage for application-wide settings!
# Set configuration
php bin/morpheus config:set application.name "My App"
php bin/morpheus config:set theme '{"primary_color":"#667eea"}'
# Get configuration
php bin/morpheus config:get application.name
# List all configuration
php bin/morpheus config:list
# Delete configuration
php bin/morpheus config:delete old.setting// PHP usage
$config = new GlobalMetadata($pdo);
$config->set('app.name', 'My App');
$appName = $config->get('app.name');๐ See Global Config Examples
SQL Dump & Import - Export and import table structure and data with metadata preserved!
# Export SQL dump (structure + data + metadata)
php bin/morpheus dump:sql users --output=users.sql
# Structure only
php bin/morpheus dump:sql users --output=structure.sql --structure-only
# Data only
php bin/morpheus dump:sql users --output=data.sql --data-only
# Import SQL dump
php bin/morpheus import:sql backup.sql
php bin/morpheus import:sql backup.sql --force # Skip confirmationConsolidation Release - Improved documentation and developer experience!
- ๐ Quick Start Guide - Get started in 5 minutes
- ๐ Migration Guide - Upgrade between versions
- โ Best Practices - Production-ready patterns
- ๐ Examples Guide - 30 examples with learning path
Perfect for:
- New users getting started
- Teams upgrading versions
- Production deployments
- Learning Morpheus
Export/Import - CSV export and import with validation and preview!
// Export to CSV
$csv = $crud->export('csv');
$crud->downloadExport('users.csv');
// Import from CSV with preview
$result = $crud->import($csvContent, ['preview' => true]);
// Generate import template
$template = $crud->generateImportTemplate();# CLI commands
php bin/morpheus export:csv users --output=users.csv
php bin/morpheus import:csv users data.csv --preview
php bin/morpheus generate:template users --output=template.csv๐ See Export/Import Examples
CLI Enhancements - Powerful new commands for webhook management and metadata operations!
# Test database connection
php bin/morpheus test:connection
# Configure webhooks easily
php bin/morpheus webhook:configure users https://webhook.site/abc123
php bin/morpheus test:webhook users
# Export/import metadata for backup and migration
php bin/morpheus metadata:export users --output=users.json
php bin/morpheus metadata:import users.json๐ See CLI Guide
Notifications & Webhooks - Send email notifications and trigger webhooks automatically on CRUD events!
CREATE TABLE orders (
id INT PRIMARY KEY,
customer_name VARCHAR(255),
amount DECIMAL(10,2)
) COMMENT = '{
"notifications": {
"on_create": {
"email": ["admin@example.com"],
"subject": "New Order #{{id}}",
"template": "Customer: {{data.customer_name}}, Amount: ${{data.amount}}"
}
},
"webhooks": [
{
"event": "on_create",
"url": "https://api.example.com/webhook",
"method": "POST",
"headers": {"Authorization": "Bearer token"}
}
]
}';$crud = new Morpheus($pdo, 'orders');
$result = $crud->handleSubmission();
// Email sent + webhook triggered automatically!Validation Rules & Business Logic - Advanced validation configured entirely through table metadata!
CREATE TABLE products (
id INT PRIMARY KEY,
price DECIMAL(10,2),
discount DECIMAL(5,2)
) COMMENT = '{
"validation_rules": {
"unique_together": [["sku", "category"]],
"required_if": {
"min_stock": {"status": "active"}
},
"conditional": {
"discount": {
"condition": "price > 100",
"max": 50
}
}
},
"business_rules": {
"max_records_per_user": 100,
"require_approval": true
}
}';$crud = new Morpheus($pdo, 'products');
$result = $crud->handleSubmission();
// Validates: unique combinations, conditional requirements, business limits๐ See Validation Rules Guide
Authentication, RBAC & Soft Deletes - Complete user authentication, authorization, and soft delete support!
CREATE TABLE users (
id INT PRIMARY KEY,
email VARCHAR(255),
password VARCHAR(255),
role VARCHAR(50)
) COMMENT = '{
"authentication": {
"enabled": true,
"registration": {"enabled": true, "auto_login": true},
"login": {"max_attempts": 5, "lockout_duration": 900}
},
"permissions": {
"create": ["guest"],
"read": ["owner", "admin"],
"update": ["owner", "admin"],
"delete": ["admin"]
}
}';$crud = new Morpheus($pdo, 'users');
$crud->enableAuthentication();
// Login/Register
echo $crud->renderLoginForm();
echo $crud->renderRegistrationForm();
$result = $crud->handleAuthentication();
// Protected pages
if ($crud->isAuthenticated()) {
$user = $crud->getCurrentUser();
echo "Welcome, {$user['name']}!";
}
// Soft Deletes
$crud->delete($id); // Soft delete (marks as deleted)
$crud->restore($id); // Restore deleted record
$crud->forceDelete($id); // Permanently delete๐ See RBAC & Authentication Guide
Table Metadata System - Configure everything via database table comments!
CREATE TABLE posts (
id INT PRIMARY KEY,
title VARCHAR(255),
slug VARCHAR(255),
created_at TIMESTAMP
) COMMENT = '{
"display_name": "Blog Posts",
"icon": "๐",
"list_view": {"searchable": ["title"], "per_page": 20},
"behaviors": {
"timestamps": {"created_at": "created_at"},
"sluggable": {"source": "title", "target": "slug"}
}
}';$crud = new Morpheus($pdo, 'posts');
echo $crud->renderList(); // Search, filters, pagination - all automatic!
$crud->handleSubmission(); // Slug and timestamps - automatic!<?php
require 'vendor/autoload.php';
use Morpheus\Morpheus;
// MySQL
$pdo = new PDO('mysql:host=localhost;dbname=mydb', 'user', 'pass');
// PostgreSQL
// $pdo = new PDO('pgsql:host=localhost;dbname=mydb', 'user', 'pass');
$crud = new Morpheus($pdo, 'users');
// That's it! Handle both display and submission
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
$result = $crud->handleSubmission();
echo $result['success'] ? "Saved! ID: {$result['id']}" : "Error";
} else {
echo $crud->renderForm($_GET['id'] ?? null); // null = create, ID = edit
}Add metadata to your table columns using JSON in comments:
ALTER TABLE users
MODIFY COLUMN email VARCHAR(255)
COMMENT '{"type": "email", "label": "Email Address", "tooltip": "We will never share your email"}';
ALTER TABLE users
MODIFY COLUMN age INT
COMMENT '{"type": "number", "min": 18, "max": 120}';
ALTER TABLE users
MODIFY COLUMN created_at TIMESTAMP
COMMENT '{"hidden": true}';// If 'posts' table has a foreign key to 'users',
// Morpheus automatically creates a dropdown with user names
$crud = new Morpheus($pdo, 'posts');
echo $crud->renderForm();
// Dropdown shows: "John Doe", "Jane Smith", etc.$crud = new Morpheus($pdo, 'posts');
// Configure M:N relationship (posts โ tags via post_tags pivot table)
$crud->addManyToMany(
'tags', // Field name in form
'post_tags', // Pivot table
'post_id', // Local key
'tag_id', // Foreign key
'tags' // Related table
);
echo $crud->renderForm($_GET['id'] ?? null);
// Renders a multi-select with all available tags$crud = new Morpheus($pdo, 'posts');
// Auto-generate slug before saving
$crud->addHook('beforeSave', function($data) {
$data['slug'] = strtolower(str_replace(' ', '-', $data['title']));
return $data;
});
// Log after creation
$crud->addHook('afterCreate', function($data, $id) {
error_log("New post created: ID $id");
});
$crud->handleSubmission();use Morpheus\VirtualField;
$crud = new Morpheus($pdo, 'users');
// Add password confirmation field (not stored in database)
$crud->addVirtualField(new VirtualField(
name: 'password_confirmation',
type: 'password',
label: 'Confirm Password',
required: true,
validator: fn($value, $data) => $value === ($data['password'] ?? ''),
attributes: [
'placeholder' => 'Repeat your password',
'error_message' => 'Passwords do not match'
]
));
// Hash password before saving
$crud->beforeSave(function($data) {
$data['password'] = password_hash($data['password'], PASSWORD_DEFAULT);
return $data;
});// Auto-detects language from URL (?lang=es), session, or browser
$crud = new Morpheus($pdo, 'users');
// Or force a specific language
$crud = new Morpheus($pdo, 'users', locale: 'es');
echo $crud->renderForm();
// Form, validation messages, and UI are now in Spanish!Language Switcher:
<a href="?lang=en">๐ฌ๐ง English</a>
<a href="?lang=es">๐ช๐ธ Espaรฑol</a>
<a href="?lang=fr">๐ซ๐ท Franรงais</a>use Morpheus\Template\BladeTemplate;
// Create template engine
$engine = new BladeTemplate(__DIR__ . '/templates', __DIR__ . '/cache');
// Use with Morpheus
$crud = new Morpheus($pdo, 'users');
$crud->setTemplateEngine($engine);
// Or render templates directly
echo $engine->render('Hello, {{ $name }}!', ['name' => 'World']);Blade-like syntax:
@if ($user->isAdmin())
<p>Welcome, Admin!</p>
@else
<p>Welcome, User!</p>
@endif
@foreach ($items as $item)
<li>{{ $item }}</li>
@endforeach$crud = new Morpheus($pdo, 'users');
$crud->enableAudit($userId); // Track who changed what
$crud->handleSubmission();
// Automatically logs: action, user_id, IP, old_values, new_values- UI Components Guide - 15 reusable components
- Components Library - Alerts, badges, buttons, cards, modals, tabs, tables, and more
- Workflow Engine Guide - State management with transitions
- Workflow System - Permission-based transitions and history tracking
- Admin Panel Generator - Complete admin panel with dashboard
- Sidebar Navigation - Customizable menu with icons
- REST API Generator - Automatic REST API with JWT auth
- OpenAPI/Swagger - Auto-generated API documentation
- Theme System Guide - Complete theme system documentation
- Content Types Guide - Content type system
- Frontend Rendering Guide - Public pages
- SEO Guide - SEO optimization
- Multiple File Upload - Drag & drop with previews
- Theme Integration - White-label theming from Global Config
- Global Metadata Guide - Centralized configuration
- SQL Dump & Import - Export/import with metadata preservation
- Quick Start Guide - 5-minute tutorial
- Migration Guide - Version upgrade guide
- Best Practices - Production patterns
- Examples Guide - Learning path
- Export/Import - CSV export and import with validation
- CLI Tool Guide - Enhanced CLI with 19 commands
- Notifications & Webhooks Guide - Email notifications & webhooks
- Validation Rules Guide - Advanced validation & business logic
- CLI Tool Guide - Command-line interface documentation
- RBAC & Authentication Guide - Complete auth & permissions guide
- Table Metadata Guide - Complete v2.0 guide
- Table Metadata Roadmap - Future features
- Template System Guide - Blade-like templates
- Internationalization (i18n) Guide - Multi-language support
- Hooks System Guide - 10 lifecycle hooks explained
- Virtual Fields Guide - Password confirmation, terms acceptance
- Many-to-Many Relationships - M:N setup guide
- Customization Guide - Metadata options
- Performance & Memory Guide - Optimization best practices
- Quick Start Guide - Get started in 5 minutes
- Migration Guide - Upgrade between versions
- Best Practices - Production-ready patterns
- Docker Setup - MySQL & PostgreSQL with Docker
- Changelog - Version history
- Contributing - How to contribute
Configure fields via JSON in COLUMN_COMMENT:
| Option | Type | Description | Example |
|---|---|---|---|
type |
string | Input type | "email", "url", "color", "tel", "password", "search", "time", "week", "month", "range", "file" |
label |
string | Field label | "Your Email" |
placeholder |
string | Placeholder text | "Enter your name" |
min |
int | Min value (number) | 18 |
max |
int | Max value (number) | 120 |
minlength |
int | Min length (text) | 3 |
pattern |
string | Regex pattern | "[0-9]{3}-[0-9]{3}-[0-9]{4}" |
step |
string | Step increment | "0.01", "any" |
tooltip |
string | Help text | "Enter a valid URL" |
readonly |
bool | Read-only field | true |
hidden |
bool | Hide from form | true |
autocomplete |
string | Autocomplete hint | "email", "tel", "off" |
display_column |
string | FK display field | "full_name" |
accept |
string | File types | "image/*" |
max_size |
int | Max file size (bytes) | 2097152 (2MB) |
max_files |
int | Max files (multiple_files) | 10 |
Example:
COMMENT '{"type": "email", "label": "Email", "tooltip": "Required field", "minlength": 5}'โ
CSRF Protection - Automatic token generation and validation
โ
SQL Injection Prevention - Prepared statements only
โ
XSS Protection - Automatic input sanitization
โ
File Upload Security - Real MIME type validation with finfo
โ
Transaction Safety - Automatic rollback on errors
| Hook | Timing | Use Case |
|---|---|---|
beforeValidate |
Before validation | Modify data before checks |
afterValidate |
After validation | Additional validation |
beforeSave |
Before INSERT/UPDATE | Generate slugs, timestamps |
afterSave |
After INSERT/UPDATE | Logging, notifications |
beforeCreate |
Before INSERT only | Set default values |
afterCreate |
After INSERT only | Send welcome email |
beforeUpdate |
Before UPDATE only | Track changes |
afterUpdate |
After UPDATE only | Clear cache |
beforeDelete |
Before DELETE | Check dependencies |
afterDelete |
After DELETE | Cleanup files |
Morpheus has comprehensive test coverage:
- 300 tests with 582+ assertions
- 100% passing rate (300 passing, 0 failing)
- 90% code coverage
- Automated CI/CD with GitHub Actions
- Tests run on PHP 8.0, 8.1, 8.2, 8.3
# Run all tests
php vendor/phpunit/phpunit/phpunit
# Run specific test suite
php vendor/phpunit/phpunit/phpunit tests/AuthenticationManagerTest.php
php vendor/phpunit/phpunit/phpunit tests/PermissionManagerTest.php
php vendor/phpunit/phpunit/phpunit tests/SoftDeletesTest.php๐ See Complete Roadmap - Detailed plan for v3.6-v6.0
๐ Universal CMS Strategy - WordPress alternative vision
๐ v4.0 Implementation Plan - Technical details for v4.0
The Game-Changing Release - Transform Morpheus into a WordPress alternative!
Core Features:
- โจ One-Click Installer - Working site in 60 seconds
- ๐ฆ 4 Content Types - Blog, Portfolio, E-commerce, Directory
- ๐จ 5 Professional Themes - Ready-to-use designs
- ๐ Frontend Rendering - Public-facing pages with SEO
- ๐ WordPress Migrator - Import your WP site in minutes
- ๐ 10x Faster - <500ms load time vs 2-3s for WordPress
Why v4.0 Matters:
- ๐ฏ Market: 810M WordPress sites (potential users)
- ๐ฐ Revenue: $2.1M ARR target in Year 1
- ๐ Position: First CMS that grows into any app
- ๐ฅ Viral: "Migrated from WordPress in 10 minutes"
Timeline: 12-16 weeks | Launch: September 2025
- Authentication System
- User registration with auto-login
- Secure login with rate limiting
- Session management with remember me
- Password hashing (bcrypt)
- RBAC (Role-Based Access Control)
- Table-level permissions
- Row-level security
- Automatic enforcement in forms/lists
- Soft Deletes
- Mark records as deleted without removing
- Restore deleted records
- Force delete for permanent removal
- AuthenticationManager class
- PermissionManager class
- 5 new examples (4 auth + 1 soft deletes)
- 52 new tests (100% passing)
- Table Metadata System (Phase 1 - Quick Wins)
- UI/UX Customization (list views, colors, icons)
- Dynamic Forms (tabs, fieldsets)
- Automatic Behaviors (timestamps, sluggable)
- Search & Filters (full-text search + filters)
- ListGenerator class with search/filter rendering
- TableMetadata class with 20+ methods
- 4 new examples in 06-table-metadata/
- Complete documentation (TABLE_METADATA.md)
- Full CRUD operations (Create, Read, Update, Delete)
- Foreign key relationships
- Many-to-many relationships
- Hooks/Events system
- Audit logging
- File uploads
- Client + Server validation
- Caching system
- Comprehensive test suite
- PostgreSQL support with Adapter pattern
- Auto-detection of database driver
- Docker setup for MySQL & PostgreSQL
- Virtual fields (password confirmation, terms acceptance)
- Comprehensive test suite (113 tests)
- CI/CD pipeline (GitHub Actions)
- FormGenerator enhancements (16+ metadata options)
- Internationalization (i18n) - 3 languages (EN, ES, FR)
- Advanced M:N UI (checkboxes with search)
- Translator class with auto-detection
- Client + Server translation support
- 31 new tests for i18n (100% passing)
- Template System - Blade-like syntax
- Layout inheritance (@extends, @section, @yield)
- Partials (@include)
- Automatic escaping ({{ }} vs {!! !!})
- File caching for performance
- 17 new tests for templates (100% passing)
- Validation Rules
- unique_together - Composite unique constraints
- required_if - Conditional required fields
- conditional - Dynamic min/max validation
- Business Rules
- max_records_per_user - Record limits per user
- require_approval - Approval workflows
- ValidationRulesEngine class
- 4 new examples in 10-validation-rules/
- 12 new tests (100% passing)
- Notifications & Webhooks
- Email notifications with template placeholders
- Webhook triggers with custom headers
- Field-specific update notifications
- Multiple recipients and webhooks
- Non-blocking error handling
- NotificationManager class
- 2 new examples in 11-notifications/
- 7 new tests (100% passing)
- Multiple File Upload
- Drag & drop interface with file previews
- Multiple file handling with JSON storage
- Max files validation
- Existing file management
- Theme Integration
- Global theme configuration support
- CSS variables injection
- White-label branding (logo, app name)
- Per-tenant theming capability
- ThemeManager class
- FileUploadHandler enhancements
- 2 new examples (real estate, theme demo)
- 9 new tests (100% passing)
- REST API Generator
- Automatic CRUD endpoints for all tables
- JWT authentication with token generation
- OpenAPI/Swagger documentation
- CORS support for cross-origin requests
- Pagination for list endpoints
- RBAC integration optional
- RestAPIGenerator class
- 1 new example (REST API tester)
- 7 new tests (100% passing)
- Admin Panel Generator
- Complete admin panel with sidebar navigation
- Dashboard with automatic stats
- Breadcrumbs for contextual navigation
- User menu with avatar
- Responsive mobile-first design
- Full integration with Morpheus components
- AdminPanel class
- 1 new example (complete admin panel)
- 12 new tests (100% passing)
- Workflow Engine
- State management with configurable states
- Transitions with from/to state validation
- Permission-based transition control
- Automatic transition buttons in forms
- Complete history tracking with audit trail
- Lifecycle hooks (before/after transitions)
- State labels with custom colors
- Multiple from states support
- WorkflowEngine class
- 1 new example (order management workflow)
- 13 new tests (100% passing)
- UI Components Library
- 15 reusable components (alert, badge, button, card, modal, tabs, accordion, table, etc.)
- Themeable with custom colors
- Accessible with ARIA labels
- Responsive mobile-first design
- Zero dependencies
- XSS protection built-in
- Components class with static methods
- 1 new example (UI components showcase)
- 26 new tests (100% passing)
v4.0 - Universal CMS Foundation (Q3 2025)
- Content type system (blog implemented)
- Frontend rendering engine with SEO
- One-click installer (WordPress-style) โ
- 3 professional themes (Minimal, Modern, Classic)
- WordPress migration tool โ
- Media library โ
- Comment system โ
v4.1 - CMS Advanced Features (Q4 2025)
- Theme marketplace
- Page builder (drag & drop)
- Widget system
- Menu builder
- Revision history
- Scheduled publishing
v4.2 - CMS SEO & Performance (Q1 2026)
- Built-in SEO optimization
- Image optimization (WebP)
- CDN integration
- Multi-layer caching
- PWA capabilities
v4.3 - Multi-Tenant & SaaS (Q2 2026)
- Tenant isolation
- White-label capabilities
- Usage tracking & billing
- Subdomain routing
- 58 PHP classes (~19,500 lines)
- 43 working examples (1 in v4.0, 1 in v3.3, 1 in v3.2, 1 in v3.1, 1 in v3.0, 2 in v2.9, 1 in v2.8, 1 in v2.7, 2 in v2.5, 2 in v2.3, 4 in v2.2, 6 in v2.1, 4 in v2.0)
- 23 technical documents
- 421 automated tests (418 passing, 99.3% pass rate, 90% coverage) (1 in v3.3, 1 in v3.2, 1 in v3.1, 1 in v3.0, 2 in v2.9, 1 in v2.8, 1 in v2.7, 2 in v2.5, 2 in v2.3, 4 in v2.2, 6 in v2.1, 4 in v2.0)
- 22 technical documents
- 366 automated tests (100% passing, 90% coverage)
- 19 CLI commands
- Languages supported: 3 (English, Spanish, French)
- Databases supported: 2 (MySQL, PostgreSQL)
- Template engine: Blade-like syntax
- CLI Tool: 20 commands (init, install, generate, validate, clear, list, export, import, etc.)
- Authentication: Register, login, logout, password reset, rate limiting
- RBAC: Table + row-level permissions
- Soft Deletes: Delete, restore, force delete
- Validation Rules: 3 types (unique_together, required_if, conditional)
- Business Rules: 2 types (max_records_per_user, require_approval)
- Table metadata features: 6 (UI/UX, Forms, Behaviors, Search, Validation, Business)
- File Upload: Single + multiple with drag & drop
- Theming: Global config with CSS variables
- REST API: Automatic generation with JWT auth
- Admin Panel: Complete admin interface with dashboard
- Refactored Classes: 6 (FormGenerator, ListGenerator, AdminPanel, CRUDHandler, ValidationEngine, SchemaAnalyzer)
Contributions are welcome! Please read CONTRIBUTING.md for guidelines.
- Fork the repository
- Create a feature branch:
git checkout -b feature/amazing-feature - Commit your changes:
git commit -m 'Add amazing feature' - Push to the branch:
git push origin feature/amazing-feature - Open a Pull Request
Creator & Project Lead: Mario Raรบl Carbonell Martรญnez
Development: Amazon Q (Claude Sonnet 4.5)
This project is licensed under the MIT License - see the LICENSE file for details.
If you find this project useful, please consider:
- โญ Starring the repository
- ๐ Reporting bugs
- ๐ก Suggesting new features
- ๐ข Sharing with others
Made with โค๏ธ by Mario Raรบl Carbonell Martรญnez