Skip to content
 
 

Latest commit

 

History

997 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Description

Nest framework TypeScript starter repository.

Concepts with code commits

Added basic project st. with following features

Architecture

img

Pre-requisites

Node version v16.14.0

npm i -g @nestjs/cli

Use full commands

## Generate a new module
nest g module <module-name>

## Generate a controller
nest g controller <module-name/controllers/controller-name>

## Generate a service
nest g service <module-name/services/service-name>

## Generate a  middleware
nest g middleware <module-name/middlewares/middleware-name>

Installation

$ yarn

Building the app

  yarn build

Running the app

# development
$ yarn run start

# watch mode
$ yarn run start:dev

# production mode
$ yarn run start:prod

Test

#Test using postman collection
 yarn test:newman

create tag

  • bump version and create tag
 #command
  yarn bumpVersion --ver ${flag/version-number}
#example
 # yarn bumpVersion --ver patch // for bug fix
 #yarn bumpVersion --ver minor // for minor changes
 #yarn bumpVersion --ver major // for major changes
  #yarn bumpVersion --ver 1.2.0 // for custom version
  • push tag
  yarn pushTag

Docs

KYC credit integration

The dashboard is the system of record for credit plans. KYC plans are delivered to @hypersign-protocol/credit-middleware version 5 through BullMQ schema-v3 commands.

Required Redis configuration:

  • CREDIT_REDIS_URL, or REDIS_HOST plus REDIS_PORT;
  • the same Redis instance used by the KYC service; and
  • the default BullMQ prefix bull unless both applications override it.

CREDIT_LIFECYCLE_CONCURRENCY controls how many lifecycle events each dashboard pod applies to MongoDB concurrently. It defaults to 10 and must be a positive integer. Increase it only after checking MongoDB write latency and the age of the oldest waiting job on credit.lifecycle.

Transport contract:

  • service type: KYC_SERVICE;
  • grant queue: credit.commands.KYC_SERVICE;
  • lifecycle queue: credit.lifecycle;
  • grant job: credit.grant.requested;
  • envelope schema: 3.

POST /api/v1/app/:appId/credits keeps the existing UI contract: it requires only the credit amount and validity fields. The backend generates referenceId and calculates the plan's critical threshold as floor(amount * 0.40). Internal onboarding retries use a stable backend reference. The dashboard atomically finds-or-creates a plan under the unique serviceId + referenceId key and stores its expiry before publishing the grant.

The lifecycle worker applies credit.committed idempotently to the exact Mongo plan, activates plans after credit.granted, handles plan expiry and critical balance events, and validates DEV credit.observed events. DEV observations always have deductedAmount: 0; they are operational logs and do not update financial usage.

Support

Nest is an MIT-licensed open source project. It can grow thanks to the sponsors and support by the amazing backers. If you'd like to join them, please read more here.

Stay in touch

License

Nest is MIT licensed.


About

Backend service for Developer Dashboard

Resources

Contributing

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages