External Database

Fruitask also offer BYOD (Bring your own database) if you have your own hosting and want to host all your data in a database and files.

Get Started

Select a workplace you want to use, then install the External Data from extension page

Your Database

We support only MySQL for now. We will keep working in other database structure, however you can still use with other database like NoSQL database since Fruitask is formatted with JSON structure.

Prepare your webhook

You need to provide GET webhook URL with your database credentials and other endpoints. Your webhook API should return this format

{
    "type": "remote", //default
    "dbname": "demo",
    "username": "user_demo",
    "port": 3306,
    "password": "admin1234",
    "location": "198.154.451", //Hosting IP address
    "timestamp": "2025-11-16 19:51:40",
    "disk_storage": "https://example.com/api/upload/",
    "gallery_url": "https://example.com/api/gallery/",
    "base_url": "https://example.com"
}

For security compliance, you can apply CORS Policy, only Fruitask can access the webhook API or add query params to your webhook URL with workplace token or your Fruitask API.

<?php
// Set the header to return JSON
header('Content-Type: application/json');

//Allow CORS policy for fruitask.com only
//Implement $_GET['token'] for extra authorization

// Example logic or data
$data = [
    'type' => 'remote',
    'dbname' => 'demo',
    'username' => 'user_demo',
    'port' => 3306, //make sure the port exist INBOUND
    'password' => 'admin1234', //this is user password permission
    'location' => '198.154.451', //ip or host domain
    'timestamp' => date('Y-m-d H:i:s'),
    'disk_storage' => 'https://example.com/api/upload/',
    'gallery_url' => 'https://example.com/api/gallery/',
    'base_url' => 'https://example.com'
];

// Return as JSON
echo json_encode($data, JSON_PRETTY_PRINT);

You also need to prepare an API endpoint for your files uploading. Since your data from Fruitask will be now saving to your remote database, all your files will do the same. It's allows you to control about allowed file types, sizes and feel secured since your keeping it in your disk storage.

Key
Description
Template PHP

disk_storage

Value should be a POST API endpoint for uploading files to your disk storage.

gallery_url

Value should be a GET API endpoint for returning your files from disk storage.

Setup Extension (External Data)

Once extension is installed to a workplace and your webhook data is ready, you can start testing it.

  1. Open a workplace (Where External Data extension installed)

  2. Go to Controls > Setting

  3. From Source Database, paste your webhook API - It will create a database and copy all data from Fruitask database to your own database.

And it's ready. You can try writing data to your workplace and it's now saving to your own database, also try to upload an attachment or file and it should be save to your own disk storage. Now you can do it to your other workplace and experienced BRING YOUR OWN DATABASE here in Fruitask.

Last updated