🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Sign inDemoInstall
Socket

@energyweb/origin-backend

Package Overview
Dependencies
Maintainers
8
Versions
1681
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@energyweb/origin-backend

API for managing users, certificate, requests and devices in the Origin project

11.2.3
latest
Source
npm
Version published
Weekly downloads
2.7K
590.26%
Maintainers
8
Weekly downloads
 
Created
Source

Energy Web Foundation Logo

Origin Backend

The Origin Backend is a NestJS application that provides services for user and organization authorization and management. The Backend application can be used in conjunction with one, several or all of the Origin SDKs to provide integrated user management and authorization.

Development

Origin-backend project is currently not meant to be run as a separate nest application. In order to run origin-backend project please refer to https://github.com/energywebfoundation/origin/tree/master/packages/origin-backend-app

Default TypeOrm configuration requires running PostgreSQL database. The detailed config with .env parameters is:

DB_HOST      - default 'localhost'
DB_PORT      - default 5432
DB_USERNAME  - default 'postgres',
DB_PASSWORD  - default 'postgres',
DB_DATABASE  - default 'origin',

or

DATABASE_URL  - postgres://{user}:{password}@{host}:{port}/{database}

Using TypeORM migrations

Exchange project uses TypeORM mechanism to perform SQL data migrations. For detailed information please refer to https://github.com/typeorm/typeorm/blob/master/docs/migrations.md

  • yarn typeorm:run to update DB to latest exchange tables schema
  • yarn typeorm:migrate SampleMigrationName to create new migration file based on the changes in the code entities

Development flow:

  • run yarn typeorm:run - to apply latest migrations
  • apply changes in the entities, like change the variable name or type
  • run yarn typeorm:migrate LastestChanges...
  • inspect newly created migration in /migrations folder
  • run yarn typeorm:run to apply newly created migration

Warning:

Existing migration files from /migration folder should never be edited after being committed.

PostgreSQL installation using Docker

docker pull postgres
docker run --name origin-postgres -e POSTGRES_PASSWORD=postgres -d -p 5432:5432 postgres

pgAdmin

docker pull dpage/pgadmin4
docker run -p 80:80 \
    -e 'PGADMIN_DEFAULT_EMAIL=user@domain.com' \
    -e 'PGADMIN_DEFAULT_PASSWORD=SuperSecret' \
    -d dpage/pgadmin4

FAQs

Package last updated on 16 Mar 2022

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