DreamFactory Documentation
repository·master·Indexed 23 days ago
https://github.com/dreamfactorysoftware/dreamfactoryA 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.
What's inside DreamFactory
- 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.
Key Features of DreamFactory
masterDreamFactory 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.
Use DreamFactory as an MCP Server for AI
masterDreamFactory 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.
How DreamFactory generates REST APIs
masterDreamFactory 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.
Install DreamFactory on Windows
masterFor Windows installations using IIS or Apache, follow the official step-by-step guide: Windows Installation Guide.Enable Simba Trino ODBC support
masterTo enable Simba Trino ODBC, select the option when prompted during installation. This requires you to provide the driver and license files manually.
Steps:
- Obtain the Simba Trino ODBC driver package (e.g.,
.debor.rpm) and theSimbaTrinoODBCDriver.liclicense file from your vendor. - Upload both files to your server (e.g., to
/tmp). - During installation, provide the absolute path to the driver package (e.g.,
/tmp/SimbaTrinoODBC-2.0.0.1000-Debian-64bit.deb). - 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/.- Obtain the Simba Trino ODBC driver package (e.g.,
Install DreamFactory using Docker
masterThe fastest way to get started is using Docker Compose. This setup spins up DreamFactory, MySQL, Redis, and a sample PostgreSQL database.
git clone https://github.com/dreamfactorysoftware/df-docker.git cd df-docker docker compose up -dEnable IBM DB2 support
masterTo enable IBM DB2 support, select option
2during installation. This installs the PHPibm_db2/pdo_ibmextension.Prerequisites:
- Register for a free account with IBM.
- Download the "IBM Data Server Driver Package (Linux AMD64 and Intel EM64T)" file (
ibm_data_server_driver_package_linuxx64_v11.5.tar.gz). - Do not unzip the file. Upload it to your server and note its absolute path to provide during the installation prompt.
Upgrade to a Commercial DreamFactory version
masterThe installer supports upgrading an OSS instance to a commercial version using Composer files.
Process:
- During installation, when asked
Would you like to upgrade your instance? [Yy/Nn], enterYory. - Provide the absolute path to the directory containing your commercial license files.
- Required Files: The directory must contain
composer.json,composer.lock, andcomposer.json-dist. If any are missing, the upgrade is skipped. - Provide your commercial license key when prompted. Failure to provide the key will cause the upgrade to fail.
- During installation, when asked
Deploy DreamFactory to Kubernetes via Helm
masterUse the official DreamFactory Helm chart to deploy the platform to your Kubernetes cluster.
helm repo add dreamfactory https://dreamfactorysoftware.github.io/df-helm helm install dreamfactory dreamfactory/dreamfactoryConfigure DreamFactory PHP module on Ubuntu
masterTo 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.- Copy
dreamfactory.inifromconfig/external/php/etc/php5/mods-availableto/etc/php5/mods-available/. - Enable the module:
sudo php5enmod dreamfactory. - Restart your web server (e.g., Apache or Nginx).
- Copy
Configure Nginx on CentOS or RedHat
masterFor CentOS and RedHat systems, use the provided configuration files fromconfig/external/nginx/and adapt them to match the virtual-host setup typical of those operating systems.