New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

@rotorsoft/eventually-service-expg

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@rotorsoft/eventually-service-expg

Generic Service with Express and Postgres Adapters

latest
Source
npmnpm
Version
1.1.6
Version published
Maintainers
1
Created
Source

Generic Services

In eventually, we try to separate core domain concerns from system abstractions. This approach allows us the flexibility to compose artifacts in different service-level configurations as the business requirements evolve.

We can have a group of developers focusing on the domain (business rules), and a second group of system engineers and architects (configurators) focusing on the higher level system abstraction: how to compose the system today given these artifacts and the facts we are collecting from them. These include:

  • Projections
  • Subscriptions
  • Deployment
  • Scalability requirements
  • Competing consumers
  • Stream splitting
  • Concurrent or serialized flows
  • Integration tests

Layers

eventually-service-expg implements a specific generic service using Express and Postgres adapters, and can be easily configured by declaring the required artifacts in package.json.

Steps to build a generic service

  • Create project (optional) - a service can be started just by pointing at a folder with an installed package.json and .env file)
mkdir generic-service
cd generic-service
npm init -y
npm i @rotorsoft/eventually-service-expg @rotorsoft/calculator-artifacts
  • Declare the artifacts you want to deploy in package.json under the eventually section
  • Add a start script pointing to the generic service index
{
    "name": "generic-service",
    "description": "Generic Service",
    "version": "1.0.0",
    "main": "index.js",
    "scripts": {
        "start": "node ./node_modules/@rotorsoft/eventually-service-expg/dist"
    },
    "author": {
        "name": "name",
        "email": "email@email.com"
    },
    "license": "ISC",
    "keywords": [],
    "dependencies": {
        "@rotorsoft/calculator-artifacts": "^1.0.0",
        "@rotorsoft/eventually-service-expg": "^1.0.0"
    },
    "eventually": {
        "store": "calculator",
        "artifacts": {
            "@rotorsoft/calculator-artifacts": [
                { "name": "Calculator" }, 
                { "name": "Counter", "scope": "private" }, 
                { "name": "PressKeyAdapter" }
            ]
        }
    }
}
  • Configure PG in .env file
LOG_LEVEL="info"
PG_HOST="localhost"
PG_USER="postgres"
PG_DATABASE="postgres"
PG_PASSWORD="postgres"
  • Run Service
npm run start

FAQs

Package last updated on 05 Oct 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts