Nest framework TypeScript starter repository.
Added basic project st. with following features
- Basic project st.
- Modules
- Services
- Controllers
- Middleware
- Swagger Doc
- Validation
- Exceptions
- DTOs
- Mongo Database connection
- environment var
Node version v16.14.0
npm i -g @nestjs/cli## 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>$ yarn yarn build
# development
$ yarn run start
# watch mode
$ yarn run start:dev
# production mode
$ yarn run start:prod#Test using postman collection
yarn test:newman- 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 pushTagThe 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, orREDIS_HOSTplusREDIS_PORT;- the same Redis instance used by the KYC service; and
- the default BullMQ prefix
bullunless 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.
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.
- Author - Kamil Myśliwiec
- Website - https://nestjs.com
- Twitter - @nestframework
Nest is MIT licensed.