A Modern Content Management System Built with CakePHP 5.x and AI Integration
Willow CMS is a powerful, AI-enhanced content management system that combines the robustness of CakePHP 5.x with cutting-edge AI capabilities. Built with developers in mind, it offers a complete Docker development environment and production-ready features.
๐ FREE & OPEN SOURCE โข ๐ง FULLY CUSTOMIZABLE
๐ Live Demo | ๐ Development Blog | ๐ GPL-3.0 License
- Automatic Translation: Support for 25+ languages with AI and Google Translate integration
- SEO Optimization: AI-generated meta titles, descriptions, and social media content
- Smart Tagging: Automatic article tagging based on content analysis
- Image Analysis: AI-powered alt text, keywords, and descriptions for images
- Comment Moderation: Intelligent spam and inappropriate content detection
- Content Generation: AI-powered article summaries and content enhancement
- Plugin-Based Theming: Separate frontend (
DefaultTheme) and admin (AdminTheme) interfaces - Multi-Language First: Built-in internationalization with locale-aware routing
- Queue-Based Processing: Background jobs for heavy operations (image processing, AI tasks)
- Modern Security: IP blocking, rate limiting, CSRF protection, and secure authentication
- Advanced Content Management: WYSIWYG editor (Trumbowyg) with image galleries and responsive design
- Image Gallery System: Comprehensive image management with AI-powered descriptions and metadata
- Docker Development Environment: Complete setup with Nginx, PHP, MySQL, Redis, PHPMyAdmin, Mailpit, and Jenkins
- Management Tool: Interactive CLI (
./manage.sh) for data management, backups, and system operations - Code Quality Tools: PHP CodeSniffer, PHPStan, and comprehensive unit testing with 292+ tests
- CakePHP 5.x Foundation: Following modern MVC patterns and conventions
- Developer Aliases: Streamlined shell commands for common development tasks
- GitHub Actions CI/CD: Automated testing on PHP 8.1, 8.2, 8.3 with Redis integration
- Docker (only requirement on your host machine)
- Git
# Clone the repository
git clone git@github.com:matthewdeaves/willow.git
cd willow/
# Run the setup script
./setup_dev_env.sh๐ That's it! Your development environment is ready:
- Main Site: http://localhost:8080
- Admin Panel: http://localhost:8080/admin
- Login:
admin@test.com/password
- Login:
- phpMyAdmin: http://localhost:8082 (root/password)
- Mailpit: http://localhost:8025 (email testing)
- Redis Commander: http://localhost:8084 (root/password)
- Jenkins: http://localhost:8081 (start with
./setup_dev_env.sh --jenkins)
Install helpful shell aliases for streamlined development:
./setup_dev_aliases.shThis provides shortcuts like:
cake_queue_worker- Start background job processingphpunit- Run all testsphpcs_sniff- Check code standardsphpcs_fix- Auto-fix code violations
# Start queue worker for AI processing, image handling, etc.
cake_queue_worker_verbose
# or
docker compose exec willowcms bin/cake queue worker --verbose# Run all tests (292+ tests with comprehensive coverage)
phpunit
# Run with coverage report
phpunit_cov_html
# Accessible at http://localhost:8080/coverage/
# Run specific test file
phpunit tests/TestCase/Controller/UsersControllerTest.php# Check coding standards
phpcs_sniff
# Auto-fix code violations
phpcs_fix
# Static analysis (PHPStan level 5)
phpstan_analyse
# All quality checks
composer cs-check && composer stan# Run migrations
cake_migrate
# Create migration after schema changes
bake_diff YourMigrationName
# Direct database access
docker compose exec mysql mysql -u cms_user -ppassword cmsThe interactive management tool provides easy access to common tasks:
./manage.shFeatures:
- ๐ Database backups and restoration
- ๐ Internationalization management
- ๐ File backup and restoration
- ๐งน Cache clearing and system maintenance
- ๐ง Interactive container shell access
Willow CMS integrates with leading AI services for enhanced functionality:
Choose between two AI providers:
Anthropic Claude API (Direct)
- Native integration with Claude models
- Direct API access for lowest latency
- Requires Anthropic API key
OpenRouter
- Access to multiple AI providers through one API
- Use Claude, GPT-4, Gemini, Llama, and more
- Flexible model selection per task
- Requires OpenRouter API key
- Content analysis and generation
- SEO optimization (meta titles, descriptions, keywords)
- Image analysis (alt text, keywords)
- Comment moderation and spam detection
- Article summarization and tag generation
- Social media descriptions (Facebook, Twitter, LinkedIn, Instagram)
- Professional-grade translations
- Batch processing support
- 25+ language support
- Navigate to Settings: http://localhost:8080/admin/settings
- Select your AI provider (Anthropic or OpenRouter)
- Add your API keys:
- Anthropic API key (for direct access)
- OpenRouter API key (for OpenRouter provider)
- Google Translate API key
- Configure models per task in AI Prompts (Admin > AI Prompts)
- Enable AI features and select desired languages
- Start a queue worker to process AI jobs
- Framework: CakePHP 5.x
- Database: MySQL 8.0+
- Cache/Queue: Redis
- Container: Docker + Alpine Linux
- Web Server: Nginx + PHP-FPM
willow/
โโโ ๐ src/ # Core application code
โ โโโ ๐ฎ Controller/ # Frontend controllers
โ โ โโโ Admin/ # Admin backend controllers
โ โโโ ๐ Model/ # Data models, entities, and behaviors
โ โ โโโ Behavior/ # Reusable model behaviors
โ โ โโโ Entity/ # Entity classes with business logic
โ โ โโโ Table/ # Table classes with queries
โ โโโ ๐ Service/Api/ # AI and external API integrations
โ โ โโโ Anthropic/ # Claude AI services (direct)
โ โ โโโ OpenRouter/ # OpenRouter API services
โ โ โโโ Google/ # Google Translate services
โ โโโ โก Job/ # Background job classes
โ โโโ ๐ ๏ธ Command/ # CLI command tools
โ โโโ ๐ก๏ธ Middleware/ # Security and rate limiting
โ โโโ ๐๏ธ View/ # View helpers and cells
โ โโโ ๐ง Utility/ # Helper and utility classes
โโโ ๐จ plugins/ # Plugin-based themes
โ โโโ AdminTheme/ # Administrative interface (Bootstrap)
โ โ โโโ src/ # Plugin controllers and logic
โ โ โโโ templates/ # Admin templates and forms
โ โ โโโ webroot/ # Admin assets (CSS, JS)
โ โโโ DefaultTheme/ # Public website theme
โ โโโ src/ # Theme controllers
โ โโโ templates/ # Public templates
โ โโโ webroot/ # Public assets
โโโ โ๏ธ config/ # Configuration files
โ โโโ Migrations/ # Database migration files
โ โโโ schema/ # Database schema files
โ โโโ routes.php # URL routing configuration
โโโ ๐งช tests/ # Comprehensive test suite (292+ tests)
โ โโโ TestCase/ # Test classes
โ โโโ Fixture/ # Test data fixtures
โโโ ๐ณ docker/ # Docker development environment
โโโ ๐ webroot/ # Public web assets and uploads
โโโ ๐ resources/locales/ # Translation files (25+ languages)
โโโ ๐ง manage.sh # Interactive management tool
- ImageAssociableBehavior: Cross-model image associations via pivot table
- SlugBehavior: SEO-friendly URLs with history tracking and automatic redirects
- OrderableBehavior: Drag-and-drop content ordering for galleries and lists
- CommentableBehavior: Universal commenting system with AI moderation
- QueueableImageBehavior: Automated background image processing and analysis
- ContentHelper: Advanced content formatting with alignment and responsive images
- GalleryCell: Reusable gallery display component with translation support
- GitHub Actions: Automated testing on PHP 8.1, 8.2, 8.3 with Redis and MySQL
- Code Coverage: HTML reports available at
/coverage/with detailed metrics - Pre-commit Hooks: Automatic test execution and code quality checks before pushes
- 292+ Tests: Comprehensive test suite covering controllers, models, behaviors, and services
- PHP CodeSniffer: CakePHP coding standards enforcement
- PHPStan: Static analysis (level 5)
- Unit Tests: Comprehensive test coverage with fixtures
# All tests
docker compose exec willowcms php vendor/bin/phpunit
# Specific test file
docker compose exec willowcms php vendor/bin/phpunit tests/TestCase/Controller/UsersControllerTest.php
# With coverage report
docker compose exec willowcms php vendor/bin/phpunit --coverage-html webroot/coverageWillow CMS is built with internationalization as a core feature:
Over 25 languages including English, Spanish, French, German, Chinese, Japanese, and more.
- Automatic Translation: AI-powered content translation
- Locale-Aware Routing: Language-specific URLs
- SEO Translation: Meta content in multiple languages
- Content Localization: Articles, tags, and UI elements
# Extract translatable strings
docker compose exec willowcms bin/cake i18n extract
# Generate translation files
docker compose exec willowcms bin/cake generate_po_files
# Import default translations
docker compose exec willowcms bin/cake load_default_18nFor production environments, we provide a separate deployment repository optimized for AWS AppRunner:
๐ฆ Production Deployment Guide
- Optimized Performance: Redis caching, query optimization
- Security Hardened: Production-ready security configurations
- Scalable Architecture: Cloud-native deployment patterns
- Monitoring: Built-in logging and performance monitoring
- Developer Guide: Comprehensive development documentation
- CakePHP Book: Framework documentation
- API Documentation: Generated API docs (if available)
- Getting Started: Shell aliases, project structure, and conventions
- Feature Development: Database migrations and best practices
- Testing: Unit tests, coverage reports, and CI/CD
- AI Integration: Service classes and API configurations
- Environment Setup: Docker configuration and deployment
We welcome contributions! Please see our Contributing Guidelines for details.
- Fork the repository
- Create a feature branch
- Follow coding standards (use
phpcs_sniffandphpcs_fix) - Write tests for new features
- Submit a pull request
- Follow CakePHP 5.x conventions
- Maintain test coverage above 80%
- Use meaningful commit messages
- Document new features
Willow CMS is released under the GNU General Public License v3.0.
See the LICENSE file for complete details.
- Issues: GitHub Issues
- Discussions: GitHub Discussions
- Documentation: Developer Guide
- CakePHP: The robust PHP framework powering Willow CMS
- Anthropic: AI capabilities via Claude API
- OpenRouter: Multi-provider AI API gateway
- Google Cloud: Translation services
- Community: All contributors and users who make this project possible