www.hubleto.eu Reddit User Guide Stack Overflow LinkedIn Report an issue

First external Hubleto app

External Hubleto apps are published as git repositories (either public/private github or on your git server).

They can be reused using composer require.

Install Hubleto

You will need Hubleto installation to test your app.

  1. cd /var/www/html/hubleto
  2. composer create-project hubleto/install . --stability=dev
  3. npm install & npm run build
  4. php hubleto init

Now your Hubleto should be available through some localhost address. We will use http://localhost/hubleto as an example.

Prepare app's repository

Create empty git repository for your app. No matter where but in this example we will use github.

Prepare app's scaffolding

Following steps guide you through preparation of the minimal set of files. Final folders and files should look followingly:

~/hubleto/your-app-name
├─ src/               # app's functionality
│  ├─ Loader.php      # backend entry point
│  └─ manifest.yaml   # app identification
├─ composer.json      # description of your package for composer
├─ .gitignore         # counts for badges and alerts
└─ README.md          # short description of your app
  1. Clone your empty app's repository to any folder you want

Note: We will use ~/hubleto/your-app-name as the home folder of your app.

  1. Add composer.json, replace vendor name and app name
{
    "name": "your-vendor-name/your-app-name",
    "description": "My First External Hubleto App",
    "autoload": {
        "psr-4": {
            "Hubleto\\App\\External\\YourVendorName\\YourAppName\\": "src"
        }
    },
    "minimum-stability": "dev"
}
  1. Add .gitignore
.vscode
vendor
composer.lock
package-lock.json
  1. Add README.md
# You App Name
Describe your app here.
  1. Add app's src/manifest.yaml
namespace: Hubleto\App\External\YourVendorName\YourAppName
appType: external
monthlyPricePerUser: 10
sidebarGroup: sales
rootUrlSlug: your-app-name
name: Your App Name
highlight: One-sentence description of your app
icon: fas fa-puzzle-piece
  1. Add app's minimal src/Loader.php
<?php
namespace Hubleto\App\External\YourVendorName\YourAppName;
class Loader extends \Hubleto\Erp\App { }

Install local app into Hubleto

Now you need to link your app with your Hubleto installation so that each change in your app will be immediately reflected in your Hubleto.

  1. Go to your Hubleto folder

cd /var/www/html/hubleto

  1. Modify composer.json to use your local app's repository
...
    "require": {
        "your-vendor-name/your-app-name": "dev-main"
    },
    "repositories": [{
        "type": "vcs",
        "url": "~/hubleto/your-app-name/"
    }],
...
  1. Add the local app into your Hubleto
composer update
  1. Install the app into Hubleto
php hubleto app install Hubleto\App\External\YourVendorName\YourAppName

Test it

Navigate to http://localhost/hubleto and if you see your app in the left sidebar, you are ready to build the app.