In order to setup the application for development for the first time please see the following instructions and recommendations.
Follow the general install/setup documentation until the application setup: Install
The following dev tools are highly recommended and the documentation assumes you installed them and added them to your environment paths on Windows. On linux they should be accessible immediately after installation.
# For php/html/js developers
sudo apt-get install git poppler-utils mariadb-server mariadb-client postgresql postgresql-contrib vsftpd tesseract-ocr wget curl grep sed composer nodejs npm software-properties-common php8.3 php8.3-dev php8.3-cli php8.3-common php8.3-intl php8.3-mysql php8.3-pgsql php8.3-xdebug php8.3-opcache php8.3-pdo php8.3-sqlite php8.3-mbstring php8.3-curl php8.3-imap php8.3-bcmath php8.3-zip php8.3-dom php8.3-xml php8.3-phar php8.3-gd php-pear apache2 redis redis-server memcached sqlite3 wkhtmltopdf imagemagick
sudo systemctl enable apache2
sudo mysql_secure_installation
sudo systemctl start mariadb
sudo systemctl enable mariadb
sudo a2enmod rewrite
sudo a2enmod expires
sudo a2enmod headers
sudo systemctl restart apache2
# For c/c++ developers (additional may be required, see below)
sudo apt-get install gcc curl libcurl4-openssl-dev libxml2 libxml2-dev cmake
Which IDE or editor a developer uses is up to the individual developer. From experience the following opinionated choices provided good results:
- Visual Studio Code
- Sublime
- PhpStorm (mostly for php, html, css, js)
Option 2 and 3 require you to install the dev tools in advance!
- Option: Use the virtual machine we provide for devs which has everything setup and configured to start almost instantly after download Most Recommended
- Option: Installs the application (with a lot of dummy data, this may take a long time). Recommended (slow but a lot of useful data)
- Option: Installs the application (with or without performing tests). (slow and much less useful data)
Please contact us if you would like to use our VM, we will send you a download link.
-
Install VirtualBox
-
Download the VM image
-
Setup your IDE (i.e. to use ssh, or mount the git repository, ...)
- Username: jingga
- Password: orange
The VM has apache2 and a database already running with dummy data for immediate development. The VM size is 60 GB.
Additional tools and settings coming with the VM:
- composer & npm already installed incl. the respective developer tools
- Automatic trace and benchmark generation with every web request in
/var/www/html/webgrind/Logs
- Webgrind view
http://vm_ip:82
- Trace visualization
http://vm_ip:81
- Download the latest trace from
http://vm_ip:82/Logs
- Drag and drop that downloaded
*.xt
file in the trace visualizer
- Download the latest trace from
sitespeed.io ./Build/Helper/Scripts/sitespeedDemoUrls.txt -b chrome --outputFolder /var/www/html/sitespeed
- Slow sql query threshold is defined as 0.5s.
This will only setup the application including some dummy data and also perform the code tests but no quality checks. Compared to option 2 this includes much more test data and it doesn't execute a unit test.
- Go to the directory where you want to install the application
- Run
git clone -b develop --recurse-submodules -j8 https://github.com/Karaka-Management/Karaka.git
- Run
git submodule foreach git checkout develop
- Run
git clone -b master https://github.com/Karaka-Management/demoSetup.git
- Run
composer install
insideKaraka
- Run
npm install
insideKaraka
- Create the database
omd
in your database management software - Adjust the
demoSetup/config.php
file according to your settings (e.g. database user + password) - Run
php demoSetup/setup.php
insideKaraka
(takes a long time: > 2h)
After the installation you'll have access to the following content:
- Application:
http://127.0.0.1
Instead of calling php demoSetup/setup.php
which only uses a single thread you may also run php demoSetup/setup.php -a 0
which will execute the install script in multiple threads leading to most likely 100% CPU and storage usage but therefore significantly reduce the execution time.
You may want to call the setup script as a different user to ensure the same permissions
sudo -u wwww-data php demoSetup/setup.php
For debugging you may use the command
sudo -u www-data php -dxdebug.mode=debug -dxdebug.start_with_request=yes demoSetup/setup.php
- During this process the database automatically gets dropped (if it exists) and re-created
- The total storage space needed for this installation (w/o profiling data) is ≈10 GB
- The database space needed for this installation is ≈500 MB
- The runtime of the script is approx. 1h but can be slower depending on the hardware (slower CPU, hard drive vs SSD)
You may want to use the following command to run the install script instead in order to also generate a cachegrind output for memory and performance profiling:
php -dxdebug.mode=develop,debug,profile -dxdebug.start_with_request=yes -dxdebug.output_dir=/your/path demoSetup/setup.php
This may use a lot of resources and storage space (≈15 GB of cachegrind data w/o trace data and ≈120 GB w/ trace data)
This will only setup the application including some dummy data and also perform the code tests but no quality checks.
- Go to the directory where you want to install the application
- Run
git clone -b develop --recurse-submodules -j8 https://github.com/Karaka-Management/Karaka.git
- Run
git submodule foreach git checkout develop
- Run
composer install
insideKaraka
- Run
npm install
insideKaraka
- Create the database
omt
in your database management software - Create the database user
test
with the passwordorange
- Adjust the
tests/Bootstrap.php
file according to your settings (e.g. database user name + password) - Run
php -dxdebug.mode=develop,debug,profile,coverage -dxdebug.start_with_request=yes vendor/bin/phpunit --configuration tests/phpunit_default.xml
insideKaraka
or openhttp://127.0.0.1/Install
for a web install without dummy data.
After the installation you'll have access to the following content:
- Application:
http://127.0.0.1
- Code Coverage:
http://127.0.0.1/tests/coverage/
During this process the database automatically gets dropped (if it exists) and re-created. If you don't have
xdebug
installed butphpdbg
you can replacephp phpunit ...
withphpdbg -qrr phpunit.phar ...
or usepcov
for much faster code coverage generation.
If you are interest on working on the c++ code base you will in addition need the following tools and libraries: