Use this project as starting project if you plan to use Koldy Framework and all benefits that Framework brings with itself.
Please check other branches for different framework and PHP versions.
After cloning this project, run init.sh in console. init.sh will:
- Start Vagrant virtual machine with Ubuntu 22.04
- Install Nginx, PHP 8.1 and PostgreSQL 14
- Initialize complete project structure, including folders that are under
.gitignore - Install Composer and dependencies: Koldy Framework as main dependency, PHPUnit for testing and etc.
When script is done, open http://localhost:5000
Next time you'll want to start the project, use start.sh instead of init.sh.
Koldy Boilerplate Vagrant VM will take only 256MB of RAM, together with complete OS, web server, databases and all other installed services. Not much, isn't it?
To access PostgreSQL database, connect to localhost:5001 with username vagrant, password vagrant and database vagrant.
To access MySQL (MariaDB) database, connect to localhost:5002 with username vagrant, password vagrant and database vagrant.
This boilerplate is already configured to talk to the local MySQL database by default.
You can start unit tests from your computer by running test.sh. It'll run PHPUnit command on VM. If you want to start tests
on VM, then go to /vagrant folder and start ./bin/phpunit command.
Build will usually depend on your frontend environment, but we're not here to solve frontend problems.
To build backend, extend build.sh with your own stuff. We've prepared only version increment as part of build process.
The build-and-deploy.sh script will:
- Run
build.sh - Create
deployfolder as output folder - Run Composer install command with optimize autoloader flag
- Copy all production files and folders to
deployfolder, meaning you won't get tests, tools, storage and other non-production stuff - Run Composer install again, to return to original state
If you run build-and-deploy.sh script on the boilerplate, it'll produce deploy folder of about 1.5MB. This is not mistake.