maymeow / cakephp-starter-kit
CakePHP starter kit
Installs: 28
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 3
Forks: 2
Open Issues: 1
Type:project
Requires
- php: >=8.1
- cakephp/cakephp: ^4.4
- cakephp/migrations: ^3.0
- cakephp/plugin-installer: ^1.3
- maymeow/cakephp-service-layer: ^2.1
- mobiledetect/mobiledetectlib: ^2.8
Requires (Dev)
- cakephp/bake: ^2.3
- cakephp/cakephp-codesniffer: ~4.2.0
- cakephp/debug_kit: ^4.4
- josegonzalez/dotenv: ^3.2
- maymeow/sail: dev-main
- phpstan/phpstan: ^0.12.99
- phpunit/phpunit: ~8.5.0 || ^9.3
- psy/psysh: @stable
Suggests
- dereuromark/cakephp-ide-helper: After baking your code, this keeps your annotations in sync with the code evolving from there on for maximum IDE and PHPStan/Psalm compatibility.
- markstory/asset_compress: An asset compression plugin which provides file concatenation and a flexible filter system for preprocessing and minification.
- phpstan/phpstan: PHPStan focuses on finding errors in your code without actually running it. It catches whole classes of bugs even before you write tests for the code.
This package is auto-updated.
Last update: 2024-12-20 21:52:27 UTC
README
Starter kit contains:
- Docker (Linux) or Docker Desktop (Mac or Windows)
- CakePHP 4.4.1 application skeleton
- Bootstrap 5.0 based theme plugin [WIP]
- Predefined Development docker environment (CkePHP, PostgreSQL, Redis)
- Ready to production deployment docker configuration (CakePHP, NGiNX, PostgreSQL, Redis), you can also enable traefik as well.
Your dev environment
Services contained for dev environment in docker-compose.dev.yml
Installation
There are more different ways how to use this project as template for your new application. You can use script recomended to download template for you
curl https://raw.githubusercontent.com/MayMeow/cakephp-starter-kit/main/create -o create-app chmod +x create-app sudo mv create-app /usr/local/bin/
then you can use create-app <your-app-name>
to create your application.
or You can clone this project
git clone --depth=1 --branch=main https://github.com/MayMeow/cakephp-starter-kit.git app_name cd app_name rm -rf .git # then initialize new git repository with git init and set your remotes
or with composer
composer create-project --prefer-dist maymeow/cakephp-starter-kit:dev-main app_name
cd app_name
or with Docker
mdkir app_name cd app_name docker run --rm --volume $(pwd):/app ghcr.io/maymeow/php-ci-cd/php-ci-cd:8.0.2-cs-git sh -c "composer create-project --prefer-dist maymeow/cakephp-starter-kit:dev-main /app" sudo chown -R $USER:$GID .
Configuration
Application will generate security key automaticlly with each install and with each build. This is OK for development but not for production. It is recomended to generate key manually as follows
docker-compose -f docker-compose.dev.yml run --rm cake-app php bin/cake.php generate_security_key
When you have key copy it and update .env.production
file and paste your key right behind SECURITY_SALT=
without any quotes.
Next update DB_USER
, DB_NAME
, DB_PASSWORD
, POSTGRES_PASSWORD
, POSTGRES_USER
and db POSTGRES_DB
. Other variables are preconfigured and if you dont change values in docker compose files you are good to go.
Enabling debug mode
For developmen you can enable debug mode by setting DEBUG=true
in .env.production
file. It is strongly recomended to diasble debug mode for production environment
Console
To access console use command as follows
docker-compose -f docker-compose.dev.yml run --rm cake-app php bin/cake.php
When you need to acces redis console you can use following command:
Getting all keys from redis cacge database
docker exec -it cake_redis redis-cl # keys *
Issues, new features
If you found an issue or you want to provide feedback or you have an idea for new features. Use Issue tab on github project page.
Support
In case you wan to support development you can use funding button in right panel of this project. Or if you want to help develop this project write me email (address you can find on my profile) and I create account for you on my GitLab instance.
License
MIT