npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

provider-microservice-generator

v1.0.1

Published

Tool for building initial microservice.

Readme

Provider Microservice Generator

Installation

$ pnpm install -g provider-microservice-generator

Create Microservice

$ create-microservice <your-service-name>

Setup

$ pnpm install
$ cp .env-example.env .env file

Then modify .env credentials

Compile and run the project

$ pnpm run start:dev

Microservice Description

This package allows you to create initial modules that is needed when creating microservice for different providers

Miscroservice Flow

Microservice Flow

Folder Structure

Below are the different folders within the microservice package and their usage

| Folder | Module | Description | | ------ | ------------- | ------------------------------------------------- | | Common | constants | Contants accross the microservice. | | Common | helpers | Utility functions accross the microservice. | | Common | https | Wallet Endpoints in connecting different clients. | | Common | interface | Defines the structure of the variable or object. | | Config | cache | config for redis cache | | Config | database | config for database connection | | Module | Casino Tokens | Module for casino details | | Module | Game | Module for Games | | Module | Player | Module for Player | | Module | Player | Module for Player | | Module | Session | Module for Session | | Module | Shared | Module for that can be used by different modules | | Module | Transaction | Module for Transaction | | Module | Wallet | Module for Wallet |

Transaction Endpoints

  • Balance - Use in retrieving player's balance from wallet.
  • Bet - Use to deduct amount from wallet.
  • Win - Use to add amount from wallet.
  • Rollback - Use to add amount from wallet.

Transaction Endpoint Validations

  • Each endpoints may have different validations based on the provider documentation but this package can help you in designing initial structure and just modify other services based on the provider documentation.

Validations, services within the Provider Module includes basic example only. Additional changes may apply based on the provider's documentation.

| Microservice | Validations | | -------------- | ---------------------------------------------------------------------------------------------------- | | Balance | Validation of Client ID. | | Balance | Validation of Session, Player, Game and Casino details from DB or Cache (based on its availability). | | Balance | Provider Validation: Player, Game and Currency | | Balance | Wallet Validation: Get balance | | Bet | Validation of Client ID. | | Bet | Validation of Session, Player, Game and Casino details from DB or Cache (based on its availability). | | Bet | Provider Validation: Player, Game and Currency | | Bet | Transactional Validation: Repeated & Duplicate Transaction | | Bet | Wallet Validation: Get balance | | Bet | Transactional Validation: Invalid amount for balance (Bet > Win) | | Bet | Wallet Validation: Update balance | | Win & Rollback | Validation of Client ID. | | Win & Rollback | Validation of Session, Player, Game and Casino details from DB or Cache (based on its availability). | | Win & Rollback | Provider Validation: Player, Game and Currency | | Win & Rollback | Transactional Validation: Repeated, Invalid Reference Transaction & Duplicate Transaction | | Win & Rollback | Wallet Validation: Get balance | | Win & Rollback | Transactional Validation: Invalid amount for balance (Bet > Win) | | Win & Rollback | Wallet Validation: Update balance |

Connections

  • MySQL DB - Major source of all data.
  • Redis - Temporary source of data for faster transactions.
  • SQS - Queing for updating transactions (Not Yet Available).
  • DynamoDB - Use to cater Multi Region (Not Yet Available).

Logs

  • Provider Logs - These logs are the request and response logs within the provider module.
  • Incall Logs - These logs are the request coming from the client to the microservice.
  • Outcall Logs - These logs are the request coming from the microservice to the client.
  • File Logs - Coming Soon (Not Yet Available).

Versions

Node: 20.18.0 Nest: 11.0.4 Pnpm: 9.14.4