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

asset_monitoring_app_server

v1.55.1

Published

asset_monitoring_app_server

Downloads

1,358

Readme

Asset Monitoring Application Service

This repository contains the source code for the server configuration and setup for the IMI Asset Monitoring Application Server. The server listens on a port 4000.

The Asset Monitoring platform aims to leverage IoT device sensors on IMI's flow control products for near real-time monitoring and predictive maintenance. By shifting from reactive to proactive methods, utilizing sensor data, it provides timely insights and alarms, anticipating system failures and optimizing maintenance schedules. This enhances system efficiency and longevity while ensuring accessible information for all users.

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.

Prerequisites

Before we get started, we're going to need to make sure we have a few things installed and available on our machine.

Node >= 18.18.0

Minimum

MacOS
curl "https://nodejs.org/dist/latest/node-${VERSION:-$(wget -qO- https://nodejs.org/dist/latest/ | sed -nE 's|.*>node-(.*)\.pkg</a>.*|\1|p')}.pkg" > "$HOME/Downloads/node-latest.pkg" && sudo installer -store -pkg "$HOME/Downloads/node-latest.pkg" -target "/"

Other

See the installation guides available @ nodejs.org:

https://nodejs.org/en/download/package-manager/

Docker

Docker installed on your system. If you haven't installed Docker yet, you can download and install it from the official Docker website: https://www.docker.com/get-started

Docker Compose (MacOS)

brew install docker-compose

Starting the local database environment

cd prisma/local && docker-compose up -d

Ensure your container is up and running. List the containers to get the port

docker-compose ps

will log:

NAME          IMAGE                 COMMAND                 SERVICE
xx-database   postgres:13-alpine   "docker-entrypoint.s…"   database   xx minutes ago   Up xx minutes   0.0.0.0:65491->5432/tcp

Check the container's IP address, run:

docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' <NAME>

this will be the HOST value on your DATABASE_URL.

Check the container 's Port number, run:

docker inspect -f '{{range $p, $conf := .NetworkSettings.Ports}} {{$p}} -> {{$conf}} {{end}}' <NAME>

this will be the PORT value on your DATABASE_URL.

Add the postgres connection URL to the environment variable DATABASE_URL with the format specified in the .env.example

postgresql://USER:PASSWORD@HOST:PORT/DATABASE

Generate Prisma

npm run db:migrate
npm run db:generate
npm run db:seed
npm run db:studio

Installing

Below is a series of step by step instructions that tell you how to get a development env running.

Create a local clone of the repository

git clone https://[email protected]/imicci/Asset_Monitoring_Project/_git/AM-APP-SERVER

Enter the cloned repositories' directory

cd AM-APP-SERVER

Install the projects dependencies

npm i

Create a .env file based on the .env.example template (at the time of writing, no additional env vars are required)

Export the contents of the created .env file to the current terminal session.

set -o allexport; source .env; set +o allexport

Start the projects development server

npm run start

The project should now be available at http://localhost:4000

Tests

To run the projects unit test simply navigate into the projects root directory.

Then run:

npm run test

The test results should appear in your terminal.

Deployment

Deployments are handled by Azure pipelines, below is an overview of how the deployments work:

  1. Dependencies are installed with npm i
  2. Unit tests are run with npm run test
  3. Application is built npm run build
  4. Static assets are deployed to Amazon S3 and the cloudfront distribution cache is invalidated.

Environment Variables

These are the environment variables required to successfully deploy the application.

Repository Variables

| key | description | | ------------- ---------------------- |--------------------------------------------- | | API_BASE_URL | Base URL for the API | | ENVIRONMENT | Environment of the application | | PORT | Port number for the application | | LORIAT_API_KEY | API key for LORIAT integration | | LORIAT_API_URL | URL for LORIAT API | | DATABASE_URL | URL for the database connection | | SSL_CERT_BASE64 | Base64 encoded SSL certificate | | NO_REPLY_DOMAIN | Domain used for no-reply emails | | COMMUNICATION_SERVICES_CONNECTION_STRING | Connection string for communication services |

Deployment Variables

Each of the below keys need to be applied to each deployment (dev, uat, prod) and their values will be dependant on the environment.

| key | description | | ------------- ---------------------- |--------------------------------------------- | | API_BASE_URL | Base URL for the API | | ENVIRONMENT | Environment of the application | | PORT | Port number for the application | | LORIAT_API_KEY | API key for LORIAT integration | | LORIAT_API_URL | URL for LORIAT API | | DATABASE_URL | URL for the database connection | | SSL_CERT_BASE64 | Base64 encoded SSL certificate | | NO_REPLY_DOMAIN | Domain used for no-reply emails | | COMMUNICATION_SERVICES_CONNECTION_STRING | Connection string for communication services |

Built With

Details of the tech stack that has been used.

Structure

Contributing

Please read CONTRIBUTING.md for details on the SovTech standard for commit messages and the accepted pull request process.

Versioning

We use SemVer for versioning. Versioning occurs automatically in the pipelines using Semantic Release. For the versions available, see the tags on this repository.

TODO: Implement SemVer

Changelog

A running changelog can be found here: CHANGELOG.md

Licenses

Place the result of npx license-checker --summary here

├─ MIT: 457
├─ ISC: 13
├─ Apache-2.0: 7
├─ BSD-3-Clause: 6
├─ BSD-2-Clause: 4
├─ 0BSD: 2
├─ UNLICENSED: 1
├─ CC-BY-4.0: 1
└─ BSD: 1

Troubleshooting

Below are a few common issues users experience - including an overview of their possible cause and solutions.

Meta

| Version | Author | Date | | ------- | -------------------------------------------- | ---------- | | 0.0.1 | Yatin Badal [email protected] | 17/03/2020 | | 0.0.2 | Daniel Harten [email protected] | 15/06/2022 | | 0.0.3 | Daniel Harten [email protected] | 31/05/2023 | | 0.0.4 | Kuda Mhizha [email protected] | 24/05/2024 |