3.0.1 • Published 5 years ago

product-monitor v3.0.1

Weekly downloads
3
License
ISC
Repository
github
Last release
5 years ago

Product Monitor

A HTML/JavaScript template for monitoring a product by encouraging product developers to gather all the information about the status of a product. The idea is to provide components to bring live monitoring, statistics, endpoints, and test results all into one place.

Uses a pattern of HTML/JavaScript components connected to custom JSON /api/ endpoints which can be created and customised in order to use your own declarative HTML templates to create a monitor customised to your project's needs.

NPM Version

How to get started

How to create your own product monitor

1. Run mkdir my-product-monitor && cd my-product-monitor to start in a new folder

2. Run npm init --yes to create new default project

3. Run npm install product-monitor --save

4. Create your own server.js file:

const monitor = require('product-monitor')
const server = monitor({
  "serverPort": 8080,
  "productInformation": {
    "title": "My Product Monitor",
  },
  "userContentPath": "config"
})

5. Run your server using the command node server.js, you should see the following output:

...

[My Product Monitor Listening] on http://localhost:8080

6. Visit http://localhost:8080 to see the monitor in action

7. Now that your server is running, read the supplied documentation, and try out the examples!

Product Monitor Example

Key Features

  • Minimal setup
  • Write simple HTML to configure your monitor
  • Navigation generated dynamically by scanning /content folder
  • API endpoints loaded dynamically by scanning /api folder
  • Add a single javascript file to create custom JSON /api/ endpoints
  • Variable in-memory caching on all custom /api/ endpoints
  • Component Showcase and documentation served up through client
  • Extremely simple wiring to load JSON data from custom templates, e.g. adding:

    <template for="custom-web-component"><h2>{{name}}</h2><pre>{{dataSourceData}}</pre></template>

    Will enable data loading on:

    <custom-web-component data-source-url="/api/packageInfo"></custom-web-component>

    (No custom javascript required)

  • Bootstrap look and feel, using all their CSS advice and best practice

  • Handlebar templates for rendering complex JSON data

Preview

Product Monitor Example

Defined by:

<h3>Endpoints</h3>
<status-checker data-url="/">Can monitor its own server</status-checker>
<status-checker data-url="https://google.com" data-contains="Google">Can monitor google</status-checker>
<status-checker data-url="/api/generateStatusCode?statusCode=404">Can monitor for 404's</status-checker>
<status-checker data-url="http://not-a-real-dns-entry/">Can monitor DNS not found errors</status-checker>

Development Instructions using a checkout from github

  1. Check out (or fork) this project
  2. From the project root, run: npm install
  3. Run npm test to run a smoke test against the server
  4. Run npm start to start the monitor
  5. Visit http://localhost:8080

Warning: you might miss out on the latest updates to the server and its documentation if you check out this project directly from github. The recommended method for setting up a monitor is to use the NPM setup instructions.

Library Credits

Downloaded from CDN:

  • Bootstrap - basic styling and layout for client-side components
  • jQuery - for remote calls to server to drive components
  • Handlebars - for "minimal templating on steroids"
  • Node.js - for package management and running the server instance
  • Strapdown.js - for markdown rendering via <markdown></markdown> tags
  • Web Component JS - for enriching the client DOM with web component templates, providing the client-side data-loading and rendering logic for the product monitor.

Node packages:

  • Express - for defining the server, the api endpoints, and serving up the client
  • md5-node - for hashing keys in an in-memory cache
  • request - for making server side requests to remote domains
  • utils-merge - for merging configuration together with the default config
  • ncp - for copying files used during setup of a new server instance
  • And more... thanks to the community for such a diverse and useful set of libraries

Compatability

Server

NodeJS onSupport
Windows 8Excellent
Mac OSXExcellent
RaspianSeems good

Client

BrowserSupport
ChromeExcellent
ChromiumSeems good
OperaWorks a treat
IE11Seems alright
FirefoxPlays nice

Support and Feedback

Please get in touch for support and feedback by raising an issue here on this github project.

3.0.1

5 years ago

3.0.0

5 years ago

2.4.1

5 years ago

2.4.0

5 years ago

2.3.3

6 years ago

2.3.2

6 years ago

2.3.1

7 years ago

2.3.0

7 years ago

2.2.7

7 years ago

2.2.6

8 years ago

2.2.5

8 years ago

2.2.4

8 years ago

2.2.3

8 years ago

2.2.2

8 years ago

2.2.1

8 years ago

2.2.0

8 years ago

2.1.2

8 years ago

2.1.1

8 years ago

2.1.0

8 years ago

2.0.5

8 years ago

2.0.4

8 years ago

2.0.3

8 years ago

2.0.2

8 years ago

2.0.1

8 years ago

2.0.0

8 years ago

1.9.1

8 years ago

1.9.0

8 years ago

1.8.36

9 years ago

1.8.35

9 years ago

1.8.34

9 years ago

1.8.33

9 years ago

1.8.32

9 years ago

1.8.31

9 years ago

1.8.30

9 years ago

1.8.29

9 years ago

1.8.28

9 years ago

1.8.27

9 years ago

1.8.26

9 years ago

1.8.25

9 years ago

1.8.24

9 years ago

1.8.23

9 years ago

1.8.22

9 years ago

1.8.21

9 years ago

1.8.20

9 years ago

1.8.19

9 years ago

1.8.18

9 years ago

1.8.17

9 years ago

1.8.16

9 years ago

1.8.15

9 years ago

1.8.14

9 years ago

1.8.13

9 years ago

1.8.12

9 years ago

1.8.11

9 years ago

1.8.10

9 years ago

1.8.9

9 years ago

1.8.8

9 years ago

1.8.7

9 years ago

1.8.6

9 years ago

1.8.5

9 years ago

1.8.4

9 years ago

1.8.3

9 years ago

1.8.2

9 years ago

1.8.1

9 years ago

1.8.0

9 years ago

1.7.2

9 years ago

1.7.1

9 years ago

1.7.0

9 years ago

1.6.9

9 years ago

1.6.8

9 years ago

1.6.7

9 years ago

1.6.6

9 years ago

1.6.5-d

9 years ago

1.6.5-c

9 years ago

1.6.5-b

9 years ago

1.6.5-a

9 years ago

1.6.5

9 years ago

1.6.4

9 years ago

1.6.3

9 years ago

1.6.2

9 years ago

1.6.1

9 years ago

1.6.0

9 years ago

1.5.1

9 years ago

1.5.0

9 years ago

1.4.2

9 years ago

1.4.1

9 years ago

1.4.0

9 years ago

1.3.1

9 years ago

1.3.0

9 years ago

1.2.0

9 years ago

1.1.4

9 years ago

1.1.3

9 years ago

1.1.2

9 years ago

1.1.1

9 years ago

1.1.0

9 years ago

1.0.6

9 years ago

1.0.5

9 years ago

1.0.4

9 years ago

1.0.3

9 years ago

1.0.2

9 years ago

1.0.1

9 years ago

1.0.0

9 years ago