DreamFactory Documentation

repository·master·Indexed 23 days ago

https://github.com/dreamfactorysoftware/dreamfactory

A self-hosted enterprise data access platform that automatically generates governed REST APIs from SQL, NoSQL, and file storage data sources. Built on the Laravel framework, it provides role-based access control (RBAC), OpenAPI/Swagger documentation, and a built-in Model Context Protocol (MCP) server to securely connect AI models and LLMs to databases via structured API calls.

Tokens
5.2K
Snippets
10
Records
32
Agent score
83%

What's inside DreamFactory

  1. What is DreamFactory?

    master
    DreamFactory is a self-hosted enterprise data access platform that provides governed, role-based API access to any data source. It acts as a secure AI data gateway between your applications (or local LLMs) and your data sources. Built on the Laravel framework, it automates the creation of REST APIs from existing databases and services.
  2. Key Features of DreamFactory

    master

    DreamFactory provides several core capabilities for API management:

    API Generation

    • Automatic REST API creation for SQL and NoSQL databases.
    • OpenAPI/Swagger documentation generated for every endpoint.
    • Stored procedure and function support to expose database logic.
    • Related data retrieval (parent/child records) in single calls.
    • Built-in operations: Server-side filtering, sorting, pagination, and bulk operations (insert, update, delete).

    Security and Access Control

    • Role-based access control (RBAC): Granular permissions per table, endpoint, and HTTP verb.
    • API key management: Issue, revoke, and rate-limit keys per application.
    • SSO authentication: Supports SAML 2.0, OAuth 2.0, OpenID Connect, Azure AD, and LDAP/Active Directory.
    • Audit logging: Tracks every API call including user, timestamp, and payload.
    • Data masking: Field-level security to control column visibility per role.

    Extensibility

    • Server-side scripting: Customize API behavior using PHP, Python, or Node.js.
    • Event hooks: Use pre- and post-process scripts to transform requests/responses.
    • Custom services: Build and register your own API services.
    • Webhooks: Trigger external workflows on data changes.

    MCP Server (Model Context Protocol)

    • Built-in MCP server for connecting AI models (ChatGPT, Claude, local LLMs) to databases.
    • Deterministic queries: AI uses structured API calls instead of raw SQL generation.
    • Tool definitions: Exposes tables and stored procedures as MCP tools.
  3. Use DreamFactory as an MCP Server for AI

    master

    DreamFactory includes a built-in Model Context Protocol (MCP) server. This allows AI assistants (like Claude or ChatGPT) to interact with your databases through governed API endpoints.

    Instead of the AI generating raw SQL, it calls DreamFactory's structured REST API. This ensures that all AI-driven queries are subject to your configured role-based access control (RBAC) and audit logging.

  4. How DreamFactory generates REST APIs

    master

    DreamFactory automates API creation by connecting to your database and introspecting the schema (including tables, views, stored procedures, and relationships). It automatically generates a full set of REST endpoints with CRUD operations.

    Key characteristics:

    • No code generation required: APIs are available immediately after connection.
    • Documentation: Each endpoint is documented with an OpenAPI/Swagger specification.
    • Features: Supports filtering, sorting, pagination, bulk operations, and relationship handling.
    • Custom Logic: You can extend functionality by adding server-side scripting in PHP, Python, or Node.js.
  5. Enable Simba Trino ODBC support

    master

    To enable Simba Trino ODBC, select the option when prompted during installation. This requires you to provide the driver and license files manually.

    Steps:

    1. Obtain the Simba Trino ODBC driver package (e.g., .deb or .rpm) and the SimbaTrinoODBCDriver.lic license file from your vendor.
    2. Upload both files to your server (e.g., to /tmp).
    3. During installation, provide the absolute path to the driver package (e.g., /tmp/SimbaTrinoODBC-2.0.0.1000-Debian-64bit.deb).
    4. Provide the absolute path to the license file (e.g., /tmp/SimbaTrinoODBCDriver.lic).

    The installer will automatically move the license file to /opt/simba/trinoodbc/lib/64/.

  6. Enable IBM DB2 support

    master

    To enable IBM DB2 support, select option 2 during installation. This installs the PHP ibm_db2/pdo_ibm extension.

    Prerequisites:

    1. Register for a free account with IBM.
    2. Download the "IBM Data Server Driver Package (Linux AMD64 and Intel EM64T)" file (ibm_data_server_driver_package_linuxx64_v11.5.tar.gz).
    3. Do not unzip the file. Upload it to your server and note its absolute path to provide during the installation prompt.
  7. Upgrade to a Commercial DreamFactory version

    master

    The installer supports upgrading an OSS instance to a commercial version using Composer files.

    Process:

    1. During installation, when asked Would you like to upgrade your instance? [Yy/Nn], enter Y or y.
    2. Provide the absolute path to the directory containing your commercial license files.
    3. Required Files: The directory must contain composer.json, composer.lock, and composer.json-dist. If any are missing, the upgrade is skipped.
    4. Provide your commercial license key when prompted. Failure to provide the key will cause the upgrade to fail.
  8. Configure DreamFactory PHP module on Ubuntu

    master

    To enable the DreamFactory PHP extension on Ubuntu systems, you must copy the configuration file to the system's PHP modules directory, enable the module using php5enmod, and restart your web server.

    1. Copy dreamfactory.ini from config/external/php/etc/php5/mods-available to /etc/php5/mods-available/.
    2. Enable the module: sudo php5enmod dreamfactory.
    3. Restart your web server (e.g., Apache or Nginx).