NordicPlayground / webapp-nordic-thingy

Thingy:52 reference web app
https://developer.nordicsemi.com/thingy/52
Other
54 stars 19 forks source link
nrf52832 polymer thingy web-app web-bluetooth

Thingy:52 Polymer and React web apps

This repository contains source code and instructions for building Polymer and React web apps showcasing the features of Thingy:52. To view the live version of the Polymer web app, click here, and to view the live version of the React web app, click here.

Apps

Polymer

The web app is built with Polymer 1.0 and uses the Web Bluetooth API to communicate with Thingy:52. The Web Bluetooth API is supported in the latest versions of Chrome and Opera on Android, Windows, Linux, Chrome OS and OS X. Check out the up to date list of implementation status in different browsers.

Recommendations

Prerequisites

Node.js

Install an active LTS version of Node.js (4.x or 6.x). The current version (7.x) should work, but is not officially supported.

Git

Install Git

Bower

npm install -g bower

Polymer-CLI

npm install -g polymer-cli

Installation instructions

  1. Clone this repository
  2. Make sure you have all prerequisites
  3. Browse inside the webapp-nordic-thingy folder and download dependencies with bower
    bower install
  4. Start a local web server to test the project
    polymer serve -o

    The web app will open automatically in your default browser.

Build the project

Browse inside the project and use polymer-cli to build.

polymer build

This will create a new build folder. Inside is a bundled and unbundled folder. To learn more about the build process and the output please check out the official polymer-cli documentation.

Third-party licenses

three.js

MIT License

chart.js

MIT License

Polymer

Copyright (c) 2017 The Polymer Authors. All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

React

Recommendations

Prerequisites

Notes

Installation instructions

  1. Clone or download this repository.
  2. Make sure you have all prerequisites.
  3. Open a command line tool, navigate to the root folder of the repository, and download dependencies by typing:
    npm i
  4. To test the project, type:
    npm start

    Build the project

    From the root folder of the project, in a command line tool, write:

    npm run build

    This will create a new build folder. Inside is a bundled package of the website. The build can now be hosted by any server that is able to serve static files.

Note: If you want to serve the build from a folder other than the root folder, open the package.json file and change the "homepage" field to match your desired path.

Third-party licenses

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.