Share
Embed
Hackers Week
Fran
March 15, 2016
Transcript
45 slides
-
Hello, Spain Team! Fran Ríos Developer and Cloud Architect Ismael
Martín Engineer Caye Rodríguez Engineer Lourdes Liró Engineer fcojriosbello loulirsal Htmael cayrodmed1 -
First of all! BEFORE WE START Check that Node.js, NPM
and github are installed on your computer SET UP EVERYTHING Execute the following command: npm install –g netbeast-cli More info on our documentation: http://docs.netbeast.co/chapters/get_started/get_started_from_your_laptop.html -
Imagine That you can have someone to take care of
you and your house 24/7 -
He can tell you what food is missing when your
at the supermarket… -
Today There are a lot of smart connected objects …that
don’t interact with eachother -
How? Netbeast connects devices from different technologies & brands Developers
can create apps for Netbeast and upload them to our marketplace Different apps can provide different uses and values, you get to choose the ones that suit you! And allows to control your smart home through apps -
Netbeast's platform We stand at a differentiated position than other
market players Marketplace OS Dashboard Router -
Soon… Other dashboard platforms We are working on android and
ios apps and a desktop dashboard -
Community build share use Ask us for invite you to
our slack community team! -
Javascript • Goal: to create interactive sites. • Shares many
of the features of Java. • Interact with HTML and spice up websites with dynamic content. -
Node.js Server side platform built on Google Chrome’s JavaScript Engine
Node.js = Runtime Environment + JavaScript Library 1) Asynchronous and event driven 2) Single threaded but highly scalable 3)No buffering -
Asynchronous event-driven architecture Test those lines by creating a event.js
file and type: >node event.js -
REPL terminal (Read Eval Print Loop) Computer environment like a
console in Unix/Linux . Just type: >node -
NPM Node Package Manager: install Node programs and manage/install dependencies.
>npm install --global netbeast-cli #installing >npm install [email protected] #an specific version >npm info netbeast >npm ls #list installed packages -
Get on with it! We are going to build an
example app and launch it to the space! -
Dashboard is alive Take a walk through dashboard Type: beast
start and check localhost:8000 on your browser Open Source Dashboard source code is on github. You can also clone it directly: https://github.com/netbeast/dashboard Remember to install dependencies: npm install -
App template (I) Let’s build an app template To do
so, type: beast new sampleApp *Don’t worry about if it doesn’t work. It’s a symlink to bin/cli.js . Use the following command instead: bin/cli.js new sample Result This process will create a base app called “sample” We’ll explain what’s inside a sample app now. -
App template (II) What’s inside? >cd sampleApp • server.js •
express • minimist • package.json • dependencies • properties • public • front-end -
Packaging and launching Playing with the dashboard It’s necessary to
compress your app before uploading it to the dashboard. You can do it with beast pkg ../sampleApp --to ../sampleApp.tar.gz and check localhost:8000 on your browser. After that we are ready to install it: beast install sampleApp.tar.gz -
Publish your app Remember that we are building the first
marketplace on the iot environment. That’s the powerful key that allows the community to grow up in number of developers and devices supported. -
Get on with it! We’ll build a plugin for a
virtual bulb! -
What's a plugin? It’s the key that allows you to
interact with smart devices in your apps. It uses the Netbeast API. Using the netbeast-cli we can create a base plugin. Type: beast new samplePlugin –-plugin You will get the following structure: • package.json • src • index.js, resources.js, routes.js • index.js • test.js -
Virtual Bulb At this point we can interact with devices.
We’ll do it with virtual ones. Install BULB-PLUGIN in the dashboard. Click Explore and Install the plugin. It will be notified when it’s done. You can check in the plugins section: -
Virtual Bulb Type the following commands if the previous steps
didn’t work: wget https://github.com/netbeast/bulb-plugin/archive/master.zip unzip master.zip beast pkg bulb-plugin-master --to bulb-plugin-master.tar.gz beast install bulb-plugin-master.tar.gz Then access to the dashboard and execute the plugin on it. You’ll see a virtual bulb on your screen. -
Let's interact with it We’re going to develop two exercises
with the virtual bulb. Open the dashboard and check that virtual bulb is running. Then clone this repo: https://github.com/netbeast/workshop.git -
Hands on! How can we interact with devices? beast('topic').set({ property:
value }) We’ll do two exercises. level-1 and level2! You’ll need some tips like that one: What’s the topic, property and value? Topics: lights, music, switch power: true || false hue: 0..360 saturation: 0..100 brightness: 0..100 color:#FF13AA -
So far… Finished the development of most of our platform
Increased headcount by 6 Made a successful hackathon and got first applications from third party developers We opened a second office in Seville, Spain! Joined AllSeen Alliance