crabstudio / app
CakePHP skeleton app
Installs: 376
Dependents: 0
Suggesters: 0
Security: 0
Stars: 15
Watchers: 7
Forks: 392
Open Issues: 1
Language:JavaScript
Type:project
Requires
- php: >=5.5.9
- cakephp/cakephp: ~3.2
- cakephp/migrations: ~1.0
- cakephp/plugin-installer: *
- crabstudio/authenticate: ^1.0
- dereuromark/cakephp-tinyauth: ^1.3
- friendsofcake/search: ^1.2
- mobiledetect/mobiledetectlib: 2.*
- wyrihaximus/minify-html: ^1.1
Requires (Dev)
- cakephp/bake: ~1.1
- cakephp/debug_kit: ~3.2
- psy/psysh: @stable
Suggests
- cakephp/cakephp-codesniffer: Allows to check the code against the coding standards used in CakePHP.
- phpunit/phpunit: Allows automated tests to be run without system-wide install.
- dev-master
- 3.2.x-dev
- 3.2.9
- 3.2.9-rc1
- 3.2.8
- 3.2.7
- 3.2.6
- 3.2.5
- 3.2.4
- 3.2.3
- 3.2.2
- 3.2.1
- 3.2.0
- 3.1.2
- 3.1.1
- 3.1.0
- 3.1.0-beta
- 3.0.5
- 3.0.4
- 3.0.3
- 3.0.2
- 3.0.1
- 3.0.0
- 3.0.0-RC2
- 3.0.0-RC1
- 3.0.0-beta3
- 3.0.0-beta2
- 3.0.0-beta1
- 3.0.0-alpha2
- 3.0.0-alpha1
- dev-master-license-removal
- dev-issue-298
- dev-revert-255-ajaxview
- dev-revert-244-jsonview-serialization
This package is auto-updated.
Last update: 2024-10-29 04:36:45 UTC
README
A skeleton for creating applications with CakePHP 3.x.
The framework source code can be found here: cakephp/cakephp.
Features
- Authenticate, Authorize
- Backend ready
- Simple shells => Power tool
- New CRUD bake template
- Send bulk email
- Backup database job
- Store Settings in database
- Improve pages peed: .htaccess, minify html, cdn, cache
- Integrated file manager, tinymce
- Prevent brute force attack
- Remember/Auto login
- Compress whole project to
deploy.tar.gz
file to ship in one click(deploy/compress.sh)
- Provide VERY SIMPLE script to set up nginx (script link)
Support my passion
Create project
- Download Composer or update
composer self-update
. - Run
php composer.phar create-project --prefer-dist crabstudio/app [app_name]
.
If Composer is installed globally, run
composer create-project --prefer-dist crabstudio/app [app_name]
Installation
Initial new application
- Setup
Datasource
inconfig/app.php
- Run and follow the command:
bin/cake install
- Application ready to use.
Refactory
Incase you want to wipe and reinstall application
- Run and follow the command:
bin/cake refactory
- Application ready to use.
Available shell commands
bin/cake install : install default database
bin/cake refactory : wipe existing database then install factory database
bin/cake users : insert administrator
bin/cake roles : insert 3 default roles [admin, manager, member]
bin/cake settings : insert default settings
bin/cake scheduler : run task, let's create crontab schedule [scroll down to Crontab schedule]
EmailQueue
If you want to build an url point to your Controller, build it in the controller and set to the view
// Router
$routes->connect('/verify/:token/:email', [
'controller' => 'Coupons',
'action' => 'verify'
], [
'token' => '[a-z0-9]+',
'email' => '^[A-Za-z0-9._%+-]+@([A-Za-z0-9-]+\.)+([A-Za-z0-9]{2,4}|museum)$',
'pass' => [
'token',
'email'
]
]);
// Build url
use Cake\ORM\TableRegistry;
use Cake\Routing\Router;
TableRegistry::get('EmailQueue')
->enqueue(
$emailAddress,
[
'user' => 'Anh Tuan',
'variable_url' => Router::url([
'controller' => 'Coupons',
'action' => 'verify',
$tokenString,
$emailAddress,
'_full' => true
])
], [
'subject' => __('Issue the coupon'),
'template' => 'Coupon/issue',
'format' => 'html',
'layout' => 'default'
]);
// Email view (src/Template/Email/html/Coupon/issue.ctp)
<?= __('Hi {0},', $user)?>
<?= $this->Html->link(__('Verify'), $url)?>
Bake
You can use bake to generate CRUD code, then you're ready to use.
bin/cake bake all Posts --prefix admin
Template theme
Add menu to the backend
Edit src/Template/Element/Admin/navbar_side.ctp
to add more menu
Included Plugins
Backend Template:
This skeleton use Flat Admin v2 as new bake template
You just do bake code, you're good to go.
Crontab schedule:
Open crontab crontab -e
then add cronjob:
*/5 * * * * cd /path/to/app && bin/cake Scheduler
Compress project to ship
Go to deploy
folder then double click on compress.sh
Set up nginx Web server
I recommend you to use nginx server.
Use this simple script to set up optimized nginx on ubuntu in 4 simple steps.