Getting Started
i-doit up can help you start, run, and grow your business. This guide helps you to understand which model matches the best your business model.
Init the project#
Let's first start your add-on project.
First, let's create the base of our new project:
1 2 3 4 | |
We have created the folder for our application. public will contain our public resources and defines the root of our web-server.
public/addon.json is a manifest file. This file describes the add-on and defines its functionalities and integrations.
Here is an example of the addon.json that you can copy to public/addon.json and adjust it according to your needs.
1 2 3 4 5 6 7 8 9 | |
Let's adjust the content in addon.json to describe your add-on:
author - is the name of your company.
title - name of your add-on.
description - informative description of the add-on.
identifier- is an identifier of the add-on. It has to contain only the letters, numbers, dashes and underscore (-, _).
vendor - is an identifier of your company. It has to contain only the letters, numbers, dashes and underscore (-, _).
The vendor and identifier pair is the unique identifier of your add-on.
version - current version of the add-on. The version is important for implementing update migrations.
Start the add-on server and install the add-on#
The add-on has to provide a web server.
i-doit up registers an add-on with by the URL and forwards the add-on's specific request to your add-on.
Here are some examples, how you can run the web server. You are free to use the technology you prefer.
Start server
PHP built-in Server
For development purpose, you can run the built-in PHP server using the following snippet1 | |
Node.js + Express
Init the node project:1 2 | |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | |
1 | |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | |
1 | |
In order to check that server returns correct result, open the http://127.0.0.1:9000/addon.json in browser. You should see the content of the addon.json file.
Now, we have the server running, so we can register the add-on in i-doit up.
In order to do it, you should open the terminal of your i-doit up instance and run the register command:
1 | |
As result, you should receive a success message:
1 | |
Tips to URL
The URL depends on your configuration. If you use docker installation of i-doit up, you might connect to the host system using:1 2 | |
Now we can log in into i-doit up and call the URL of the add-on: /a/your-company/myapp/addon.json. We should see the same content of addon.json file.
All the URLs starting with /a/your-company/myapp/ are forwarded to your add-on.