Files
lolympus-tournament-support/apps/api

Nest Logo

A progressive Node.js framework for building efficient and scalable server-side applications.

NPM Version Package License NPM Downloads CircleCI Discord Backers on Open Collective Sponsors on Open Collective Donate us Support us Follow us on Twitter

Description

Nest framework TypeScript starter repository.

Riot Background Refresh

Stale Riot accounts refresh automatically between KST 03:00 and 10:00. The scheduler picks active users whose lastRefreshRequestedAt is older than 6 hours, oldest first, and uses a background-only Riot token bucket capped at roughly 40% of the app rate limit.

Project setup

$ pnpm install

Compile and run the project

# development
$ pnpm run start

# watch mode
$ pnpm run start:dev

# production mode
$ pnpm run start:prod

Run tests

# unit tests
$ pnpm run test

# e2e tests
$ pnpm run test:e2e

# test coverage
$ pnpm run test:cov

# auction cancellation/undo transactions against a real local MongoDB replica set
$ pnpm run test:mongodb

test:mongodb requires mongod on PATH, or MONGODB_TEST_SERVER set to its executable path. The runner starts an isolated replica set on a random loopback port, uses a temporary database directory, and removes it after the tests. It does not use the application's database connection settings.

Auction durability

Accepted Redis bids now enter auction:bidArchivePayloads and auction:bidArchiveQueue atomically with the bid. The durability scheduler saves them to auctionBidRecords using deterministic IDs before removing queue entries. Recent state snapshots remain capped at 1000 bids; the archive is not capped and retains accepted bids across undo/cancellation for audit. These records begin with this deployment; bids already discarded by an older version cannot be recovered. GET /communities/:communityId/matches/:matchId/auction/bids/history pages through the current lifecycle's persisted archive using afterRevision and limit (1–200). Persistence is asynchronous, so an empty last page may gain entries afterward.

Invalid archive entries are moved atomically to auction:bidArchiveDeadLetterQueue and auction:bidArchiveDeadLetterPayloads. The payload stores the original text (or null for a missing payload), error, ID, and quarantine time. Monitor these keys and review quarantined data before repairing/requeuing it; it is not retried automatically or expired. Other bids continue to persist. Mongo write failures leave valid entries in the pending queue for idempotent retries.

Older in-flight rounds can produce bidRoundId: ''; the archive treats this as an absent optional round ID. Empty player IDs and other invalid field types remain validation errors.

Cancellation commits its completion marker and pending cleanup fields in Match. The scheduler retries cleanup after restarts, with a delay capped at 60 seconds. Reset notifications include the lifecycle to protect a newly started auction. Dead-letter status notifications use auction:deadLetterStatusQueue; failures to persist or mirror the terminal status are retried without rerunning the side effect. Older side-effect dead letters are also reconciled automatically.

Before deploying the cleanup worker, create its partial Match index using the additive, repeatable migration below. Schema declarations alone do not create indexes when MONGODB_AUTO_INDEX is disabled (the default). Choose the target environment explicitly; dry-run does not create indexes or modify documents.

pnpm --filter api auction:indexes -- --env staging --dry-run
pnpm --filter api auction:indexes -- --env staging --apply
# Use --env prod for production.

The index is { auctionCancellationCleanupRetryAt: 1 }, restricted to { auctionCancellationCleanupPending: true }. The worker only reads due pending entries; it no longer scans legacy cancellation markers without a pending flag.

Deployment

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:

$ pnpm install -g @nestjs/mau
$ mau deploy

With Mau, you can deploy your application in just a few clicks, allowing you to focus on building features rather than managing infrastructure.

Resources

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.

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.