hubl/README.md

367 lines
9.7 KiB
Markdown
Raw Normal View History

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>
<h4 align="center">A magic tool 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>
<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
2020-11-24 11:32:17 +00:00
* A [Hubl Server](https://git.startinblox.com/djangoldp-packages/server-manager/) (djangoldp>1)
* A [Prosody Server](https://prosody.im/) (with [appropriate modules](https://git.startinblox.com/infra/prosody-modules/))
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-10-13 16:21:57 +00:00
* djangoldp_community
2020-03-14 16:17:27 +00:00
* djangoldp_notification
* djangoldp_profile
* djangoldp_skill
2020-05-08 13:27:44 +00:00
* djangoldp_uploader
2020-11-24 11:32:17 +00:00
* oidc_provider: django-webidoidc-provider
2018-11-14 12:50:38 +00:00
Those packages are given with the last stable version tested.
2018-11-14 12:50:38 +00:00
2020-11-24 11:32:17 +00:00
Refer to the [documentation to install a Hubl Server](https://docs.startinblox.com/import_documentation/install-sib-server.html) with this configuration.
2019-04-29 12:46:13 +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
```
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-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-04-29 12:46:13 +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
```
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
```
### Theme checker
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. The theme checker make this task easier :
just add `"themeChecker": true` to the config.json to display the color picker tool in the header bar. Changing the color will set them on the
whole app so that you can verify that your development take them into account correctly.
## Mandatory modules
2020-05-08 13:27:44 +00:00
By default, a Hubl includes only individual chat modules.
2020-05-08 13:27:44 +00:00
On Server: `djangoldp_account`, `djangoldp_profile`, `djangoldp_notification`, `djangoldp_skill`, `djangoldp_upload`, `oidc_provider` packages
2020-06-18 18:02:54 +00:00
On `config.json`:
```json
{
2020-11-26 22:21:55 +00:00
"xmppWebsocket": "wss://jabber.happy-dev.fr/xmpp-websocket",
2020-11-24 11:32:17 +00:00
"clientName": "My local Hubl",
"clientLogo": "/images/logo.webp",
"authority": "http://localhost:8000/",
"endpoints": {
2020-12-14 10:24:35 +00:00
"get": {
"skills": "http://server.url/skills/",
"users": "http://server.url/users/"
},
"post": {
"uploads": "http://server.url/upload/"
}
}
}
```
Where:
2020-11-24 11:32:17 +00:00
* `clientName` is the name of your Hubl
* `clientLogo` is an URL to an image file
2020-11-26 22:21:55 +00:00
* `xmppWebsocket` is your [Prosody](https://prosody.im/) with [appropriate modules](https://git.startinblox.com/infra/prosody-modules/) configured on.
* `authority` is the OpenID Provider. Usually, if you use `djangoldp-account` it's the same as your djangoldp server.
2020-12-14 10:24:35 +00:00
* `endpoints.*.users` is the API endpoints for Users on your djangoldp server. (djangoldp-account)
* `endpoints.*.skills` is the API endpoints for Skills on your djangoldp server. (djangoldp-skill)
* `endpoints.*.uploads` is the API endpoints for Uploads on your djangoldp server. (djangoldp-upload)
2020-10-13 16:21:57 +00:00
### Communities
Communities are mandatory to have an Hubl. 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 from the Django Admin if you want to allow them to create new users from app.
### Optional personalisation
On `config.json`:
```json
2020-11-17 15:40:30 +00:00
"clientFavicon": "/images/favicon.webp",
"clientLogoHeight": "32px",
"clientCSS": "/path/to/custom.css",
"authorityName": "djangoldp-server-name"
```
Where:
2020-05-08 13:27:44 +00:00
* `clientFavicon` is an URL to a distant favicon
* `clientLogoHeight` allow a quick fix to manage different height logos
2020-05-08 13:27:44 +00:00
* `clientCSS` is an URL to a distant CSS that'll be the last one loaded by the Hubl
* `authorityName` is a visual name of your OpenID Provider
## Optional modules
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
"analytics": [
{
"type": "matomo", //Or "google"
"url": "https://my-personal.matomo.cloud/",
"id": "1"
}
]
```
### Circles
Circles are a public group chat. To activate them, you need:
On Server: `djangoldp_circle` packages
2020-05-08 13:27:44 +00:00
On `config.json`:
```json
"endpoints": {
2020-12-14 10:24:35 +00:00
"get": {
"circle": "http://server.url/circles/"
},
"post": {
"circle": "http://server.url/circles/"
},
}
```
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
On `config.json`:
```json
"endpoints": {
2020-12-14 10:24:35 +00:00
"get": {
"dashboard": "http://server.url/dashboard/"
}
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`.
### Job Offers
Job Offers includes a job board with conversation. To activate them, you need:
On Server: `djangoldp_joboffer`, `djangoldp_skill`, `djangoldp_upload`, `djangoldp_conversation` packages
On `config.json`:
```json
"endpoints": {
2020-12-14 10:24:35 +00:00
"get": {
"joboffers": "http://server.url/job-offers/"
}
2020-11-26 22:21:55 +00:00
}
```
2020-05-27 06:44:54 +00:00
### Project
2020-06-18 18:02:54 +00:00
Project are a private group chat including Customer and Business Provider management. To activate them, you need:
On Server: `djangoldp_project` packages
2020-05-08 13:27:44 +00:00
On `config.json`:
```json
"endpoints": {
2020-12-14 10:24:35 +00:00
"get": {
"projects": "http://server.url/projects/"
},
"post": {
"projects": "http://server.url/projects/"
}
}
```
### Users Directory
2020-06-18 18:02:54 +00:00
Directory includes a listing of each users of your app and editable individual profile. To activate them, you need:
2020-05-08 13:27:44 +00:00
On Server: `djangoldp_skill`, `djangoldp_upload` packages
On `config.json`:
```json
2020-12-14 10:24:35 +00:00
"publicDirectory": true
```
2020-11-26 22:21:55 +00:00
## Optional community modules
2020-08-31 21:27:07 +00:00
### Events
The events module includes a listing of upcoming events and the capability to create new ones.
This module will also work inside the circles.
To activate it, you need:
On Server: `djangoldp_event`, `djangoldp_upload` packages
On `config.json`:
```json
"endpoints": {
2020-12-14 10:24:35 +00:00
"get": {
"events":"http://server.url/events/",
"typeevents":"http://server.url/typeevents/"
},
"post": {
"events":"http://server.url/events/",
"typeevents":"http://server.url/typeevents/"
}
2020-08-31 21:27:07 +00:00
}
```
### Resources
The resources module includes a listing of indexed resources and the capability to index new ones.
This module will also work inside the circles.
To activate it, you need:
On Server: `djangoldp_resource`, `djangoldp_upload`, `djangoldp_conversation` packages
On `config.json`:
```json
"endpoints": {
2020-12-14 10:24:35 +00:00
"get": {
"resources":"http://server.url/resources/",
"resourceskeywords":"http://server.url/keywords/",
"resourcestypes":"http://server.url/types/"
},
"post": {
"resources":"http://server.url/resources/",
"resourceskeywords":"http://server.url/keywords/",
"resourcestypes":"http://server.url/types/"
}
2020-08-31 21:27:07 +00:00
}
```
### Polls
The polls module allows user to create polls related (or not) to circles. To activate it, you need:
On Server: `djangoldp_polls`, `djangoldp_upload`, `djangoldp_conversation` packages
On `config.json`:
```json
"endpoints": {
2020-12-14 10:24:35 +00:00
"get": {
"polls":"http://server.url/polls/"
},
"post": {
"polls":"http://server.url/polls/"
}
2020-08-31 21:27:07 +00:00
}
```
2020-05-19 13:13:30 +00:00
## Use with docker
### Multi services
Run with a local binding on localhost:
```bash
docker-compose build
docker-compose up -d client server
```
Use in CI context:
```bash
docker-compose -f docker-compose.yml build
docker-compose -f docker-compose.yml up -d client server
docker-compose -f docker-compose.yml run --rm e2e
```
Build and push the server to registry:
```bash
docker build -f docker/djangoldp.docker --build-arg serve="http://localhost:8000" -t registry.startinblox.com/applications/hubl/server:0.1 .
docker push registry.startinblox.com/applications/hubl/server:0.1
```
Note: within a Kubernetes pod all services are bound to `localhost`.
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`
## Built With
2020-12-14 10:24:35 +00:00
* [Sib-Core](https://git.startinblox.com/framework/sib-core/) - A SOLID-Compliant framework