A custom application skeleton for creating applications with CakePHP 5.x, enhanced with Willetts Technology's development tools and customizations.
This skeleton builds upon cakephp/app with additional features for streamlined development and deployment.
This skeleton includes QueenCityCodeFactory/butter-cream, a custom CakePHP plugin providing Bootstrap 5 integration and theme components.
- Ansible provisioning - Complete Ansible playbooks and roles for automated development environment setup
- Pre-configured services:
- PHP 8.2+ with FPM
- Nginx web server with SSL support
- MySQL database
- Memcached
- Mailpit (email testing)
- Node.js with NVM
- wkhtmltopdf for PDF generation
- Chrony for time synchronization
- Gulp-based build system - Automated SCSS compilation, JavaScript bundling, and asset optimization
- Modern frontend stack:
- Bootstrap 5.3+
- Font Awesome 6.5+
- jQuery 3.7+
- Select2 with Bootstrap 5 theme
- Moment.js with timezone support
- Inputmask
Pre-built JavaScript utilities in assets/app/js/:
ajax-pagination.js- AJAX-based paginationapp-core.js- Core application JavaScriptclear-search-form.js- Search form reset functionalityclipboard.js- Clipboard operationsformat-time.js- Time formatting utilitiesmodal-confirm.js- Confirmation modalspagination-limit.js- Pagination limit controlspoptart.js- Toast notificationssession-monitor.js- Session timeout monitoringtmp-file-upload.js- Temporary file upload handling
Organized styles in assets/app/scss/:
- Action dropdowns
- Button groups and custom buttons
- Callouts and cards
- Form enhancements
- Navigation components
- PDF-specific styles
- Responsive layout system
- Template-specific styles
- US States configuration file (
config/states.php) - Enhanced .gitignore for development environment
- Self-signed certificate generation script
- Crontab management
- Development-specific SSL configuration
The framework source code can be found here: cakephp/cakephp.
- Download Composer or update
composer self-update. - Clone this repository or use it as a template.
This skeleton includes a complete Ansible provisioning system for setting up a standardized development environment:
- Ensure you have Ansible installed on your host machine
- Configure your inventory in
ansible/inventories/development/ - Run the Ansible playbook:
ansible-playbook ansible/playbooks/development.yml
The Ansible setup will configure all necessary services, install dependencies, and prepare your development environment.
After installation, build the frontend assets:
npm install
npm run buildThis will compile SCSS, bundle JavaScript, and copy necessary assets to the webroot.
You can now either use your machine's webserver to view the default home page, or start up the built-in webserver with:
bin/cake server -p 8765Then visit http://localhost:8765 to see the welcome page.
The project uses Gulp for asset compilation. Available commands:
npm run build # Build all assets (SCSS, JS, fonts)Gulp tasks handle:
- SCSS compilation with autoprefixing and minification
- JavaScript linting, concatenation, and uglification
- Source map generation
- Font file installation
- Asset watching for development
Crontab management is handled through Ansible. Application-specific cron jobs should be placed in cron.d/ directory.
This skeleton maintains compatibility with upstream CakePHP/app while adding:
- Ansible Infrastructure - Complete development environment automation
- Frontend Tooling - Gulp build system with modern JavaScript/CSS pipeline
- ButterCream Plugin - Bootstrap 5 integration and UI components
- Custom Components - Reusable JavaScript modules and SCSS components
- Enhanced Configuration - Additional config files for common use cases (states, etc.)
- Development Tools - SSL certificate generation, improved .gitignore
- Service Integration - Pre-configured Mailpit, Memcached, wkhtmltopdf
To update from upstream:
git fetch upstream 5.x
git merge upstream/5.xReview and resolve any conflicts, particularly in:
composer.json(dependencies)config/files (configuration)templates/layout/default.php(layout customizations)
Read and edit the environment specific config/app_local.php and set up the
'Datasources' and any other configuration relevant for your application.
Other environment agnostic settings can be changed in config/app.php.
config/states.php- US state listings for dropdown/select menusdevelopment.openssl.cnf- OpenSSL configuration for development SSL certificatesansible.cfg- Ansible configuration for development provisioning
This skeleton uses Bootstrap 5 instead of the default Milligram framework. Bootstrap is integrated via the ButterCream plugin and custom SCSS components in assets/app/scss/.
The layout includes:
- Responsive navigation
- Custom button styles and components
- Card and callout components
- Form enhancements
- PDF-optimized styles
- Mobile-responsive design
Since this skeleton includes custom modifications on top of the upstream CakePHP/app, updates should be done carefully:
-
Fetch the latest upstream changes:
git fetch upstream 5.x
-
Review the changes before merging:
git log HEAD..upstream/5.x
-
Merge upstream changes:
git merge upstream/5.x
-
Test thoroughly, particularly:
- Custom controller and view modifications
- ButterCream plugin compatibility
- Asset compilation
- Ansible playbooks
- PHP: 8.2 or higher
- CakePHP: 5.3+
- Node.js: 14+ (for asset compilation)
- Composer: Latest version
- Built on CakePHP
- Customized by Willetts Technology, Inc.
- Maintained by QueenCityCodeFactory