npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

generator-muzzley-manager

v0.2.4

Published

Yeoman generator for muzzley managers.

Downloads

8

Readme

Muzzley manager generator

What is this?

This is a Yeoman Generator that quickly and effortlessly builds a muzzley Thing Manager app structure.

"What is a Thing Manager?" you may ask

Well, you can think of a Thing Manager as a "thing control remote" app that runs in the Muzzley ecosystem.

Installation

First, you need to have Yeoman installed globally. If you don't have it you can run this in your terminal:

npm install -g yo

Then you need to install the muzzley manager generator:

npm install -g generator-muzzley-manager

How to use?

Run this in your terminal

yo muzzley-manager

Questions

When you run the generator it will ask a few questions to generate custom boilerplate for your project. The following questions will be asked:

> What is the name of the device?

Possible answers

Anything you want.

What it does?

  • Create a directory with the name of the device, for e.g. if you call it awesome, you'll get manager-awesome/
  • Write to multiple files (config.js env variables, plugin handlers) the name of your device

> Do you want to use a third-party module for the provider logic?

Note: The generator is asking if there's already an npm module that can handle aspects of your "thing" such as the communication with its cloud.

Possible answers

  • Yes
  • No

What it does?

If you answer Yes

It will ask the name of this npm module to add to the dependencies in package.json.

If you answer No

It will ask if you want to build a local npm module, to keep muzzley manager business logic separated from provider business logic.

If you answer Yes, it will create a a directory in the root of your app directory called provider_module.

When you finish it will generate the boilerplate and install the dependencies

App structure

You will get a structure similar to this:

  • manager-[thing-name]/
  • lib/
    • interaction/
    • models/
    • plugins/
    • provider/
  • production/
  • provider_module/
  • public/
  • test/
  • docs/
  • index.js
  • config.js
  • Gruntfile.js

The core dependencies of the generator is the muzzley-idk and muzzley-client. If you don't know what the hell those are, we suggest that you read the documentation of both packages.

The main dependencies that generator installs are the following:

Note: If one of these dependencies doesn't ring a bell, please check them out because you will need to have basic knowledge on what they do and how to use them.

Explaining lib in more detail

First when we talk about provider, we are referring to the manafacturer, and in most cases that person will be you or someone else who is reading this.

When we say, provider business logic, we are referring to the cloud/web service the thing is pushing information to or/and receiving information from.

Interaction

Interactions are full-duplex real-time communication using sockets and the muzzley protocol. You can read more about that here.

Models

This are representations of muzzley business logic and the way information should be stored. You have the following models:

  • Channel: This is represents an instance of your thing, it can be a sensor, a piece of hardware, or even you or your cat.
  • Credentials: Normally, the credentials are represented as an access token that give access to the provider API endpoints.
  • Subscription: This represents a user/channel relationship.

Plugins

Plugins are isolated pieces of business logic and reusable utilities used in hapi. Read more about plugins here.

Provider

This is a wrapper used to communicate with the http server and the muzzley client, using provider business logic. It also stores and retrieves information from a local thing storage.