open-index/open-npm huggingface dataset:
npm package: @galaxyops/instances
Description: An API for maintaining game instances
Latest version: 2.2.0

# cats-cradle/instances

[![GitHub Stars](https://img.shields.io/github/stars/hxtree/galaxyops?style=social)](https://github.com/hxtree/galaxyops/stargazers)

This service tracks instances. A instance is a unique Id used to define
boundaries of other systems. Other than when it was created and whether it
exists, not much else is managed by this service.

For example, when playing a game each user could be assigned to an instance. If
two or more players were assigned to the same instance, they would share the
game experience. Meaning what happens in one users game would happen in the
others user game.

This concept can be applied to many other business use cases, but the service is
primarily useful for maintaining isolation of data that spans multiple services.

## Time

Time is displayed to the User using a HT format.

HT stands for Hadean Time which is the time period in which the universe began,
5 billion years ago.

Time progresses in reverse. The "-" before the time period indicates that it is
a count down until our universe begins.

Time Format:

-00E-053-0125HT

Game time is always be going. There should be no downtime while accessing menus.
When a player select a character and goes into their gear menu they adjust it
live with while the majority of the screen is visible.

A pause feature may be used but would freeze all players menu in a game
instance.

## World Story

The world itself has a story line that progress independently of individual
questions. When world story line progresses all players are notified.
npm package: @galaxyops/luck-by-dice
Description: An API Simulating dice rolls that can be effected by luck from dice notation
Latest version: 4.2.0

# @galaxyops/luck-by-dice

[![npm version](https://badge.fury.io/js/@galaxyops%2Fluck-by-dice.svg)](https://badge.fury.io/js/@galaxyops%2Fluck-by-dice)
[![License](https://img.shields.io/badge/License-MIT-brightgreen.svg)](LICENSE)
![TypeScript](https://shields.io/badge/TypeScript-3178C6?logo=TypeScript&logoColor=FFF&style=flat-square)
[![GitHub Stars](https://img.shields.io/github/stars/hxtree/galaxyops?style=social)](https://github.com/hxtree/galaxyops/stargazers)

A microservice api for simulating luck based dice rolls from dice notation.

## Stacks

- [Swagger](http://localhost:3000/api/) (localhost only)
- Lambda
- ApiGateway

## Features

- **Roll**: Simulates dice roll from notation using luck.

## References

- [Words of Estimate Probability](https://en.wikipedia.org/wiki/Words_of_estimative_probability)
npm package: @galaxyops/messaging-schemas
Description: This contains Pub/Sub message schemas. These help provide loose coupling during async communication between microservices.
Latest version: 2.2.0

# @galaxyops/messaging-schemas

This contains Pub/Sub message schemas. These help provide loose coupling during
async communication between microservices.

- SNS topics are deployed with the message broker.
- SQS deployments should be owned by consumer.

## Naming Convention

```txt
CONTEXT - VERB - CATEGORY
```

e.g.

- EmailSendCommand
- UserPasswordResetEvent
- PlayerDisconnectedEvent
- CharacterRankRequest

## Message Categories

**Command** Command send a idempotent request to a topic asking subscribers to
perform task. The consumer of a command does not inform or provide a response to
the publisher. The publisher expects something to occur as a result of the
request.

> Publisher -> SNS -> SQS -> Consumer

**Event** Publish to a SNS topic informing any subscribers that something
occurred within a given system. Events published may be significant events that
were published only for the purpose of data retention and analytic purposes.

> Publisher -> SNS -> SQS -> Consumer

**Request** Publish an async message to a single queue letting them know which
queue to send a reply to.

> Publisher -> SQS -> Consumer -> (SQS -> Publisher)

**Reply** In response to a request publish an message to a single queue as
request.

> (Publisher -> SQS) -> Consumer -> SQS -> Publisher

## References

- [Pub/Sub Messaging Schema](https://cloud.google.com/pubsub/docs/schemas)
- [Microservice Async Message Based Communication](https://medium.com/design-microservices-architecture-with-patterns/microservices-asynchronous-message-based-communication-6643bee06123)
- [Message Queue Pattern](https://badia-kharroubi.gitbooks.io/microservices-architecture/content/patterns/communication-patterns/message-queue-pattern.html)
- [Request Reply Pattern](https://aws.plainenglis.io/an-introduction-to-request-reply-pattern-and-its-uses-2a0bb74ff7d8)
- [CQRS](https://learn.microsoft.com/en-us/azure/architecture/patterns/cqrs)
- [Event Driven Schemas](https://medium.com/flippengineering/schema-and-topic-design-in-event-driven-systems-featuring-kafka-a555ddfdb8d8)
npm package: @galaxyops/nestjs-modules
Description: NestJsModules contains select reusable injectable NestJs modules for use in other packages, mainly pertaining to AWS workflows.
Latest version: 2.2.0

# @galaxyops/nestjs-modules

NestJsModules contains select reusable injectable NestJs modules for use in
other packages, mainly pertaining to AWS workflows.

## Modules

The modules are specific to workloads running on Amazon Web Services (AWS) and
are as follows:

- **SnsService**: A service for publishing AWS SNS messages.
- **S3Service**: A service for interacting with objects in AWS S3.
- **MessageService**: A service that uses a schema abstraction layer on top of
  SnsService to make publishing, subscribing, and testing events that adhere to
  a schema even easier.
- **MongooseModule** In terms of object modeling, Mongoose is preferred over
  TypeORM due to TypeORM's limited support for MongoDB, which is more suited for
  relational database management systems (RDMS), making it somewhat cumbersome
  for MongoDB usage. Additionally, employing an ORM like TypeORM may introduce
  unnecessary complexity, aligning with the lambdalith architectural style.
- **rootMongooseModule**: Makes interacting and testing with persistent data in
  MongoDB using Mongoose easier. Do not use this inside tests.
- **rootMongooseTestModule**: Makes testing Mongoose easier using a
  MongoMemoryServer. Invoke `closeInMongodConnection` to close connection after
  each test or after all test within a file depending on need to clear test
  data.

## TODO

- Add a feature to make it easy to subscribe to events.

## Documentation

- [Jest Using with MongoDB](https://jestjs.io/docs/mongodb)
- [Mongodb-memory-server](https://github.com/nodkz/mongodb-memory-server)
- [NestJS Mongoose Example](https://github.com/nestjs/nest/tree/master/sample/14-mongoose-base)
- [NestJS Configuration](https://docs.nestjs.com/techniques/configuration#getting-started)
npm package: @galaxyops/pipeline
Description: An API for simulating dice rolls and luck from dice notation
Latest version: 3.3.0

# @galaxyops/pipeline

Unstable WIP

## Steps

1. Github CI runs `rush deploy` to build each project into a compressed file and
   uploads file to S3 bucket.
2. Each deployable project features a AWS CodePipeline with a filter that is
   triggered when a file change is made to that S3 bucket.
3. CodePipeline runs deploying the project through environments.

## AWS Environments

| Environment | Description                                                    |
| ----------- | -------------------------------------------------------------- |
| `test`      | Test is where Acceptance Tests are ran.                        |
| `prod`      | Production is where the rubber hits the road, customer facing. |
| `build`     | Build is where the pipeline are provisioned from.              |

Default policy `AdministratorAccess`

Pipelines should accept a stage param as to build feature branches.

Prior to being able to deploy to an account te account being deployed into must
be
[bootstrapped](https://docs.aws.amazon.com/cdk/api/v1/docs/pipelines-readme.html#cdk-environment-bootstrapping)
to allow the tools to deploy to it.

```bash
CDK_NEW_BOOTSTRAP=1 cdk bootstrap
   --profile tools \
   --cloudformation-execution-policies arn:aws:iam::aws:policy/AdministratorAccess \
   --trust 760440398296
   aws://298217020330/us-east-2 \
```

- **DevOps CI/CD:** The repository includes a robust DevOps pipeline for
  continuous integration and continuous deployment. Automated testing, build,
  and deployment processes ensure a smooth and reliable software delivery
  lifecycle.

## Documentation

- [CDK Pipeline](https://docs.aws.amazon.com/cdk/v2/guide/cdk_pipeline.html)
npm package: @galaxyops/player-achievements
Description: Service for maintaining player achievements
Latest version: 2.2.0

# cats-cradle/player-achievements

[![GitHub Stars](https://img.shields.io/github/stars/hxtree/galaxyops?style=social)](https://github.com/hxtree/galaxyops/stargazers)

A player achievement is a meta-goal defined outside a game's parameters. It is a
digital reward that signifies a player's mastery of a specific task or challenge
within a video game.

An achievement is recognized through the issuance of a trophy. Trophies come in
four distinct categories:

- **Achievement Trophies**: Bronze, Silver, Gold, and Platinum trophies for
  completing various in-game tasks, challenges, and milestones. A Player may
  only have 1 trophy for each type achievement.

- **Exploration Trophies**: Recognizing the player's curiosity and willingness
  to explore every nook and cranny of the game world.

- **Skill and Combat Trophies**: Acknowledging combat prowess, skill mastery,
  and achievements related to game-play abilities.

- **Collectible and Completion Trophies**: Given for completing collections,
  finding hidden items, or achieving 100% completion in various aspects of the
  game.

> **Note**: Achievements are coupled to the player; not the instance. A Player
> could join an instance and all party members within that instance could earn
> an achievement for completing the task as a group.