A progressive Node.js framework for building efficient and scalable server-side applications.
Nest framework TypeScript starter repository.
$ npm install# development
$ npm run start
# watch mode
$ npm run start:dev
# production mode
$ npm run start:prod# unit tests
$ npm run test
# e2e tests
$ npm run test:e2e
# test coverage
$ npm run test:covThe platform maintains a centralized, immutable audit trail for critical
security-relevant actions via src/modules/audit-log.
Inject AuditLogService into any module that performs a critical action and
call create() (or createOrThrow() for operations where an unaudited
action is unacceptable):
await auditLogService.create({
userId,
action: AuditAction.ESCROW_RELEASED,
resourceType: 'Escrow',
resourceId: escrow.escrowId,
result: AuditResult.SUCCESS,
ipAddress,
userAgent,
metadata: { transactionHash },
});create() never throws — a failed audit write is logged via Logger.error
(including the action name and correlation id) and swallowed, so a broken
audit sink alone cannot fail an otherwise successful operation. Use
createOrThrow() at call sites where a missing audit record is unacceptable
(the caller is then expected to abort/roll back on failure).
All action names are centralized in AuditAction
(src/modules/audit-log/enums/audit-action.enum.ts) — auth, payment
methods, offers, orders, escrow, disputes, KYC, and admin actions. Add new
actions there rather than using free-form strings, so audit queries stay
reliable.
| Flow | Actions | Location |
|---|---|---|
| Auth | USER_LOGIN_SUCCESS, USER_LOGIN_FAILURE |
src/modules/auth |
| KYC | KYC_STATUS_UPDATED |
src/modules/kyc |
| Escrow | ESCROW_CREATED, ESCROW_FUNDED, ESCROW_RELEASED |
src/modules/escrow |
| Payment methods | PAYMENT_METHOD_CREATED/UPDATED/DELETED |
src/modules/payment-methods |
| Offers | OFFER_CREATED/UPDATED/CANCELLED |
src/modules/offer |
| Orders | ORDER_CREATED/CANCELLED/EXPIRED |
src/modules/order |
The following AuditAction values are defined and ready to use, but this
codebase has no existing flow to hook them into yet:
ESCROW_REFUNDED— no refund entrypoint currently exists;EscrowServiceonly hasopen/initialize/fund/release/syncTransaction, andsyncTransaction'sEscrowActionenum has noREFUNDcase.DISPUTE_OPENED/DISPUTE_RESOLVED— there is nodisputemodule in this codebase yet.ADMIN_ACTION_EXECUTED— there is no admin module or admin-gated entrypoint in this codebase yet.
When those flows are built, wire AuditLogService into them the same way
as the flows listed above.
metadata must be an explicitly-selected allowlist of fields — never a raw
request body or full entity dump. Never pass wallet private keys, JWTs,
webhook secrets, passwords, full bank account details, or raw identity
documents into any AuditLogService call.
When you're ready to deploy your NestJS application to production, there are some key steps you can take to ensure it runs as efficiently as possible. Check out the deployment documentation for more information.
If you are looking for a cloud-based platform to deploy your NestJS application, check out Mau, our official platform for deploying NestJS applications on AWS. Mau makes deployment straightforward and fast, requiring just a few simple steps:
$ npm install -g @nestjs/mau
$ mau deployWith Mau, you can deploy your application in just a few clicks, allowing you to focus on building features rather than managing infrastructure.
Check out a few resources that may come in handy when working with NestJS:
- Visit the NestJS Documentation to learn more about the framework.
- For questions and support, please visit our Discord channel.
- To dive deeper and get more hands-on experience, check out our official video courses.
- Deploy your application to AWS with the help of NestJS Mau in just a few clicks.
- Visualize your application graph and interact with the NestJS application in real-time using NestJS Devtools.
- Need help with your project (part-time to full-time)? Check out our official enterprise support.
- To stay in the loop and get updates, follow us on X and LinkedIn.
- Looking for a job, or have a job to offer? Check out our official Jobs board.
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.