Coder Social home page Coder Social logo

michaelkolesidis / scratch-bonanza-server Goto Github PK

View Code? Open in Web Editor NEW
4.0 1.0 0.0 55 KB

The server of Scratch Bonanza, an instant lottery game.

Home Page: https://scratch-bonanza.vercel.app/

License: GNU Affero General Public License v3.0

TypeScript 100.00%
api backend cors express game-server lottery lottery-game node nodejs number-generator online-game restful-api scratch-and-win scratchcard scratchcard-game instant-lottery instant-win

scratch-bonanza-server's Introduction

Scratch Bonanza Server

The server of Scratch Bonanza.

Instructions

1. Install the project dependencies:

yarn

2. Start the server:

yarn start

3. Start the frontend, following the instructions in the Scratch Bonanza repository.

Features

The server offers a single API endpoint that returns an array of four values chosen randomly.

Given the significance of security in the online gaming industry, where safeguarding fairness and integrity is paramount, to achieve secure random number generation, the server relies on the Crypto module of Node.js. It is specifically designed to utilize cryptographic algorithms and system-level entropy sources, ensuring the production of random output that is suitable for cryptographic operations and resistant to various attacks.

Since it is possible for Node.js to be built without including support for the node:crypto module, it is checked whether the module is available. If that is not the case, the service will fall back to using Math.random() for generating random numbers.

The values and the probability of occurrence are the following:

Value Probability
0 50%
1 30%
10 15%
100 4%
1000 1%

These are the probabilities of some scenarios to occur:

Scenario Probability
Get at least 1 coin 39.8332%
Get four 0s 6.25%
Get four 1s 0.81%
Get four 10s 0.050625%
Get four 100s 0.000256%
Get four 1000s 0.000001%

Technologies

The core technologies of Scratch Bonanza Server are Node and CORS. The following libraries and tools are used:

Name License Description
TypeScript MIT A strongly typed programming language that builds on JavaScript
Node.js MIT Cross-platform JavaScript runtime environment.
Express MIT Backend framework for building RESTful APIs with Node.js
CORS MIT Node.js CORS middleware

See Also

License

Copyright (c) 2023 Michael Kolesidis
Licensed under the GNU Affero General Public License v3.0.

scratch-bonanza-server's People

Contributors

michaelkolesidis avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.