Giter Site home page Giter Site logo

converge-lite's Introduction

Converge Lite

(all credit to this source) for this coverage report:

Statements Branches Functions Lines Built By
Statements Branches Functions Lines BuiltBy

Top level caveats

  • This was written on an Ubuntu 20.04 (PopOS 20.04 LTS) based machine
  • Install/run scripts will work in bash shells running on Debian-like/MacOS machines
  • They will likely not run on Windows (my apologies!)

Stack

  • JS as supported by node 12.16.3
  • Testing with Jest + Supertest
  • ORM with Sequelize
  • Persistent store: Postgres 12 (running in Docker)

Dependencies

  • Node (tested with v12.16.3)
  • Express.js
  • Docker (tested with v19.03.12, build 48a66213fe)
  • If you're on a Debian machine and Docker is not installed on your machine, a helper script (./bin/install_docker.sh) is included
    • All Docker commands in subsequent scripts assuming your user is added to a 'docker' group - i.e. you can run docker commands without a sudo prefix
    • If you're on MacOS and Docker has been installed via a .dmg, you should be okay

Install

$ npm i

Run

Starting Postgres and seeding the database

Start Postgres in docker, run the sequelize migration and add custom relation constraints with:

$ npm run seed

Start Postgres + Test (with Jest)

With the current implementation, some tests run against a up-and-running local database

$ npm run seed && npm run test

Start Postgres + run server from port 8080

Without nodemon:

$ npm run start

With nodemon:

$ npm run watch

Overview of /src/

  • helpers/
    • shared utilities
  • paths/
    • Simple config for the Express.js router
  • providers/
    • At present, only higher order functions + destinations for alerting functions
  • server/
    • (A lot of boilerplace generated by the sequelize-cli) and:
    • controllers
      • Modules that funnel requests and orchestrate model data

Extra config

Email alerts

For Part three: threshold alerts, email alerts are supported given a top level .env with the following smtp configuration is supplied:

  • e.g. ./.env might look like :
ALERTER_EMAIL_HOST="smtp.your.host.com"
ALERTER_EMAIL_PORT=587
ALERTER_EMAIL_USER="[email protected]"
ALERTER_EMAIL_PW="keep_it_safe"
  • the .env variables are only picked up if process.env.NODE_ENV === 'development'
    • In all other cases, generic details from ethereal.email are used

converge-lite's People

Contributors

inbrewj avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.