Merge branch 'feature/matomo' into 'release/profile-directory'

update: add Matomo and Google analytics + Rewrite readme for a complete configuration

See merge request applications/sib-app!123
This commit is contained in:
Jean-Baptiste Pasquier 2020-04-01 10:13:36 +00:00
commit 74dfec5a5e
4 changed files with 149 additions and 17 deletions

149
README.md
View File

@ -1,6 +1,6 @@
# SiB App
SiB App is the magic tool that allows the Happy Dev network to thrive in a decentralized way.
SiB App is the magic tool that allows the Freelance Network to thrive in a decentralized way.
## Getting Started
@ -10,7 +10,7 @@ These instructions will get you a copy of the project up and running on your loc
To install SiB App, you'll need:
* A SIB server (djangoldp>=0.6.32) with the appropriate modules
* A SIB server (djangoldp>=0.6.41) with the appropriate modules
* A Prosody Server (with [appropriate modules](https://git.happy-dev.fr/startinblox/prosody/custom-prosody-modules/)
* A SMTP Server (optional)
* NodeJS on your machine
@ -19,6 +19,7 @@ Before diving in you have to check your SIB server supports the following LDP pa
* djangoldp_account
* djangoldp_circle
* djangoldp_dashboard
* djangoldp_joboffer
* djangoldp_conversation
* djangoldp_notification
@ -29,7 +30,7 @@ Before diving in you have to check your SIB server supports the following LDP pa
Those packages are given with the last stable version tested.
Refer to the [documentation to install a SIB server](https://git.happy-dev.fr/startinblox/devops/doc/wikis/install_sib_server) with this configuration.
Refer to the [documentation to install a SIB server](https://git.startinblox.com/documentation/doc/wikis/devops/install_sib_server) with this configuration.
## Build the application
@ -41,17 +42,7 @@ Get the code of the SIB app on your machine:
git clone ...
```
Then create a `config.json` based on your needs. [The documentation](https://git.happy-dev.fr/startinblox/devops/doc/wikis/build_sib_application) explains the details of this file but for convienence a `config.sample.json` exists in the source.
Current Sib App capabilities:
| Component | Required server packages | Required endpoints |
| - | - | - |
| Base | `djangoldp_account`, `djangoldp_profile`, `djangoldp_notification`, `oidc_provider` | `users` |
| Circles | `djangoldp_circle` | `circles` |
| Directory | `djangoldp_account` and `djangoldp_profile` | `users` + `publicDirectory` set to `true` |
| Events | `djangoldp_event` | `events`, `typeevents`, `uploads` |
| Projects | `djangoldp_project` | `projects`, `customers` |
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.
Federated Sib App needs to use `config.sample.federated.json` example.
@ -76,6 +67,136 @@ Serve, watch files & rebuild on change with this command:
npm run watch
```
## Mandatory modules
By default, a SIB App includes only individual chat modules.
On Server: `djangoldp_account`, `djangoldp_profile`, `djangoldp_notification`, `oidc_provider` packages
On `config.json`:
```json
{
"xmpp": "https://jabber.happy-dev.fr/http-bind/",
"authority": "http://localhost:8000/",
"endpoints": {
"users": "http://server.url/users/"
}
}
```
Where:
* `xmpp` is your Prosody with [appropriate modules](https://git.happy-dev.fr/startinblox/prosody/custom-prosody-modules/) configured on.
* `authority` is the OpenID Provider. Usually, if you use `djangoldp-account` it's the same as your djangoldp server.
* `endpoints.users` is the API endpoints for Users on your djangoldp server.
### Optional personalisation
On `config.json`:
```json
"clientName": "Sib App",
"clientLogo": "/images/logo.png",
"clientLogoHeight": "32px",
"clientCSS": "/path/to/custom.css",
"authorityName": "djangoldp-server-name"
```
Where:
* `clientName` is the name of your SIB App.
* `clientLogo` is an URL to a distant logo for your client
* `clientLogoHeight` allow a quick fix to manage different height logos
* `clientCSS` is an URL to a distant CSS that'll be the last one loaded by the SIB App
* `authorityName` is a visual name of your OpenID Provider
## Optional modules
### Circles
Circles are a public group chat. To activate them, you need:
On Server: `djangoldp_circle` packages
On `config.json`:
```json
"endpoints": {
"circle": "http://server.url/circles/"
}
```
### Events
Events allow to create and manage instance-level evenement. To activate them, you need:
On Server: `djangoldp_event` and `djangoldp_upload` packages
On `config.json`:
```json
"publicDirectory": true
```
### Project
(Experimental) Project are a private group chat including Customer and Business Provider management. To activate them, you need:
On Server: `djangoldp_project` packages
On `config.json`:
```json
"endpoints": {
"projects": "http://server.url/projects/",
"customers": "http://server.url/customers/",
"businessproviders": "http://server.url/businessproviders/",
"skills": "http://server.url/skills/"
}
```
### Users Directory
(In development) Directory includes a listing of each users of your app and editable individual profile. To activate them, you need:
On `config.json`:
```json
"endpoints": {
"projects": "http://server.url/projects/",
"customers": "http://server.url/customers/",
"businessproviders": "http://server.url/businessproviders/",
"skills": "http://server.url/skills/"
}
```
### Dashboard
(In development) Dashboard includes card generation from HTML. To activate them, you need:
On `config.json`:
```json
"endpoints": {
"dashboard": "http://server.url/dashboard/"
}
```
### Analytics
SIB App 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"
}
]
```
## Built With
* [Sib-Core](https://git.happy-dev.fr/startinblox/framework/sib-core/) - An awesome new framework!

View File

@ -26,5 +26,6 @@
"users": "http://localhost:8000/users/",
"uploads": "http://localhost:8000/upload/"
}
}
},
"analytics": []
}

View File

@ -15,5 +15,6 @@
"typeevents": "http://localhost:8000/typeevents/",
"users": "http://localhost:8000/users/",
"uploads": "http://localhost:8000/upload/"
}
},
"analytics": []
}

View File

@ -44,3 +44,12 @@ html(lang="en")
#admin(hidden).with-sidebar
include page-admin.pug
if analytics
each provider in analytics
if provider.type && provider.url && provider.url
sib-analytics(
type=`${provider.type}`
url=`${provider.url}`
id=`${provider.id}`
)