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

teaparty2

v0.7.6

Published

Simple dashboard written in Node.js and AngularJS

Downloads

18

Readme

Teaparty 2 dashboard

Simple dashboard written in Node.JS and AngularJS

Installation

  $ [sudo] npm install teaparty2 -g

Run Teaparty2 with your shiny config by setting env variable config like:

  $ config=my.json teaparty2

Setup

Database

Teaparty2 stores all data in the MongoDB database. You will need to install it and setup or use one of cloud-based solutions like MongoLab - free plan there is more than enough for dashboard.

Auth

By default there is no auth and everyone can change your dashboards and get access to widgets. Set config property admin to true and set admin credentials (see example below) if you want to restrict dashboards editing.

Logging

You can set logging level and also change log file location (default is teaparty2/logs). logging section is optional.

Dark theme

You have to rebuild Teaparty if you want to have a dark theme. See detailed instructions below

Example config

Teaparty2 will use default config (with invalid DB credentials) located in teaparty2/config/ if environmental variable config was not set during the launch. Here is the example config file:

{
  "auth": false,
  "admin": {
    "username": "admin",
    "password": "admin"
  },
  "server": {
    "port": 8080
  },
  "database": {
    "uri": "mongodb://ds0XXXXX.mongolab.com",
    "port": 10000,
    "db": "teaparty2",
    "username": "admin",
    "password": "admin"
  },
  "logs": {
    "level": "info",
    "file": "/var/log/teaparty/teaparty.log"
  }
}

Update widget data

At the current moment there are two ways to update widgets' data. You can choose one of them during a widget creation: Push and Pull datasources. Each widget has its own requirements to incoming data. Please look at widgets folder and check widget's reference .js to get an example of data can be stored in widget.

Push

Manually update widget data by using Teaparty2 API

To push data, send post request to http://<teaparty-url>/api/push/<widget-key> with a correct data object for this widget's type.

Here is curl example:

curl -H "Content-Type: application/json" -X POST -d '{"value": 35}' http://teaparty.local:8080/api/push/62465070-9fc0-11e4-a490-7fb3618741f2

Also there is node-teaparty Node.js helper module that can make life easier.

Pull

Teaparty2 will pull data from the remote URL via HTTP and update widgets if data was updated. Please note that right now there is no way to modify data on the fly (expecting in v0.8.0) so remote resource must provide data in a way widget can understand it.

Browsers support

Normal browsers and IE10+

Build

Checkout this repo and install everything you need:

npm install && bower install

Quick build and run develop server:

grunt serve

Quick build and run server with mocked data:

grunt mocked

To run API integration tests first you must create a spearate Teaparty config with server port 8081, the different database credentials and database.clean parameter enabled (it will wipe all the collection at the start), example config:

{
  "server": {
    "port": 8081
  },
  "database": {
    "uri": "mongodb://XXXXXX.mongolab.com",
    "port": XXXXX,
    "db": "teaparty2_test",
    "username": "test",
    "password": "test",
    "clean": true
  }
}

Then run this command to start Teaparty server and run tests against:

tools/api_integration_tests.sh <config_path>

Build AngularJS application, minimise everything static:

grunt build

To enable dark theme: rename web/src/styles/variables.dark.less to variables.less and rebuild an app

mv web/src/styles/variables.dark.less web/src/styles/variables.less
grunt build

Creating new widgets

To create a new widget, please read this post in wiki.

License

The MIT License (MIT)

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.