Skip to content

Commit

Permalink
Updating doc
Browse files Browse the repository at this point in the history
  • Loading branch information
akadlec committed Jun 4, 2021
1 parent 252aed0 commit d83beb3
Show file tree
Hide file tree
Showing 4 changed files with 168 additions and 6 deletions.
40 changes: 38 additions & 2 deletions .docs/en/index.md
Expand Up @@ -4,11 +4,13 @@ This module adds support for managing [FastyBird](https://www.fastybird.com) IoT

## Installation

### Backend

The best way to install **fastybird/devices-module** is using [Composer](https://getcomposer.org/).

> If you don't have Composer yet, [download it](https://getcomposer.org/download/) following the instructions.
#### Create new project
##### Create new project

If you don't have a project created yet you could start with Nette base project.

Expand All @@ -24,14 +26,28 @@ Everything required will be then installed in the provided folder.
cd path/to/install
```

#### Install module
##### Install module

Module could be added to your project with composer command:

```sh
composer require fastybird/devices-module
```

### Frontend

The best way to install **@fastybird/devices-module** is using [Yarn](https://yarnpkg.com/):

```sh
yarn add @fastybird/devices-module
```

or if you prefer npm:

```sh
npm install @fastybird/devices-module
```

## Configuration

This module is dependent on other Nette extensions. All this extensions have to enabled and configured in NEON configuration file.
Expand Down Expand Up @@ -62,3 +78,23 @@ your-console-entrypoint fb:web-server:start
```

After successful start, server is listening for incoming http api request messages from clients.

## Register Vuex ORM models

This module could be registered in your Vuex ORM instance

```js
import VuexORM, { Database } from '@vuex-orm/core'
import DevicesModule from '@fastybird/devices-module'

// Create new instance of Database
const database = new Database()

VuexORM.use(DevicesModule, { database })

export default {
plugins: [
VuexORM.install(database),
],
}
```
91 changes: 91 additions & 0 deletions .github/workflows/ci.yaml
Expand Up @@ -7,6 +7,8 @@ on:
push:
branches:
- "master"
tags:
- v*
schedule:
- cron: "0 8 * * 1" # At 08:00 on Monday

Expand Down Expand Up @@ -280,3 +282,92 @@ jobs:
run: |
wget https://github.com/php-coveralls/php-coveralls/releases/download/v2.1.0/php-coveralls.phar
php php-coveralls.phar --verbose --config tests/.coveralls.yml
publish-npmjs:
name: "Build library and publish it to NPM"
runs-on: "${{ matrix.operating-system }}"

strategy:
matrix:
operating-system: ["ubuntu-latest"]

if: github.event_name == 'push' && contains(github.ref, 'refs/tags/')

steps:
- name: "Checkout"
uses: "actions/checkout@v2"

- name: "Install node"
uses: "actions/setup-node@v1"
with:
node-version: "12"
registry-url: "https://registry.npmjs.org"

- name: "Extract version"
uses: "battila7/get-version-action@v2"
id: "get_version"

- name: "Install package dependencies"
run: yarn install

- name: "Set up git since we will later push to the repo"
run: |
git config --global user.name "GitHub CD bot"
git config --global user.email "code@fastybird.com"
- name: "Upgrade npm version in package.json to the tag used in the release"
run: npm version ${{ steps.get_version.outputs.version-without-v }} --allow-same-version

- name: "Build the project"
run: yarn build

- name: "Publish to NPM"
env:
NODE_AUTH_TOKEN: ${{ secrets.NPMJS_TOKEN }}
run: npm publish --access public

publish-github:
name: "Build library and publish it to Github packages"
runs-on: "${{ matrix.operating-system }}"
needs: ["publish-npmjs"]

strategy:
matrix:
operating-system: ["ubuntu-latest"]

if: github.event_name == 'push' && contains(github.ref, 'refs/tags/')

steps:
- name: "Checkout"
uses: "actions/checkout@v2"

- name: "Install node"
uses: "actions/setup-node@v1"
with:
node-version: "12"
registry-url: "https://npm.pkg.github.com"

- name: "Extract version"
uses: "battila7/get-version-action@v2"
id: "get_version"

- name: "Install package dependencies"
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: yarn install

- name: "Set up git since we will later push to the repo"
run: |
git config --global user.name "GitHub CD bot"
git config --global user.email "code@fastybird.com"
- name: "Upgrade npm version in package.json to the tag used in the release"
run: npm version ${{ steps.get_version.outputs.version-without-v }} --allow-same-version

- name: "Build the project"
run: yarn build

- name: "Publish to NPM"
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: npm publish --access public
14 changes: 13 additions & 1 deletion .npmignore
@@ -1,5 +1,17 @@
.github
build
config
node_modules
patches
public
src
tests
vendor
.editorconfig
yarn.lock
composer.json
composer.lock
editorconfig.xml
Makefile
phpstan.neon
ruleset.xml
yarn.lock
29 changes: 26 additions & 3 deletions README.md
Expand Up @@ -8,11 +8,15 @@
[![Latest stable](https://badgen.net/packagist/v/FastyBird/devices-module/latest?cache=300&style=flast-square)](https://packagist.org/packages/FastyBird/devices-module)
[![PHPStan](https://img.shields.io/badge/PHPStan-enabled-brightgreen.svg?style=flat-square)](https://github.com/phpstan/phpstan)

[![Latest stable](https://badgen.net/npm/v/@fastybird/devices-module?cache=300&style=flast-square)](https://www.npmjs.com/package/@fastybird/devices-module)
[![Downloads total](https://badgen.net/npm/dt/@fastybird/devices-module?cache=300&style=flast-square)](https://www.npmjs.com/package/@fastybird/devices-module)
![Types](https://badgen.net/npm/types/@fastybird/devices-module?cache=300&style=flast-square)

## What is FastyBird IoT devices module?

Devices module is a [Nette framework](https://nette.org) extension for managing connected devices and their basic logic.
Devices module is a combined [Nette framework](https://nette.org) extension and [Vex ORM](https://vuex-orm.org) plugin for managing connected devices and their basic logic.

[FastyBird](https://www.fastybird.com) [IoT](https://en.wikipedia.org/wiki/Internet_of_things) devices module is an [Apache2 licensed](http://www.apache.org/licenses/LICENSE-2.0) distributed extension, developed in [PHP](https://www.php.net) with [Nette framework](https://nette.org).
[FastyBird](https://www.fastybird.com) [IoT](https://en.wikipedia.org/wiki/Internet_of_things) devices module is an [Apache2 licensed](http://www.apache.org/licenses/LICENSE-2.0) distributed extension, developed in [PHP](https://www.php.net) with [Nette framework](https://nette.org) and in [Typescript](https://www.typescriptlang.org).

### Features:

Expand All @@ -21,19 +25,38 @@ Devices module is a [Nette framework](https://nette.org) extension for managing
- [{JSON:API}](https://jsonapi.org/) schemas for full api access
- User access check & validation
- Multilingual
- JS integration via [Vex ORM](https://vuex-orm.org) plugin

## Requirements

[FastyBird](https://www.fastybird.com) devices module is tested against PHP 7.4 and [ReactPHP http](https://github.com/reactphp/http) 0.8 event-driven, streaming plaintext HTTP server and [Nette framework](https://nette.org/en/) 3.0 PHP framework for real programmers
Backend part of [FastyBird](https://www.fastybird.com) devices module is tested against PHP 7.4 and [ReactPHP http](https://github.com/reactphp/http) 0.8 event-driven, streaming plaintext HTTP server and [Nette framework](https://nette.org/en/) 3.0 PHP framework for real programmers

Frontend part of [FastyBird](https://www.fastybird.com) devices module is tested against [ECMAScript 6](https://www.w3schools.com/JS/js_es6.asp)

## Installation

#### Backend

The best way to install **fastybird/devices-module** is using [Composer](http://getcomposer.org/):

```sh
composer require fastybird/devices-module
```

#### Frontend

The best way to install **@fastybird/devices-module** is using [Yarn](https://yarnpkg.com/):

```sh
yarn add @fastybird/devices-module
```

or if you prefer npm:

```sh
npm install @fastybird/devices-module
```

## Documentation

Learn how to use devices module and manage your devices in [documentation](https://github.com/FastyBird/devices-module/blob/master/.docs/en/index.md).
Expand Down

0 comments on commit d83beb3

Please sign in to comment.