Developer Guide
This guide describes the process for creating and deploying new, standalone application setups.
1. Multi-App Setups: Branding & Initialization
The application can be configured to behave like a standalone solution (e.g., "INtex Inventory"). This is controlled via constants in config.php and a corresponding setup folder.
1.1. Creating Setups in config.php
Open the config.php file. Here you can define different setups. A setup consists of a block of constants. Activate a setup by removing the comment characters (//) in front of the corresponding block.
Example of a setup:
// Example: INtex Inventory
define('SETUP_NAME', 'INtex Inventory');
define('SETUP_FOLDER', 'setup_inventar');
define('SETUP_LEARN_MORE_URL', 'https://www.inventory-pc.com');
define('SETUP_SHOP_URL', 'https://www.intex-publishing.de/cms/shop/bestellformular.php?produkt=inventar');
SETUP_NAME: The name of the application, which is displayed in various places.SETUP_FOLDER: The name of the folder in the root directory that contains the setup-specific files.SETUP_LEARN_MORE_URL: The link for the "Learn More" button.SETUP_SHOP_URL: The link to the shop.
1.2. Creating Setup Folders
In the application's root directory, create a folder with the same name as the value of SETUP_FOLDER (e.g., setup_inventar). This folder contains:
banner.jpg: An image (ideally 1200x800 pixels) that is displayed as the background on the login and registration pages. This is the primary branding element.initialisierung.php: A PHP script that is executed once when a user of a new team logs in for the first time. This script is crucial for preparing the application for the team. A typical task is to copy template tables into the new team's namespace.setup_style.css(optional): A CSS file that is automatically loaded on all pages. You can define application-specific styles here to customize the appearance. This is ideal for styling field values with a custom design (e.g.,span[data-field-value-for="city"] { ... }).
2. Creating a New Application (Workflow)
The following workflow describes the steps for creating the content for a new setup.
-
Create Template Tables: Use the administration panel (
Table Definition) to create the necessary tables. Mark all tables that should be copied for each new customer (each team) with the "Mark as template" option. -
Create Standard Tables: Create tables that are not customer-specific (e.g., a postal code database) and ensure that the "Mark as template" option is disabled.
-
Maintain Value Lists: Populate the
value_listswith the default values needed for dropdown fields in the template tables. -
Create Analyses & Views: Create charts, saved views (lists), and, if necessary, complex SQL queries based on the template tables.
-
Actions & Automation: Create custom buttons and events to implement workflows.
Links to Detailed Documentation
The programming and configuration of the individual modules are described in detail in their respective guides:
- Field Types and Their Options
- Programming Custom Buttons
- Programming Custom Events
- REST API Documentation
- Custom Field Styling with CSS
3. Deploying a New Application
Once the development of the setup is complete, follow these steps for deployment.
Step 1: Backup SQL Data
Export the relevant configuration and template data from your development database. Use a tool like phpMyAdmin or Adminer for this. The exported data should be saved as INSERT statements.
Important tables to export:
custom_tables(contains all table definitions)custom_fields(contains all field definitions)custom_views,charts,custom_queries,custom_buttons,custom_events(as needed)value_lists(contains the default value lists)user_groupsanduser_rights(for the default rights configuration)
The data from the template tables themselves (e.g., from data_team_...) does not need to be exported, as it will be created for new teams by the initialisierung.php script.
Step 2: Copy PHP Files
Copy the entire PHP application folder to the target server.
Step 3: Post-Deployment Cleanup
- Clean up
config.php: Remove all commented-out setup blocks so that only the final setup is active. - Clean up Setup Folders: Delete all
setup_*folders that do not belong to the final setup. - Import Database: Import the SQL file created in Step 1 into the production database.
- Remove Test Data: Delete all test users, test teams, and their corresponding
data_team_*tables from the production database that were created during development. - Change Secret Key: Adjust the value of the
INVITE_SECRET_KEYconstant inconfig.phpto ensure the security of invitation links.
After these steps, the new application is ready for use.