The hub can be divided in 4 parts:
- Authentication: defines the rights of the user to manage data
- The data storage: where the data persists
- The exchange of data: in charge of synchronizing the current data with the incoming one
- The web server: appart of managing data, the hub contains a web server, useful for providing a web graphical interface of the system
Authentication
By default, there are two types of user in SpinalHub, and one user of each type. The type 0 has rights to read and write any data in the hub, while the type 1 can only read data. You can change the passwords of these users by passing them as arguments when executing the hub (see more in the following section). Once the hub is launched, it prints all the information about the users. You can also see this information by accessing the following URL, as long as the hub is running: http://localhost:8889. In the organs of your system, you should connect to the hub using the login credentials according to the type of operations you need to perform on the data. Data storage
When launching SpinalHub, a new folder named memory is created in the same directory from where it is launched. Inside it, there is a file called dump.db, which will contain all the structured data of the system, and a folder data.db, for the external uploaded files (images, pdf, etc). As long as the folder memory exists, and it’s on the same path of the hub, the data will persist across the different running instances of SpinalHub. Data exchangeSpinalHub listens on different ports, mainly with the purpose of synchronizing the stored data with incoming data from the organs. These are: - Http (by default 8888): Listens for requests made from the organs using SpinalCoreJS connectors. Also used by the web server.
- Binary stream (over TCP/IP) (by default 8890): Listens for requests made from the organs using SpinalCoreQt connectors.
- Monitoring (by default 8889): HTTP port used by an administration panel, still in development.
For information about changing the default ports, check the command line documentation about arguments. Web serverSpinalHub will look by default for a folder named html relative to its execution path, and use it as a web root directory, in the HTTP port configured (by default 8888). This can be used for creating a graphical web interface for the users to interact with the system from a computer or mobile phone. For information about changing the name of the folder, check the command line documentation about arguments. |