Download

Configurations

All application configurations are located in the app/config directory. Configuration files are PHP scripts that return an associative array. Each file describes a separate logical area of settings (for example, application settings, database settings, etc.).

All configuration files are merged into a single array $API::$configs.

Top-level keys must be unique. In the event of key collisions, the configuration loaded last takes precedence.

For example:


// db.php

return [
    "db" => [..]
];

// app.php

return [
    "timezone" => "UTC"
];

$API::$configs = [
    "db" => [..],
    "timezone" => "UTC"
];

Why not .env?

return [ .. ]; is often more convenient, as it allows nested structures to be stored without additional abstractions.

Configuration Structure

Each configuration file must return an array:


return [
    "setting_key": "setting_value"
];

Configurations may contain nested structures without depth limitations.

Example:


return [
    "db" => [
        "host" => "mysql",
        "user" => "root",
        "password" => "root",
        "name" => "sample_db"
    ]
];

Accessing Configuration

After loading the configuration, values are accessed via the global storage:


$API::$configs[ "db" ][ "host" ];
$API::$configs[ "default_lang" ];
$API::$configs[ "paths" ][ "app_actions" ];

Required Configurations

DB

Database connection configuration. Defines MySQL connection parameters: host, user, password, and database name. It is used by the framework core to initialise the database connection.


return [
    "db" => [
        "host" => "mysql",
        "user" => "root",
        "password" => "root",
        "name" => "sample_db"
    ]
];

host

The database host address or hostname (for example `mysql`, `127.0.0.1`, or a database server domain name).

user

The database username used for the connection.

password

The database user password.

name

The name of the database to connect to.

App

Main application configuration. Defines global behaviour parameters of the SaaS system, including interface settings, localisation, timezone, and security parameters.


return [
    "admin_url" => "localhost",
    "default_lang" => "en",
    "phone_formats" => [ "en" ],
    "timezone" => "America/Los_Angeles",
    "jwt_key" => "GK8VSb4TnWP8VXjD"
];

* [!] `jwt_key` must be unique for each project and must not be exposed in public repositories.

admin_url

The base URL of the application's administrative panel. Used for link generation and routing within the admin interface.

default_lang

The default application language (locale code, e.g. `en`, `fr`, `ro`). Used when no user or system preference is available.

phone_formats

A list of supported phone number formats by language/region. Used for validation and formatting of phone numbers.

timezone

The application timezone in IANA format (e.g. `America/Los_Angeles`). Used for all date and time operations.

jwt_key

Secret key used for signing JWT tokens. Used by the authentication and authorisation system.

System Configurations

Paths

Central system path configuration. Defines absolute paths to key framework and application directories. Used as a single source of truth for file structure handling, module loading, schemas, and resources.

The paths configuration is generated automatically by the framework core and does not require manual editing.

All paths are grouped under the `paths` section.


$API::$configs[ "paths" ][ "app_action_schemes" ];
  • root — project root directory. The base reference point for all other paths.
  • framework — framework core directory (framework layer) containing system logic and core mechanisms.
  • app — application directory containing business logic and SaaS extensions.
  • system_app — system part of the application (service components managed or generated by the framework).
  • uploads — base directory for uploaded files.
  • subscriber_uploads — upload directory tied to a specific application subscriber (isolated user file storage).

Actions

  • core_actions — path to framework core actions (add, update, remove, etc.).
  • system_actions — system framework actions (administration, service operations, schema management).
  • app_actions — application-specific business logic actions.

Schemas (System)

  • system_db_schemes — default system database schemas.
  • system_action_schemes — system action schemas.
  • system_object_schemes — system object schemas.
  • system_page_schemes — system page schemas.

Schemas (Application)

  • app_db_schemes — application database schemas.
  • app_action_schemes — application action schemas.
  • app_object_schemes — application object schemas.
  • app_page_schemes — application page schemas.