Skip to content
forked from openT2T/console

Allows developers to interact with the Open Translators to Things repository. http://opentranslatorstothings.org

License

Notifications You must be signed in to change notification settings

arjun-msft/console

 
 

Repository files navigation

Open Translators to Things Console

Allows developers to interact with the Open Translators to Things repository. See http://www.opentranslatorstothings.org.

Developers can use the console app on Windows 10, Mac OSX or Android as a runtime to communicate with and onboard actual Things. The console app hosts the node.js process and serves simple UX to onboard (set up, auth, pair, etc) the Thing. Once a Thing has been onboarded, its schema and translator are downloaded. The Thing is then exposed through the AllJoyn bus as an AllJoyn device supporting the schema it has been translated to.

This README will help get you started developing in this repo.

Install Tools

Get your dev environment set up (PC or Mac):

Install the Ionic Framework, Cordova and Typings using npm. Note that we are using ionic 2, which is currently in beta.

$ npm install -g ionic@2.0.0-beta.10 cordova@6.2.0 gulp@3.9.1 tslint@3.13.0 typescript@1.8.10

Get the Source

Next, clone this repo to your local machine to get started. Navigate to the directory where you want to clone the repo to locally, then run:

git clone https://github.com/openT2T/console.git

Install Dependencies

You will need to install various dependencies to populate your local repo. The development process is driven by node, and the following command installs the dev dependencies (e.g. the typescript compiler, a test server, etc) as well as the dependencies used by the actual app (e.g. angular2 and ionic2):

$ npm install

Ionic provides an easy way to install the various cordova plugins used in the project. Run:

$ ionic state restore

Note: if running in Windows, and the command is not recognized, you may need to add npm to your PATH. The following should work: "%USERPROFILE%\AppData\Roaming\npm".

Start Developing

Congratulations, you are now set up for the basic development workflow! Just run:

$ gulp build
$ ionic serve

If you're feeling fancy, you can also try the Ionic Lab which will show you how your app will look in different devices:

$ gulp build
$ ionic serve --lab

The browser will launch, with the app hosted locally. As you make changes to the source, the app will live-reload in the browser to reflect your changes. This is great for doing UX-only updates, where you are not using any native components.

You can also run the following to emulate on a local android simulator (note: this requires the Android SDK on PC or Mac):

$ gulp build
$ ionic emulate android --livereload

Finally, run the following to install and run on a local Windows simulator (note: this requires the Windows 10 SDK on a PC):

$ gulp build
$ ionic run windows --archs=x64

? Note: At this time the --livereload option is not working on Windows.

After a successful build, you can also open the CordovaApp.sln file under platforms\windows in Visual Studio 2015, set the CordovaApp.Windows10 project as startup, and then just run from within Visual Studio. This is helpful for debugging.

Service Configuration

This app requires some API secrets from external services. Configure them here, if you want to use these services:

Wink Configuration

Create winkConfig.ts file under "app\pages\onboarding\winkOnboardingPage" with the following contents.

    export class WinkConfig {

        public static API_ENDPOINT: string = "https://api.wink.com";
        public static CLIENT_ID: string = "";
        public static CLIENT_SECRET: string = "";
    }

Next, populate the the client ID and Secret values (you will need to get these from Wink / Quirky as documented on their site). This file is listed in .gitignore to help avoid accidental check-in of these secrets.

Common Development Workflows

Here are some workflows you might find useful during development:

  1. ionic serve : runs the dev web server (with live reload)
  2. ionic emulate [platform] --live reload: starts an emulator session (with live reload) for the specified platform
  3. ionic build [platform]: builds the app for the specified platform.
  4. gulp tslint: Runs the linter to find static analysis issues with your code.

For general developer tips, check out this article.

Debugging Cordova plugin (Windows Platform)

If you start Cordova from the CLI rather than from Visual Studio, but want to debug it, attach to the WWAHost.exe process.

Create a Pull Request

Made any changes we should consider? Send us a pull request! Check out this article on how to get started.

Code of Conduct

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.

About

Allows developers to interact with the Open Translators to Things repository. http://opentranslatorstothings.org

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 77.3%
  • HTML 11.0%
  • JavaScript 6.6%
  • CSS 4.4%
  • Java 0.7%