Code Monkey home page Code Monkey logo

dashboard's Introduction

Netbeast Dashboard

Build Status Windows Build Status

Important notice

Netbeast Dashboard project is moving on.

Developing is hard. Being disruptive is harder. Industry won't stop trying to impose new protocols and standards. Indies won't stop creating open source projects that everyone should adopt --this repo was our own bet-- but it is really hard to take off and critical adoption rate is really difficult to achieve. So we changed our focus.

Firstly we developed Yeti Smart Home. It is a mobile app with effortless installation and a thoroughtly worked UI that is the perfect platform to build the next generation tools for IoT development that is actually usable by non-technical people. We also did it in an open way, sharing our know-how with the community and releasing a number of packages. You can read it more here: Developing Beyond the Screen.

Now we are going to take a second step. We just started The Bigfoot Project. We took everything we learnt from building the first Netbeast Dashboard, and the UX / UI experience of Yeti, developing a third beast. Instead of developing a new platform or protocol we are releasing a series of documentation, guides and wrapper of already standard tools to make them work with each other. So the Bigfoot project is a collection of already existing tools that work together out of the box and will help you develop your next connected thing as soon as possible. Please join us here.

We want to make compatible all the pieces of our ecosystem to serve best users and developers equally, as our mission is to make things work for people, instead making people work for things.

Netbeast team

Connect everything. Regardless its brand or technology.

One API, unlimited products and hacks. Netbeast middleware translates messages from different IoT protocols and device interfaces so they work as one. Have no more "hubs". Work across devices not brands.

var netbeast = require('netbeast')
netbeast.find().then(function () {
  netbeast('lights').set({ power: 1 }) // will turn on all lights in your home
})

Contents

Installation

Basic

Make sure you have installed git and nodejs.

npm install -g netbeast-cli
netbeast start

Find it live at http://localhost:8000 or run it as netbeast start --port <PORT>

Pro tip. To get started developing you will find handy to have it installed in a folder of your choice.

git clone https://github.com/netbeast/dashboard
cd dashboard
npm install --production
npm start

Dashboard live GIF

## Raspberry / Beagle Bone / Pine64 or your choice of board Make sure again you have installed git and nodejs. It can be tricky depending on your OS & architecture. If any doubts please reach forum or open an issue.

  1. Apply the basic installation from above, preferably using git.
git clone https://github.com/netbeast/dashboard . # clone in this folder
npm i --production # no front-end or test dependencies
  1. Keep it running 24h 7 days a week, to use it as Smart Home Hub. You can use utilities such as forever or pm2.
npm i -g pm2
sudo pm2 start index.js --port 80
  1. [Soon] Learn how to attach a DHCP name to your Netbeast as https://home.netbeast and how to deal with wireless configuration in Linux from our blog.

Using docker 🐳

Make sure you already have docker installed.

  1. Run our docker image, if it's the first time, it'll be downloaded from the Docker Hub
docker run -p 49160:8000 -d netbeast/netbeast

This will run Netbeast dashboard on port 49160 of the host running the container. You can now play with it.

Access the dashboard on http://localhost:49160

Et voilà!

Overview

Find inspiration, think about new projects, connect your new hardware.

Netbeast apps are HTML5 user interfaces that enable controlling IoT or visualizing their data. Netbeast plugins are apps that translate from the Netbeast IoT Unified Scheme, to each particular implementation of an IoT device.

Explore existing apps and plugins of our public registry.

Control devices regardless of their brand and technology

Take a look on our unified API on action in this demo on youtube, under a Netbeast app that creates new scenes.

IMAGE ALT TEXT HERE

https://www.youtube.com/watch?v=YNERwJdykuQ

Measure all your data

Use the Netbeast API along with the dashboard to publish data through MQTT or reuse it in your apps. Read more.

Dashboard live GIF

## Write IoT apps without spending on hardware or suffering expensive deployments Take advance of Netbeast IoT middleware to test your apps with software that mocks the hardware interface.

Virtual plugins

Find tutorials in the docs, read a blog post about it on TopTal or join the forum to ask how to do it.

Documentation

We publish a gitbook with fresh documentation on https://docs.netbeast.co. If you want to open an issue, contribute or edit it, find your way on its github repo https://github.com/netbeast/docs.

Create IoT with Node.js

In Netbeast we care about education, openness and interoperability. We have created a series of workshops to teach developers to better use HTTP, MQTT in combination with the Dashboard to create data bindings and incredible apps. Use your favorite boards and platforms as Arduino, Pi Zero, Pine64, Belkin Wemo, Homekit and a infinite list, connected.

Apps

A Netbeast app allows you to run the Dashboard unique API in the browser or backend equally. Just expose some user interface in your apps root. In the following snippet we serve in the root all files inside public folder.

var express = require('express')
var app = express()

// Netbeast apps need to accept the port to be launched by parameters
var argv = require('minimist')(process.argv.slice(2))

app.use(express.static('public'))

var server = app.listen(argv.port || 31416, function () {
  var host = server.address().address
  var port = server.address().port
  console.log('Example app listening at http://%s:%s', host, port)
})

Learn how to create new scenes and user interfaces as bots, speech recognition, smart triggers. Learn how to develop Netbeast apps, debug and publish them on the documentation

Connect Devices

A plugin is an app that enables your Dashboard to communicate with a different protocol or proprietary device. It's like if you, that want to learn Chinese, could speak Chinese by installing an app. Luis, cofounder of Netbeast

A basic plugin must implement at least a discovery primitive to declare itself on Netbeast's database. Fill the gaps to create your first hardware integration into Netbeast:

var netbeast = require('netbeast')
var express = require('express')
var cmd = require('commander') // reads --port from command line

// Netbeast tells you in which port to run your Plugin endpoint
cmd.option('-p, --port <n>', 'Port to start the HTTP server', parseInt)
.parse(process.argv)

var app = express()

/*
* Discover your resources / scan the network
* And declare your routes into the API
*/

app.get('/discover', function () {
	/* TODO, implement discovery */

	/* for each device */
	netbeast('topic').create({ app: 'my-first-plugin', hook: 'DEVICE_ID' })
	/* end of for */

	/* or */
	/* Register all device together and delete the resources no longer available */
	netbeast('topic').udateDB({ app: 'my-first-plugin', hook: ['DEVICE1_ID', 'DEVICE2_ID', 'DEVICE3_ID', 'DEVICE4_ID'] })
})

/*
* Create here your API routes
* app.get(...), app.post(...), app.put(...), app.delete(...)
*/

app.get('/:device_id', function (req, res) {
	// id of the device the dashboard wants
	// << req.params.device_id >>
	// dashboard will do GET on this route when
	// netbeast('topic').get({})

	/* TODO: Return device values from req.query */

	// res.json({ YOUR_PLUGIN_DATA })
})

app.post('/:device_id', function (req, res) {
	// id of the device the dashboard wants
	// << req.params.device_id >>
	// dashboard will do POST on this route when
	// netbeast('topic').set({})

	/* TODO: Change device values from req.body */

	// res.json({ YOUR_PLUGIN_DATA })
})


var server = app.listen(cmd.port || 4000, function () {
  console.log('Netbeast plugin started on %s:%s',
  server.address().address,
  server.address().port)
})

Learn how to launch it, debug it and publish it on the documentation.

Community

Join us in our forum
Ask for an invitation to join our Slack team here
Project website

Contribute

Take a look to our CONTRIBUTING.md file in order to see how can you be part of this project. Or take a look on Netbeast's discourse forum to find for inspiration, projects and help.

TL;DR Make a Pull Request. If your PR is eventually merged don't forget to write down your name on the AUTHORS.txt file.


   

dashboard's People

Contributors

andreeib avatar ankitkhedekar avatar cayrodmed1 avatar franrios avatar htmael avatar iblancasa avatar jmrr avatar joncy avatar jsdario avatar loulirsal avatar luisfpinto avatar mo33n avatar pablopi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

dashboard's Issues

Forbidden error when I try to delete an account

1. Describe your issue ( Expected and actual behaviour )

When I log in with my user and then I try to remove my account I get an error on the dashboard with the message "Forbidden"

2. Steps to reproduce the problem

Log with an user
Go to setting
Try to remove the account.

3. Please left us some versioning details like..
* Where is the dashboard running (OS): Mac
* Dashboard version: Last
* npm & node version: 5.8.0

Thanks, I hope we can figure it out as fast as posible :)

┆Issue is synchronized with this Asana task

Some repos are not being discovered

1. Describe your issue ( Expected and actual behaviour )

The query used to find Netbeast plugins on GitHub looks only for JavaScript repos, but some repos has more HTML than JS so is considered by GitHub an HTML repo.

This situation makes my repo not being included in the query result so it won't be displayed on dashboard discover section.

2. Steps to reproduce the problem

Create a repo for an app or a plugin where the main language is not JavaScript.

Example repo: https://github.com/Bigomby/netbeast-yeelight

┆Issue is synchronized with this Asana task

Login screen signup text

On the login page the text should read:

Don't have an account? Sign Up

And on the Sign up page the text should read:

Already have an account? Login

FYI, this is from an npm install

login bug
signup bug


On docker the text says Sing Up instead of Sign up 😄

docker page

┆Issue is synchronized with this Asana task

Network app fails

When you open the network app, you will see devices that dont exist on the DB.
It doesn't display the new devices found. Should be some kind of problems with the session.

Also, re-discovery button should need any effect or any feedback, you dont know if you had click it or not.
The bulb controller display have a strange behaviour, it cannot be clicked. @jsdario

┆Issue is synchronized with this Asana task

Installation status message for app doesn't close on install

1. Describe your issue ( Expected and actual behaviour )

When installing an app install status box doesn't finish although app is installed.

When inspecting console I get:

undefined Setting everything up for you...

#undefined Downloading light-control dependencies...
[light-control] http server started on :::62749

Exception in routes stack:
Error: App already exists
at _installFromDir (/Users/joncy/Code/netbeast-code/dashboard/src/models/_install.js:40:17)
at /Users/joncy/Code/netbeast-code/dashboard/src/models/_install.js:73:5
at /Users/joncy/Code/netbeast-code/dashboard/node_modules/gift/lib/index.js:46:14
at ChildProcess.exithandler (child_process.js:194:7)
at emitTwo (events.js:87:13)
at ChildProcess.emit (events.js:172:7)
at maybeClose (internal/child_process.js:817:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:211:5)

2. Steps to reproduce the problem

Download fresh release of dashboard (through git clone).
Download plugin (maybe not necessary).
Download light-control app.

3. Please left us some versioning details like..
* Where is the dashboard running (OS): Mac OS X 
* Dashboard version: 0.5.8
* npm & node version: node v4.1.1 npm v2.14.4

Thanks, I hope we can figure it out as fast as posible :)

┆Issue is synchronized with this Asana task

Fix UX problems on navigation drawer dashboard version

  • Change icon to "launch" once installed from explore
  • "Looking for apps" does not appear under explore view
  • Consider removing network and history as embedded apps
  • Consider improving or easing the creation of apps as react components or plain views.

┆Issue is synchronized with this Asana task

Impossible to launch application error - caused by node module

I installed my app which is perfectly running localy, on the raspberry pi through the dashboard. But it is somehow impossible to launch...

01111

If you wonder why this error occures, try to 'test' every node module you are using on its own in a clean new app!

In my case, it seems the npm module 'lwip' is the bad guy... when I just require this module in myapp I get the error. Netbeast OS or Raspberry Pi seem to fail requesting this module. Could it be because 'lwip' is custom compiled when you type 'npm install lwip'?

Add engine(s) to package.json

It is important. For example, in Ubuntu 14.04 PPA installs version 0.10.x... and the latest stable version is (I think) v5.9.0. The problem is: some dependences use thinks like "Promises", not implemented in old versions.
If you say with what version of Node are you developing, will be easier for developers to edit/revise/etc code 👍

Error using superagent with form-data

When trying to use superagent instead of request in tests, I'm getting an error with 2 tests. This tests both use form-data. In request it is like:

var request = require('request')
var req = request.post(URL + '/apps', function (err, resp, body) {
     // Test code
    })
var form = req.form()
var app = path.join(__dirname, '../app.tar.gz')
form.append('file', fs.createReadStream(app))

I've found out that attach is the equivalent for append in superagent, so with superagent it would be:

var agent = require('superagent')
var app = path.join(__dirname, '../app.tar.gz')
agent.post(URL + '/apps')
    .attach('file', fs.createReadStream(app))
    .end(function (err, resp, body) {
     // Test code
    })

I execute this code and dashboard throws the following error:

Error: App must be a .tar.gz file.

And this throws the 422 error (Unprocessable Entity) in tests.

It seems like it doesn't take the route to the app properly, but I don't know why it happens.

Any idea? Am I doing something wrong?

Dashboard

1. Describe your issue ( Expected and actual behaviour )

...

2. Steps to reproduce the problem

...

3. Please left us some versioning details like..
* Where is the dashboard running (OS): 
* Dashboard version: 
* npm & node version: 

Thanks, I hope we can figure it out as fast as posible :)

Move towards API v2

  • Define messages and formats
  • Backwards support for CLI should be possible
  • Proxy directly all requests
  • Refactor and rewrite API client
  • Adapt MQTT pattern to HTTP pattern
  • Recreate tests and samples

┆Issue is synchronized with this Asana task

When I click on an Application or Plugin nothing happens

1. Describe your issue ( Expected and actual behaviour )

When I install one application or plugin and then I click on them to run it nothing happens I think can be a problem with the UI

2. Steps to reproduce the problem

Install any application or plugin and click on it on

3. Please left us some versioning details like..
* Where is the dashboard running (OS): Linux
* Dashboard version: Latest
* npm & node version: 5.8.0

Thanks, I hope we can figure it out as fast as posible :)

┆Issue is synchronized with this Asana task

Troubles when I try to install beast-red app

I have some troubles when I try to install beast-red. It looks like app installation never ends and when I try to run the app some errors come up. Could you please check if this error is due to the dashboard or in the opposite this id due to the app.

Thanks!

UX improvements

  • Explore
  • Apps
  • Network map
  • History viewer
  • Navigation drawerv
  • User

┆Issue is synchronized with this Asana task

ENOENT: no such file or directory, scandir './_apps' at error (native)

1. Describe your issue ( Expected and actual behaviour )

Appears ENOENT: no such file or directory, scandir './_apps' at error (native) after first run after npm installation.

2. Steps to reproduce the problem

You can find the discussion on the forum, here: http://forum.netbeast.co/t/netbeast-start-not-working/58/18

3. Please left us some versioning details like..
* Raspbian
* Last
* Node v6+

┆Issue is synchronized with this Asana task

Fix backend

Task delivered to api.netbeast.co project

Redesign database

Change sqlite in favor of simple JSON packages?
Change data structure to be more descriptive and handy?

┆Issue is synchronized with this Asana task

Problems with notifications

Sometimes when I install the light-control app on the RPI the message "Installing app" keeps all the time and anything else shows telling me that the app has been installed but it has.

┆Issue is synchronized with this Asana task

Improve install view interaction

When installing an app from install view, no feedback on installation progress is given aside from the push notifications. Also, once an app is installed it may be good to redirect to the dashboards main view. Currently it gives a feeling that something is going wrong.

┆Issue is synchronized with this Asana task

Problem when starting application on windows

child_process.js:1162
   throw errnoException(err, 'spawn');
         ^
Error: spawn UNKNOWN
   at exports._errnoException (util.js:746:11)
   at ChildProcess.spawn (child_process.js:1162:11)
   at exports.spawn (child_process.js:995:9)
   at d:\netBeast Github\dashboard\src\models\activity.js:117:17
   at d:\netBeast Github\dashboard\src\models\app.js:75:5
   at d:\netBeast Github\dashboard\node_modules\fs-extra\node_modules\jsonfile\index.js:39:5
   at fs.js:334:14
   at d:\netBeast Github\dashboard\node_modules\decompress\node_modules\vinyl-fs\node_modules\graceful-fs\graceful-fs.js:43:10
   at d:\netBeast Github\dashboard\node_modules\gulp-sourcemaps\node_modules\graceful-fs\graceful-fs.js:43:10
   at d:\netBeast Github\dashboard\node_modules\fs-extra\node_modules\graceful-fs\graceful-fs.js:43:10
   at d:\netBeast Github\dashboard\node_modules\mosca\node_modules\st\node_modules\graceful-fs\graceful-fs.js:43:10

Message on activity log?

I think that should be good if you write a message on the activity log menu on the dashboard that says: "No applications running" or something like that when there are no applications running.

@netbeast/engineering

Beast new app and beast new plugin doesn't work

1. Describe your issue ( Expected and actual behaviour )

When I try to do beast new app or beast new plugin after installing the npm module it doesn't work due to submodules are not cloned properly .

 return binding.stat(pathModule._makeLong(path));
                 ^

Error: ENOENT: no such file or directory, stat '/usr/local/lib/node_modules/netbeast-cli/lib/../bin/bundles/base-app'
2. Steps to reproduce the problem

Install npm module.
Try to beast new app/plugin

3. Please left us some versioning details like..
* Where is the dashboard running (OS): Linux
* Dashboard version: Last
* npm & node version: Last

Thanks, I hope we can figure it out as fast as posible :)

┆Issue is synchronized with this Asana task

Notifications don't work on firefox

When I try to see notification history I get the following error:

Error: Objects are not valid as a React child (found: object with keys {type, key, ref, props, _owner, _store}). If you meant to render a collection of children, use an array instead or wrap the object using createFragment(object) from the React add-ons. Check the render method of `Toast`.

After that the dashboard crashes

Update the Docs

The dashboard contains the sdk-cli funtionality, so it should be explained here.

The dashboard start by typing 'netbeast (or beast) start'

Done is not a function

Sometimes I run the dashboard I get the following error:

TypeError: done is not a function at Statement.<anonymous> (/Users/luisf/Netbeast/dashboard/src/models/resource.js:25:12) --> in Database#run('DELETE FROM resources WHERE id = \'41fa9733a4f3e50cda9e1bcfa1be089889f8cc1a\'', [Function]) at Object.helper.deleteAction (/Users/luisf/Netbeast/dashboard/src/helpers/resource.js:30:6) at Resource.destroy (/Users/luisf/Netbeast/dashboard/src/models/resource.js:22:10) at /Users/luisf/Netbeast/dashboard/src/models/activity.js:158:18 at Statement.<anonymous> (/Users/luisf/Netbeast/dashboard/src/models/resource.js:47:12)

spawn() methods throw an exception on window machine.

   throw errnoException(err, 'spawn');
         ^
Error: spawn UNKNOWN
   at exports._errnoException (util.js:746:11)
   at ChildProcess.spawn (child_process.js:1162:11)
   at exports.spawn (child_process.js:995:9)
   at Object.<anonymous> (D:\netBeast Github\dashboard\index.js:65:11)
   at Module._compile (module.js:460:26)
   at Object.Module._extensions..js (module.js:478:10)
   at Module.load (module.js:355:32)
   at Function.Module._load (module.js:310:12)
   at Function.Module.runMain (module.js:501:10)
   at startup (node.js:129:16)
   at node.js:814:3

spawn is not working

I think spawn is not working. I have tried to clone the repo, install packages and the dashboard doesn't detect any devices, even the beast scan process can't reach the dashboard. Can you try and see if I am right?

Error handling depends on backend

Sometimes we can retrieve from superagent the object err.res.text sometimes we need body and other times is just err.message. There does not seem to be a way to have them all under same API.

┆Issue is synchronized with this Asana task

netbeast cannot run in windows

1. Describe your issue ( Expected and actual behaviour )

I just install the netbeast dashboard through npm install netbeast-cli.
Then run netbeast, an error coming out.

Error: spawn UNKNOWN
at exports._errnoException (util.js:890:11)
at ChildProcess.spawn (internal/child_process.js:302:11)
at exports.spawn (child_process.js:367:9)
at Object. (C:\Users\wren\Desktop\javascript\node_js\netbeast\node_modules\netbeast-cli\index.js:82:16)
at Module._compile (module.js:413:34)
at Object.Module._extensions..js (module.js:422:10)
at Module.load (module.js:357:32)
at Function.Module._load (module.js:314:12)
at Function.Module.runMain (module.js:447:10)
at startup (node.js:142:18)
at node.js:939:3

It seems an error is raised in index.js:82:16

2. Steps to reproduce the problem
  1. npm install netbeast-cli
  2. .\node_modules.bin\netbeast start
    ...
3. Please left us some versioning details like..
* Where is the dashboard running (OS): Wiindows 7
* Dashboard version: the latest on 
* npm & node version: npm 3.7.3,   node 5.9.1

Thanks, I hope we can figure it out as fast as posible :)

┆Issue is synchronized with this Asana task

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.