2020-11-26 22:21:55 +00:00
< h1 align = "center" >
< br >
< a href = "http://hubl.world" > < img src = "https://cdn.startinblox.com/logos/hubl-logo.png" alt = "Hubl" width = "200" > < / a >
< br >
< / h1 >
2021-02-22 20:27:58 +00:00
< h4 align = "center" > A magic orchestrator that allows the Freelance Network to thrive in a decentralized way, built on top of < a href = "https://startinblox.com/" target = "_blank" > Startin'blox< / a > .< / h4 >
2020-11-26 22:21:55 +00:00
< hr >
2018-09-28 19:24:25 +00:00
2020-12-09 19:48:14 +00:00
< p align = "center" >
< a href = "https://git.startinblox.com/management/product-owners-sync/issues/" > < img alt = "create a feature request" src = "https://img.shields.io/badge/%2B-feature%20request-blue" / > < / a >
< a href = "https://git.startinblox.com/applications/hubl/issues/" > < img alt = "create an issue" src = "https://img.shields.io/badge/%2B-issue-orange" / > < / a >
< a href = "https://git.startinblox.com/applications/hubl/commits/master" > < img alt = "pipeline status" src = "https://git.startinblox.com/applications/hubl/badges/master/pipeline.svg" / > < / a >
< / p >
2020-12-09 19:43:44 +00:00
2019-04-29 12:46:13 +00:00
## Getting Started
2018-11-14 12:50:38 +00:00
2019-12-02 14:22:25 +00:00
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.
2018-11-14 12:50:38 +00:00
2019-04-29 12:46:13 +00:00
### Prerequisites
2018-11-14 12:50:38 +00:00
2020-05-08 13:27:44 +00:00
To install Hubl, you'll need:
2018-11-14 12:50:38 +00:00
2021-02-22 20:27:58 +00:00
* A [Hubl Server ](https://git.startinblox.com/djangoldp-packages/server-manager/ ) (djangoldp>2)
* A [Prosody Server ](https://prosody.im/ ) (with [appropriate modules ](https://git.startinblox.com/infra/prosody-modules/ )) (optional)
2019-12-02 14:22:25 +00:00
* A SMTP Server (optional)
* NodeJS on your machine
2018-11-14 12:50:38 +00:00
2020-05-08 13:27:44 +00:00
Before diving in you have to check your Hubl Server supports the following LDP packages:
2018-11-14 12:50:38 +00:00
2020-03-14 16:17:27 +00:00
* djangoldp_account
2020-05-08 13:27:44 +00:00
* djangoldp_uploader
2021-02-22 20:27:58 +00:00
* an oidc_provider (eg: [django-webidoidc-provider ](https://git.startinblox.com/djangoldp-packages/django-webidoidc-provider ))
2018-11-14 12:50:38 +00:00
2019-11-14 18:29:14 +00:00
Those packages are given with the last stable version tested.
2018-11-14 12:50:38 +00:00
2021-02-22 20:27:58 +00:00
Refer to the [documentation to install a Hubl Server ](https://docs.startinblox.com/import_documentation/install-djangoldp-server.html ) with this configuration.
2019-04-29 12:46:13 +00:00
2019-11-14 18:29:14 +00:00
## Build the application
In order to find your server(s) the client application needs to be assembled with the proper configuration.
2019-04-29 12:46:13 +00:00
2020-05-08 13:27:44 +00:00
Get the code of the Hubl on your machine:
2019-12-02 14:22:25 +00:00
```bash
git clone ...
2020-05-08 13:27:44 +00:00
cd hubl
2020-05-04 12:09:39 +00:00
npm install
2019-04-29 12:46:13 +00:00
```
2020-04-01 10:12:55 +00:00
Then create a `config.json` based on your needs, see Mandatory and Optional Modules on this page. For convienence a `config.sample.json` exists in the source.
2020-02-03 13:39:14 +00:00
2020-05-08 13:27:44 +00:00
Then build your new Hubl:
2019-12-02 14:22:25 +00:00
```bash
npm run build
2019-11-14 18:29:14 +00:00
```
2019-04-29 12:46:13 +00:00
2019-11-14 18:29:14 +00:00
The application bundle is in the `dist` folder, ready to be deployed everywhere as a static file.
2019-04-29 12:46:13 +00:00
2019-12-02 14:22:25 +00:00
## Developpers
Serve, watch files & rebuild on change with this command:
```bash
npm run watch
```
2021-02-22 20:27:58 +00:00
Notice that you may have to restart the watcher for the config.json and for locales files.
2020-12-14 10:24:35 +00:00
### Multiple config.json
You can have as many `config.*.json` as you need.
Watch on a custom config file:
```bash
CONFIG_PATH='config.customName.json' npm run watch
```
Build with a custom config file:
```bash
CONFIG_PATH='config.customName.json' npm run build
```
2020-04-01 10:12:55 +00:00
## Mandatory modules
2020-05-08 13:27:44 +00:00
By default, a Hubl includes only individual chat modules.
2020-04-01 10:12:55 +00:00
2021-02-22 20:27:58 +00:00
On Server: `djangoldp_account` , `djangoldp_upload` , `django-webidoidc-provider` packages
2020-04-01 10:12:55 +00:00
2020-06-18 18:02:54 +00:00
On `config.json` :
2020-04-01 10:12:55 +00:00
```json
{
2021-02-22 20:27:58 +00:00
"client": {
"name": "Localhost",
"logo": "/images/logo.webp"
2020-04-01 10:12:55 +00:00
}
2021-02-22 20:27:58 +00:00
"components": []
2020-04-01 10:12:55 +00:00
}
```
Where:
2021-02-22 20:27:58 +00:00
* `client.name` is the name of your Hubl
* `client.logo` is an URL to an image file
* `components` is your modules declaration registry
2020-04-01 10:12:55 +00:00
2021-02-22 20:27:58 +00:00
### Optional personalisation
2020-10-13 16:21:57 +00:00
2021-02-22 20:27:58 +00:00
On `config.json` :
2020-10-13 16:21:57 +00:00
2021-02-22 20:27:58 +00:00
```json
{
"client": {
"favicon": "/images/favicon.webp",
"css": "/path/to/custom.css",
}
}
2020-10-13 16:21:57 +00:00
```
2021-02-22 20:27:58 +00:00
Where:
2020-10-13 16:21:57 +00:00
2021-02-22 20:27:58 +00:00
* `client.avicon` is an URL to a distant favicon
* `client.css` is an URL to a distant CSS that'll be the last one loaded by the Hubl
2021-02-17 17:40:12 +00:00
2021-02-22 20:27:58 +00:00
### Allow to login to your application
2020-04-01 10:12:55 +00:00
2021-02-22 20:27:58 +00:00
Most of other modules will need to have an user logged in, if you want to use communities, then scroll back to the User Registration module, else you'll need to activate the Auto Login module:
2020-04-01 10:12:55 +00:00
```json
2021-02-22 20:27:58 +00:00
{
"type": "autoLogin",
"parameters": {
"authority": "http://server.url/"
}
}
2020-04-01 10:12:55 +00:00
```
Where:
2021-02-22 20:27:58 +00:00
* `authority` is the OpenID Provider. Usually, if you use `djangoldp_account` it's the same as your djangoldp server.
2020-04-01 10:12:55 +00:00
## Optional modules
2021-02-22 20:27:58 +00:00
### Adding modules
You can append any module listed bellow to your `components` entry on your `config.json`
Eg. to add the `notification` module:
```json
{
"components": [
{
"type": "notification",
"route": false
}
]
}
```
### About
About is a short page about the technology behind Hubl.
To activate about on Hubl, add this module declaration your `config.json` :
```json
{
"type": "about",
"route": false
}
```
### Administration
Administration is a minimal modulable admin module for all other ones.
To activate administration on Hubl, add this module declaration your `config.json` :
```json
{
"type": "admin",
"route": false
}
```
2020-05-08 13:27:44 +00:00
### Analytics
Hubl support Google or Matomo as analytics trackers. To use them, add to your `config.json` :
```json
{
2021-02-22 20:27:58 +00:00
"type": "analytics",
"parameters": {
"type": "matomo",
"url": "https://my-personal.matomo.cloud/",
"id": "1"
},
"route": false
2020-05-08 13:27:44 +00:00
}
```
2020-04-01 10:12:55 +00:00
### Circles
2021-02-22 20:27:58 +00:00
Circles define group of users that can chat & share documents togethers.
2020-04-01 10:12:55 +00:00
2021-02-22 20:27:58 +00:00
Community module is mandatory.
2020-04-01 10:12:55 +00:00
2021-02-22 20:27:58 +00:00
To activate them, you need:
On Server: `djangoldp_circle` , `djangoldp_communities` , `djangoldp_notifications` packages
Module declaration, on `config.json` :
2020-04-01 10:12:55 +00:00
```json
2021-02-22 20:27:58 +00:00
{
"type": "circles",
"endpoints": {
"get": "http://server.url/circles/",
"post": "http://server.url/circles/",
"owners": "http://server.url/users/",
"users": "http://server.url/users/",
"xmpp": "wss://xmpp-dev.startinblox.com/xmpp-websocket"
}
}
```
Where:
* `owners` : is your users container which contains valid owners
* `users` : is your users container
* `xmpp` is your [Prosody ](https://prosody.im/ ) with [appropriate modules ](https://git.startinblox.com/infra/prosody-modules/ ) configured on.
#### Circles extensions
You can extend circles with other components, the same way you would add them to your modules.
Actually it support: Events, Resources & Polls.
Eg.:
```json
{
"type": "circles",
"endpoints": {
"get": "http://server.url/circles/",
"post": "http://server.url/circles/",
"owners": "http://server.url/users/",
"users": "http://server.url/users/",
"xmpp": "wss://xmpp-dev.startinblox.com/xmpp-websocket"
},
"extensions": [
{
"type": "events",
"endpoints": {
"get": "http://server.url/events/",
"post": "http://server.url/events/",
"typeevents": "http://server.url/typeevents/",
"postTypeevents": "http://server.url/typeevents/"
}
}
]
}
```
### Communities
Communities are an optional layer to add on an Hubl. They add a SOLID representation of one to many group of users on your data server.
If you're upgrading an existion Hubl, you can assign all your local users to a community this way:
```bash
./manage.py create_community --name="My community"
```
Don't forget to set some users as admin of the community from the Django Admin if you want to allow them to create new users from app.
To activate community on Hubl, add this module declaration your `config.json` :
```json
{
"type": "communities",
"route": false
}
2020-04-01 10:12:55 +00:00
```
2020-05-08 13:27:44 +00:00
### Dashboard
Dashboard includes card generation from HTML. To activate them, you need:
On Server: `djangoldp_dashboard` packages
2021-02-22 20:27:58 +00:00
Module declaration, on `config.json` :
2020-05-08 13:27:44 +00:00
```json
2021-02-22 20:27:58 +00:00
{
"type": "dashboard",
"endpoints": {
"get": "http://server.url/dashboards/"
}
2020-12-14 10:24:35 +00:00
}
2020-05-08 13:27:44 +00:00
```
2020-11-26 22:21:55 +00:00
A [sample fixture ](https://git.startinblox.com/djangoldp-packages/djangoldp-dashboard/blob/master/djangoldp_dashboard/fixtures/sample.json ) can be loaded with `./manage.py loaddata sample` .
2021-02-22 20:27:58 +00:00
You can have multiple dashboard module, see the [related documentation ](https://git.startinblox.com/components/solid-dashboard#having-multiple-dashboard ).
### Events
The events module includes a listing of upcoming events and the capability to create new ones.
To activate it, you need:
On Server: `djangoldp_event` packages
Module declaration, on `config.json` :
```json
{
"type": "events",
"endpoints": {
"get": "http://server.url/events/",
"post": "http://server.url/events/",
"typeevents": "http://server.url/typeevents/",
"postTypeevents": "http://server.url/typeevents/"
}
}
```
You can get only future events by using:
```json
"get": "http://server.url/events/future/",
```
2020-11-26 22:21:55 +00:00
### Job Offers
2021-02-22 20:27:58 +00:00
Job Offers includes a job board with conversation. To activate them
Community module is mandatory.
You'll need:
2020-11-26 22:21:55 +00:00
On Server: `djangoldp_joboffer` , `djangoldp_skill` , `djangoldp_upload` , `djangoldp_conversation` packages
2021-02-22 20:27:58 +00:00
Module declaration, on `config.json` :
2020-11-26 22:21:55 +00:00
```json
2021-02-22 20:27:58 +00:00
{
"type": "jobBoard",
"endpoints": {
"get": "http://server.url/job-offers/",
"post": "http://server.url/job-offers/",
"skills": "http://server.url/skills/"
}
2020-12-14 10:24:35 +00:00
}
2020-11-26 22:21:55 +00:00
```
2020-05-27 06:44:54 +00:00
2021-02-22 20:27:58 +00:00
### Notifications
2020-04-01 10:12:55 +00:00
2021-02-22 20:27:58 +00:00
The notification module adds a bell with user's notification list and a badge on each menus with how much notifications are related to this resource. You'll need:
2020-04-01 10:12:55 +00:00
2021-02-22 20:27:58 +00:00
On Server: `djangoldp_notifications` packages
2020-04-01 10:12:55 +00:00
2020-05-08 13:27:44 +00:00
On `config.json` :
2020-04-01 10:12:55 +00:00
```json
2021-02-22 20:27:58 +00:00
{
"type": "notification",
"route": false
2020-12-14 10:24:35 +00:00
}
2020-04-01 10:12:55 +00:00
```
2021-02-22 20:27:58 +00:00
### One-to-one chat
2020-04-01 10:12:55 +00:00
2021-02-22 20:27:58 +00:00
One-to-one chat allow your users to chat together on a private channel.
2020-04-01 10:12:55 +00:00
2021-02-22 20:27:58 +00:00
Community & User Directory modules are mandatory.
2020-05-08 13:27:44 +00:00
2021-02-22 20:27:58 +00:00
You'll need:
Module declaration, on `config.json` :
2020-04-01 10:12:55 +00:00
```json
2021-02-22 20:27:58 +00:00
{
"type": "chat",
"endpoints": {
"xmpp": "wss://xmpp-dev.startinblox.com/xmpp-websocket"
}
}
2020-04-01 10:12:55 +00:00
```
2021-02-22 20:27:58 +00:00
Where:
2020-04-01 10:12:55 +00:00
2021-02-22 20:27:58 +00:00
* `xmpp` is your [Prosody ](https://prosody.im/ ) with [appropriate modules ](https://git.startinblox.com/infra/prosody-modules/ ) configured on.
2020-08-31 21:27:07 +00:00
2021-02-22 20:27:58 +00:00
### Polls
2020-08-31 21:27:07 +00:00
2021-02-22 20:27:58 +00:00
The polls module allows user to create polls. To activate it, you need:
On Server: `djangoldp_polls` , `djangoldp_conversation` packages
2020-08-31 21:27:07 +00:00
On `config.json` :
```json
2021-02-22 20:27:58 +00:00
{
"type": "polls",
"endpoints": {
"get": "http://server.url/polls/",
"post": "http://server.url/polls/"
}
2020-12-14 10:24:35 +00:00
}
2020-08-31 21:27:07 +00:00
```
2021-02-22 20:27:58 +00:00
### Project
Project are a private group chat including Customer and Business Provider management.
Community module is mandatory.
To activate them, you need:
On Server: `djangoldp_project` packages
Module declaration, on `config.json` :
2021-02-12 10:57:15 +00:00
```json
2021-02-22 20:27:58 +00:00
{
"type": "projects",
"endpoints": {
"get": "http://server.url/projects/",
"post": "http://server.url/projects/",
"captains": "http://server.url/users/",
"xmpp": "wss://xmpp-dev.startinblox.com/xmpp-websocket"
}
2021-02-12 10:57:15 +00:00
}
```
2021-02-22 20:27:58 +00:00
Where:
* `captains` : is your users container which contains valid captains
* `xmpp` is your [Prosody ](https://prosody.im/ ) with [appropriate modules ](https://git.startinblox.com/infra/prosody-modules/ ) configured on.
2020-08-31 21:27:07 +00:00
### Resources
2021-02-22 20:27:58 +00:00
The resources module includes a listing of indexed resources and the capability to index new ones.
2020-08-31 21:27:07 +00:00
To activate it, you need:
2021-02-22 20:27:58 +00:00
On Server: `djangoldp_resource` , `djangoldp_conversation` packages
2020-08-31 21:27:07 +00:00
2021-02-22 20:27:58 +00:00
Module declaration, on `config.json` :
2020-08-31 21:27:07 +00:00
```json
2021-02-22 20:27:58 +00:00
{
2021-02-23 11:22:34 +00:00
"type": "resources",
2021-02-22 20:27:58 +00:00
"endpoints": {
"get": "http://server.url/resources/",
"post": "http://server.url/resources/",
"types": "http://server.url/keywords/",
"keywords": "http://server.url/types/",
"postTypes": "http://server.url/keywords/",
"postKeywords": "http://server.url/types/"
}
2020-12-14 10:24:35 +00:00
}
2020-08-31 21:27:07 +00:00
```
2021-02-22 20:27:58 +00:00
### User registration
2020-08-31 21:27:07 +00:00
2021-02-22 20:27:58 +00:00
The user registration module allows users to self-register.
2020-08-31 21:27:07 +00:00
2021-02-22 20:27:58 +00:00
Community module is mandatory.
2020-08-31 21:27:07 +00:00
2021-02-22 20:27:58 +00:00
If you set `allow_self_registration` on a community, it'll disable the auto-login feature of Hubl and allow your users to self register on your application.
To activate it, you need:
Module declaration, on `config.json` :
2020-08-31 21:27:07 +00:00
```json
2021-02-22 20:27:58 +00:00
{
"type": "registering",
"parameters": {
"authority": "http://server.url/",
"authorityName": "your-authority-indentifier"
},
"endpoints": {
"get": "http://server.url/open-communities/"
}
2020-12-14 10:24:35 +00:00
}
2020-08-31 21:27:07 +00:00
```
2021-02-22 20:27:58 +00:00
Where:
2020-05-19 13:13:30 +00:00
2021-02-22 20:27:58 +00:00
* `authority` is the OpenID Provider. Usually, if you use `djangoldp_account` it's the same as your djangoldp server.
* `authorityName` is a visual name of your OpenID Provider
2020-05-19 13:13:30 +00:00
2021-02-22 20:27:58 +00:00
### Theme checker
2020-05-19 13:13:30 +00:00
2021-02-22 20:27:58 +00:00
The [Hubl theme manager ](https://cdn.startinblox.com/hubl/theme/ ) is very handy for customer to easily customize the main colors they want to use.
But developers should verify that their development use those colors to fit the customer wishes.
Module declaration, on `config.json` :
```json
{
"type": "themeChecker",
"route": false
}
2020-05-19 13:13:30 +00:00
```
2021-02-22 20:27:58 +00:00
Then you'll find the color picker tool in the header bar.
2020-05-19 13:13:30 +00:00
2021-02-22 20:27:58 +00:00
Changing the color will set them on the whole app so that you can verify that your development take them into account correctly.
### Users Directory
Directory includes a listing of each users of your app and editable individual profile. To activate them, you need:
On Server: `djangoldp_skill` packages
Community module is mandatory.
Module declaration, on `config.json` :
```json
{
"type": "profileDirectory",
"endpoints": {
"get": "http://server.url/users/",
"skills": "http://server.url/skills/",
"uploads": "http://server.url/upload/"
}
}
2020-05-19 13:13:30 +00:00
```
2021-02-22 20:27:58 +00:00
### Route generation
2020-05-19 13:13:30 +00:00
2021-02-22 20:27:58 +00:00
Hubl will, by default, generate an unique route for every of your module. You can customize this route by setting a `route` attribute on your module declaration.
Eg. for the Users Directory:
```json
{
"type": "profileDirectory",
"endpoints": {
"get": "http://server.url/users/",
"skills": "http://server.url/skills/",
"uploads": "http://server.url/upload/"
},
"route": "directory"
}
2020-05-19 13:13:30 +00:00
```
2021-02-22 20:27:58 +00:00
Will lead to `http://client.url/directory` as URL to reach the module instead of the default `http://client.url/profileDirectory` .
If you provide no `route` , then Hubl will use the `type` as route view name. If two modules share the same `route` , they'll get suffixed with a random unique id.
Some module don't need any route to be active, set `route` to `false` so.
Components can get the route of a module with `window.hubl.getRoute('componentName')` .
2020-05-19 13:13:30 +00:00
2020-11-26 22:21:55 +00:00
## Troubleshooting
### Circles or Projects are missing the @user list
Did you properly created subscriptions on your DjangoLDP's server? You can quickly create them with `./manage.py create_subscriptions`
2019-11-14 18:29:14 +00:00
## Built With
2020-12-14 10:24:35 +00:00
* [Sib-Core ](https://git.startinblox.com/framework/sib-core/ ) - A SOLID-Compliant framework