There are two main options for installing Dropinbase.
Note, Dropinbase can also be installed on Shared Hosting Servers
Docker is similar to a virtual machine, but is more efficient regarding resource use. Windows, Linux and macOS are supported.
Using Docker has the advantage of a pre-configured Dropinbase setup that works "out of the box" and does not conflict with any existing applications.
Note for Windows users: Docker is supported for only specific versions of Windows.
npm install dropinbase -g [Enter]
- this installs the Dropinbase package globallycd c:/projects/www
- change to the directory of where the project must be installeddropinbase init myProject
- create a new Dropinbase Client project with a name of your choice
Set-ExecutionPolicy -ExecutionPolicy Unrestricted -Scope Process
cd myProject
- change to the directory of the project you just creatednpm start
- connect to the Dropinbase Docker container and start the services.
https://localhost
.http://myapp.dib/nav/dibLoginForm?primary_id=1
The following steps should lead to a stable system. If any errors occur, see Troubleshooting Installation.
http://myapp.dib
)
composer install -vvv[Enter]
(the -vvv option prints detailed debugging information should you need it).require './installer.php'; die();
http://myapp.dib/
CREATE DATABASE IF NOT EXISTS `my_new_dib_database` DEFAULT CHARACTER SET = 'utf8mb4' DEFAULT COLLATE 'utf8mb4_unicode_520_ci';
CREATE USER 'my_dib_user'@'localhost' IDENTIFIED BY 'my_password';
GRANT SELECT, ALTER, CREATE, CREATE TEMPORARY TABLES, DELETE, INDEX, INSERT, UPDATE ON `my_new_dib_database`.* TO 'my_dib_user'@'localhost';
FLUSH PRIVILEGES;
use my_new_dib_database;
at the top: /vendor/dropinbase/dropinbase/installer/dropinbase.sql.http://myapp.dib
http://myapp.dib/nav/dibLoginForm?primary_id=1
A working Dropinbase installation requires the following to be in place:
NOTE: The Dropinbase Installer requires write permissions on the /projectFolder itself to overwrite the index.php file to comment out the line that runs the Installer.php file. If it fails it must be manually done.
On development machines, the webserver user (eg www-data) needs read/write permissions to files in the following folders, and all their subfolders:
On production servers all folders should be set to read-only, except the /runtime and user folders (eg DIB::$USERSPATH).
Use the chown and chmod commands to set ownership and file permissions, eg:
Folders: assign read and execute permissions on all folders to the owner (yourlinuxuser) and the group (webserver user). Execute permissions are needed to enter folders. Ensure these permissions are set on all folders, including the /vendor/dropinbase/dropinbase sub-folders:
Files: assign read and write to the owner (yourlinuxuser), and just read to the group (webserver user)
Assign read/write permissions to the following folders (-R sets it recursively for subfolders):
Assign read/write permissions to folders where Angular generates code (must be set to 750 on production server if all dibCode files exist)
Assign read/write permissions to folders where users upload files (if applicable):
node -v
in a terminal window.Note, this only affects the ability to create/change containers. Dropinbase should start up without Angular being installed.
This step is not necessary if you are installing the Dropinbase Docker container.
NPM (above) is required to install Angular.
Run the following commands in a terminal window (eg PowerShell on Windows):
cd /www/myProject/vendor/dropinbase/dropinbase/dropins/setNgxMaterial/angular
ls
(or dir
on Windows) on to list files and folders. If the node_modules folder or the package-lock.json file exists, delete them:
rm -rf ./node_modules
(or rmdir /s /q node_modules
on Windows)rm -rf ./package-lock.json
npm install
npm audit fix --force
This step is not necessary if you are installing the Dropinbase Docker container.
The Watcher is a Dropinbase script that runs in the background and watches for any Dropinbase containers to compile.
It speeds up the compilation process by avoiding the boostrapping process which runs otherwise each time.
The Watcher should start automatically, but if it doesn't, run the following commands in a terminal window:
cd /www/myProject/vendor/dropinbase/dropinbase/dropins/setNgxMaterial/angular
- replace /www/myProject with your own.npm run watch:modules
Note, remember to save files and restart Apache for changes to take effect!
The following Apache modules must be enabled:
If you are enabling the /vendor/dropinbase/dropinbase/installer/configs/.htaccess.for.production file, the following modules must be enabled which allows cache files to be zipped:
Adding entries to the virtual host file allows you to host multiple installations of Dropinbase applications on a machine, using a separate URL for each.
Example:
You have two Dropinbase projects, stored in the following two folders:
<VirtualHost *:80>
DocumentRoot "C:/wamp64/www/project1"
ServerName test.dib
<directory "C:/wamp64/www/project1">
Options -Indexes +FollowSymLinks
AllowOverride all
Require all granted
</directory>
</VirtualHost>
<VirtualHost *:80>
DocumentRoot "C:/wamp64/www/project2"
ServerName project2.dib
<directory "C:/wamp64/www/project2">
Options -Indexes +FollowSymLinks
AllowOverride all
Require all granted
</directory>
</VirtualHost>
To enable error logging for Apache, ensure the following line is uncommented/exists in httpd.conf (replace the path with your own):
ErrorLog "c:/wamp64/logs/apache_error.log"
It may be useful to log errors in Apache's log file for debugging purposes, but this file can become very large depending on the LogLevel parameter (see comments in httpd.conf).
Note, after applying a fix below, delete the /www/projectFolder/runtime folder before testing further.
cd /www/myProject
composer show --platform
// phpinfo(); die();
include_once("./installer.php"); die();
- line must be commented out.include_once("./vendor/dropinbase/dropinbase/index.php"); die();
- line must be active.These files host all the project's custom code, styling and configuration files.
A clean copy of the files can be downloaded from Github: https://github.com/Dropinbase/dibclient
A copy of the framework files can be downloaded by registering on the User Portal and then using the Installer.
The /dropinbase
folder is installed by default as a child folder of the main project folder which contains the Client Files. Its location can be set by using the $SYSTEMPATH
variable in the /configs/Dib.php
(or DibTmpl.php
) file. Remember to also adjust the path in the /index.php
file.
The webserver needs read access to it, and if containers will be generated/modified, then write access is required on the /dropinbase/dropins/setNgxMaterial/angular/ngtmp
folder (note the /angular
folder's location can be set using $ANGULARPATH
).
For a multi-tenant setup (where multiple Dropinbase client projects access the same Dropinbase framework files), you can also use a symbolic link (virtual folder) to reference a common location.
A SQL script to install the main Dropinbase database is available in the /dropinbase/installer
folder. The tables in this database contain the design of Dropinbase applications.
Note certain tables like pef_login
, pef_login_group
, pef_sqllog
, pef_audit_trail
, etc. can be moved to other databases (see the /configs/DibTmpl.php
file for more info).
The indexes used in the DIB::$DATABASES
array of the /secrets/Conn.php
file need to match the id
values of the pef_database
table.
The index for the main Dropinbase database must also match the $DIBDB
value in the /configs/Dib.php
(or DibTmpl.php
) file.
The Dropinbase database can be named anything as long as it matches the 'database'
value in the Conn.php
file.
At present the database must be hosted in a MySQL-compatible server (e.g., MySQL, MariaDB, AuroraDB, SkySQL). BETA testing for other servers is underway - you can use the Migrate tool in the main menu to migrate the database and help with testing.
Composer is a PHP package manager. It can be downloaded from: https://getcomposer.org/download/
Once installed on the system, use the following commands to install the packages listed in the /composer.json
file:
cd /www/myProjectFolder composer install
Composer creates a /vendor
folder to host the packages from the various third-party vendors.
Dropinbase will actually function without the vendor folder, but certain features will fail. If your project complains saying that 'autoload.php'
cannot be found, it normally is because the /vendor
folder does not exist.
Dropinbase will function without Node.js (and Angular) but it is required for compiling Angular files, i.e., for creating/modifying project containers (pages), etc.
It is important to install the correct version of Node.js, else the Angular compiler will not work. You can obtain the current version from the /dropinbase/README.md
file.
The recommended way of installing Node.js is by using an installer which can be used to easily swap between versions. For Windows, download it from:
https://github.com/coreybutler/nvm-windows
Then use the following commands:
nvm install 20.9.0 nvm use 20.9.0
NVM exists for Linux but it does not make Node globally available. Rather use n
: https://github.com/tj/n
Alternatively, Node.js can be installed by running an installer from https://nodejs.org/dist/v[VERSION]
e.g. https://nodejs.org/dist/v20.9.0
Use the following to confirm the active version:
node -v
Once Node.js is installed, the /node_modules
folder can be created. First remove it if it already exists:
cd /dropinbase/dropins/setNgxMaterial/angular rmdir /s /q node_modules (use rm -rf ./node_modules on Linux) del package-lock.json (use rm package-lock.json on Linux) npm install
Node.js installs NPM. NPM must be accessible and executable by PHP, under the account that runs the webserver.
You may need to adjust the open_basedir
setting in the php.ini
configuration file.
Dropinbase merges templates with database records to create TypeScript files. These files are then compiled to JavaScript (which the browser understands) using PHP's exec() function with the Angular CLI, eg exec("npx ngc -p ...");
Again, it is important to install the right version of Angular, which can be confirmed from the /dropinbase/README.md
file.
Use these commands to install version 17.3.9:
cd /dropinbase/dropins/setNgxMaterial/angular npm install -g @angular/cli@17.3.9
To verify the installation, use:
ng version or npx ng version