Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/127 integrate docs into main repo & changed to docusaurus #131

Merged
merged 53 commits into from
May 7, 2024
Merged
Show file tree
Hide file tree
Changes from 49 commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
ea2993d
first steps on the way to docusaurus
LukBelter Feb 27, 2024
7c6e78f
just got it working
LukBelter Mar 12, 2024
616ae1d
now with all files added
LukBelter Mar 12, 2024
3deafe9
Merge branch 'dev' into feature/127-integrate-docs-into-main-repo
LukBelter Mar 12, 2024
cb66b49
don't test my docs
LukBelter Mar 12, 2024
ab492ea
an other change
LukBelter Mar 12, 2024
96d65e9
....
LukBelter Mar 12, 2024
6f9e237
do not test the docs
LukBelter Mar 12, 2024
d6d19c7
?
LukBelter Mar 12, 2024
cac46fd
??
LukBelter Mar 12, 2024
2f14080
no tests for .github or docs
LukBelter Mar 19, 2024
20e5b16
no tests for .github or docs
LukBelter Mar 19, 2024
b3e575c
no tests for .github or docs
LukBelter Mar 19, 2024
e83d918
no tests for .github or docs
LukBelter Mar 19, 2024
9b77e6d
no tests for .github or docs
LukBelter Mar 19, 2024
c93f009
no tests for .github or docs
LukBelter Mar 19, 2024
63b56e9
no tests for .github or docs
LukBelter Mar 19, 2024
8ce2258
no tests for .github or docs
LukBelter Mar 19, 2024
97ead31
no tests for .github or docs
LukBelter Mar 19, 2024
696d120
no tests for .github or docs
LukBelter Mar 19, 2024
f6173b7
no tests for .github or docs
LukBelter Mar 19, 2024
546e60e
no tests for .github or docs
LukBelter Mar 19, 2024
0fc8372
no tests for .github or docs
LukBelter Mar 19, 2024
5a0bc10
no tests for .github or docs
LukBelter Mar 19, 2024
b85d8fe
no tests for .github or docs
LukBelter Mar 19, 2024
3a9b3e9
changes to push
LukBelter Mar 19, 2024
420bc51
changes to push
LukBelter Mar 19, 2024
bed3afc
cleaning up some code
LukBelter Mar 19, 2024
35e8bf8
last changes on tuesday
LukBelter Mar 21, 2024
db11a64
Merge dev into feature/127-integrate-docs-into-main-repo
github-actions[bot] Mar 24, 2024
443e342
Merge dev into feature/127-integrate-docs-into-main-repo
github-actions[bot] Mar 24, 2024
77f74e0
Merge dev into feature/127-integrate-docs-into-main-repo
github-actions[bot] Mar 26, 2024
9c1612b
Merge dev into feature/127-integrate-docs-into-main-repo
github-actions[bot] Mar 26, 2024
1b4799c
added copywrite footer, privicy, imprint & Logo
LukBelter Mar 26, 2024
f7678ee
Merge branch 'feature/127-integrate-docs-into-main-repo' of https://g…
LukBelter Mar 26, 2024
f4ffd76
Merge dev into feature/127-integrate-docs-into-main-repo
github-actions[bot] Apr 1, 2024
284cad8
now with searchbar
LukBelter Apr 11, 2024
961d09e
Merge branch 'feature/127-integrate-docs-into-main-repo' of https://g…
LukBelter Apr 11, 2024
e45544c
cleaning up workflow
LukBelter Apr 11, 2024
587a808
echo needed?
LukBelter Apr 11, 2024
a772615
upgrade to docusaurus 3.2.1
LukBelter Apr 11, 2024
bf4948d
Merge branch 'dev' into feature/127-integrate-docs-into-main-repo
LukBelter Apr 11, 2024
00f5046
run update
LukBelter Apr 11, 2024
3bb5e2d
Merge branch 'feature/127-integrate-docs-into-main-repo' of https://g…
LukBelter Apr 11, 2024
b0b15bf
changing the README & cleaning up
LukBelter Apr 30, 2024
e7f559a
added ai images on the start page
LukBelter Apr 30, 2024
7998db2
aading the images
LukBelter Apr 30, 2024
c8b1f0c
cleaning up docusaurus imgs
LukBelter Apr 30, 2024
fd1cc42
enableing edit this page
LukBelter Apr 30, 2024
b774a8a
less test more other
LukBelter May 7, 2024
09a1972
Update .github/workflows/build-and-test.yml
LukBelter May 7, 2024
37d6edc
changed to -ne
LukBelter May 7, 2024
7b3942a
Merge branch 'feature/127-integrate-docs-into-main-repo' of https://g…
LukBelter May 7, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 46 additions & 5 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,51 @@ on:
types: [opened, synchronize, reopened, ready_for_review]

jobs:
build:
name: "Build"
timeout-minutes: 10
check:
name: "Check"

if: github.event.pull_request.draft == false

runs-on: ubuntu-latest
outputs:
worth_testing: ${{ steps.check.outputs.worth_testing }}

steps:
- name: "Checkout Branch"
uses: actions/checkout@v3

- name: "Check for changes worth testing"
id: check
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
changed_files=$(gh pr diff --name-only ${{ github.event.pull_request.number }})

test=false
for file in $changed_files; do
if [[ $file == ".github/"* || $file == "doc/"* ]]; then
echo "$test file: $file"
else
test=true
echo "$test file: $file"
break
fi
done
if [[ $test == true ]]; then
echo "worth_testing=true" >> "$GITHUB_OUTPUT"
else
echo "worth_testing=false" >> "$GITHUB_OUTPUT"
fi
DivineThreepwood marked this conversation as resolved.
Show resolved Hide resolved


build:
name: "Build"
timeout-minutes: 10
needs: check
if: |
(github.event.pull_request.draft == false)
&& (needs.check.outputs.worth_testing == true)

runs-on: ubuntu-latest

steps:
Expand Down Expand Up @@ -50,9 +89,10 @@ jobs:
test:
name: "Test"
timeout-minutes: 120

if: github.event.pull_request.draft == false
needs: build
if: |
(github.event.pull_request.draft == false)
&& (needs.check.outputs.worth_testing == true)
LukBelter marked this conversation as resolved.
Show resolved Hide resolved

runs-on: ubuntu-latest

Expand Down Expand Up @@ -85,3 +125,4 @@ jobs:
with:
name: Test Reports
path: "**/build/reports"

20 changes: 20 additions & 0 deletions doc/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Dependencies
/node_modules

# Production
/build

# Generated files
.docusaurus
.cache-loader

# Misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local

npm-debug.log*
yarn-debug.log*
yarn-error.log*
33 changes: 33 additions & 0 deletions doc/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Website

This website is built using [Docusaurus](https://docusaurus.io/), a modern static website generator.

### Installation

```
$ pnpm install
```

### Local Development

```
$ pnpm start
```

This command starts a local development server and opens up a browser window. Most changes are reflected live without having to restart the server.

### Build

```
$ pnpm build
```

This command generates static content into the `build` directory and can be served using any static contents hosting service.

```
$ pnpm serve
```

:::info INFO
For the search to work locally, the website must be built using `pnpm build`
:::
3 changes: 3 additions & 0 deletions doc/babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
presets: [require.resolve('@docusaurus/core/lib/babel/preset')],
};
48 changes: 48 additions & 0 deletions doc/docs/developer/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
---
---

# Developer Section

## Table Of Contents

* [Developer Installation Guide](installation.md)
* [System Startup and Tools](startup-tools.md)
* [Directory Structure](directory-structure.md)
* [Architecture](architecture.md)
* [Authentication](authentication/README.md)
* Contribution
* [How To Contribute](contribution.md)
* [Code Examples](code-examples.md)
* [User Interfaces](ui/README.md)
* [BCozy](ui/bcozy.md): 2D Environment Control Map
* [BComfy](ui/bcomfy.md): Augmented Reality Android App
* Developer Interfaces
* [BCO Registry Editor](ui/bco-registry-editor.md): Tool to introspect, add, register and delete units, templates and class entries.
* [BCO Stage](https://www.techfak.uni-bielefeld.de/csra/nightly/components/pointing_smart_control.html): 3D Environment Visualization
* [BCO Visual Remote](ui/bco-visual-remote.md): Generic control interface to access all services of a unit.
* [BCO Action Inspector](ui/bco-action-inspector.md): Used to make the current action - responsibilities visible.
* Addons
* [PSC - Pointing Smart Control](addon/bco-psc.md): Control your environment via pointing gestures.
* [BCO Cloud](addon/bco-cloud.md): The bco cloud acts as gateway for third party integrations.
* [BCO Persistence](addon/bco-persistence.md): Addon to store the history of all service state changes.
* [BCO Ontology](addon/bco-ontology.md): The ontology is a fully synchronized semantic representation of the smart environment state.
* [Eveson - Event Sonification](addon/bco-eveson.md): An auditive display of your smart environment.
* [Dependencies](dependencies.md)

## Research Platforms

### Cognitive Service Robotics Apartment

* [Project Summary](https://www.cit-ec.de/en/csra)
* [Project Details](https://cit-ec.de/de/cognitive-service-robotics-apartment-ambient-host)
* [Documentation](http://www.techfak.uni-bielefeld.de/techfak/csra)
* [BCO Setup Description](http://www.techfak.uni-bielefeld.de/techfak/csra/nightly/components/bco.html)

:::info INFO
Your research project is using Base Cube One but not listed here?
We would love to know all details about it and support you during your development.
Please [contact us](https://openbase.org/contact/) to get in touch.
:::



9 changes: 9 additions & 0 deletions doc/docs/developer/_category_.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"label": "Developer",
"position": 2,
"collapsible": true,
"collapsed": true,
"link": {
"type": "doc", "id": "README"
}
}
72 changes: 72 additions & 0 deletions doc/docs/developer/addon/bco-api-graphql.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
# BCO GraphQL API

[Source Code](https://github.com/openbase/bco.api.graphql)

## Bonjour Service Advertising

Service Name ```bco-api-graphql```

## Default Settings
* Suffix: ```graphql```
* Port: ```13781```
* Example Endpoint: ```http://localhost:13781/graphql```

## Supported Queries
* `login(username: String!, passwordHash: String!): String` - Retrieve an authentication token (see [Authorization Header](#supported-headers))
* Default admin base64 password hash: `R+gZ+PFuauhav8rRVa3XlWXXSEyi5BcdrbeXLEY3tDQ=`
* Checkout [how to generate the password hash on client side](#how-to-generate-the-password-hash-on-client-side) for more details.
* `verifyToken(token: String): Boolean`

## Supported Mutations
* `changePassword(username: String!, oldPassword: String!, newPassword: String!): Boolean` - Note: the return value will always be true since an exception is thrown if changing the password fails.
* `updateLabel(unitId: String, label: String): Label` - Update the label of a unit. Note: this will update the first label considering the current language code which can be provided with the [Accept-Language Header](#supported-headers).
* `updateLocation(unitId: String, locationId: String): PlacementConfig` - Update the location of a unit.
* `updateFloorPlan(locationId: String, shape: Shape): Shape` - Clear the floor list of the current location and replace it with the list in the provided shape. Note: the rejoiner framework does not allow passing lists as arguments so you have to provide a complete shape from which only the floor list is considered.
* `updatePose(unitId: String, pose: Pose): Pose` - Replace the pose of a unit.
* `registerUnitConfig(unitConfig: UnitConfig): UnitConfig` - Register a new unit.
* `removeUnitConfig(unitId: String): UnitConfig` - Remove a unit by its id.
* `updateUnitConfig(unitConfig: UnitConfig): UnitConfig` - Update a unit config. Note: the values of the provided unit config will be merged into the current one (retrieved through the provided id). This means that all values which are lists will just be appended to the current list.
* `updateMetaConfig(unitId: String, entry: Entry): MetaConfig` - Update an entry in the toplevel meta config of a unit config.

## Supported Headers
The GraphQL API Server will process the following HTTP headers on requests:

* **Authorization Header**:
The `authorization` header can be used to authenticate your client at BCO.
Just send the token received through a [login query](#supported-queries) as the value of the authorization header with your requests.
If this header is not supplied, your actions will be performed with other permissions.

* **Accept-Language Header**:
If you set the `accept-language` header to a language code, the GraphQL API will resolve all multi language strings (eg. labels and descriptions) according to this language.
On queries the text matching the language code are returned and on mutations the values matching your language code are modified.
It this header is not set, the default of the server running the GraphQL API is used.

## How to generate the password hash on client side

The `passwordHash` needs to be generated as follows:
1. Encoding the plain text password as `UTF16`
2. Compute a hash of the `UTF16` bytes by using the `SHA-256` hash generator algorithm
3. Encode the result as `Base64` and pass it to the login method as `passwordHash`.

Dart Example:
```dart
final hashedPassword = base64.encode(
sha256.convert(
encodeUtf16(plainPassword)
).bytes);
```
Java Example:
```java
final String hashedPassword = Base64.getEncoder()
.encodeToString(
EncryptionHelper.hash("plainPassword")
);
```
## Used Tools

1. [GraphQL](https://graphql.org/)
* API Framework
2. [Rejoiner](https://rejoiner.io/)
* Protobuffer type integration
4. [Bonjour Service](https://github.com/jmdns/jmdns)
* Advertising and discovery of the graphql service within the local network
24 changes: 24 additions & 0 deletions doc/docs/developer/addon/bco-cloud.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# BCO Cloud

![Cloud Architecture](/img/bco/cloud/BCOCloudArchitecture.svg)

## Cloud Server

:::note TODO
Write documentation
:::

[Source Code](https://github.com/openbase/bco.cloud)

## Cloud Connector

:::note TODO
Write documentation
:::

[Source Code](https://github.com/openbase/bco.app/tree/master/cloudconnector)

## Access heroku cloud log
1. Install [heroku CLI](https://devcenter.heroku.com/articles/heroku-cli)
2. Login with CLI: ```heroku login```
3. View logs: ```heroku logs -a bco-cloud``` or ```heroku logs -a bco-cloud --tail```
26 changes: 26 additions & 0 deletions doc/docs/developer/addon/bco-eveson.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
---
---
# BCO Eveson

In smart environments, a myriad of sensors and processing components produce a very large amount of data every second. We implemented the framework Eveson which supports the monitoring through the generation of pleasant ambient soundscapes based on such complex data streams.

![LocationGraphStructure](/img/bco/eveson/EvesonLogo.jpg)

Eveson supports the individual selection of data streams and types and the configuration of how they should be sonified. The bundle of all data to sound mappings is stored in a theme configuration. For your prototype we especially selected only sounds of one natural environment (the German forest) to generate a familiar soundscape for the user.

## Repository

[Github: openbase/bco.eveson](https://github.com/openbase/bco.eveson)

## How to Start the Application

Since Eveson is a part of the default distribution of bco, you can simply start Eveson by executing:
```
bco-eveson
```

for more details checkout:

```
bco-eveson --help
```
5 changes: 5 additions & 0 deletions doc/docs/developer/addon/bco-ontology.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# BCO Ontology

![Control Example On](/img/bco/bco-ontology.svg)

[Source Code](https://github.com/openbase/bco.ontology)
Loading
Loading