GithubHelp home page GithubHelp logo

michaelbeutler / poker Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 4.36 MB

Online Poker App

License: MIT License

HTML 6.33% JavaScript 72.95% CSS 0.28% SCSS 20.45%
poker poker-hands socker-io websocket reactjs redux

poker's Introduction

MIT license Open Source Love png2 Maintenance GitHub contributors GitHub actions

♠️ Poker

Poker is a websocket based online poker app for you to play against your friends. I just wanted to know poker and decided that the best way to learn it, is to build my own poker application.

πŸš€ Installation

Clone the git repository and run yarn install or npm install.

cd poker-server
yarn install
cd ../poker-client
yarn install

πŸ“¦ Dependencies

  • node-sass (^4.13.1)
  • react (^16.13.1)
  • react-dom (^16.13.1)
  • react-redux (^7.2.0)
  • react-scripts (3.4.1)
  • redux (^4.0.5)
  • redux-logger (^3.0.6)
  • redux-thunk (^2.3.0)
  • express (^4.17.1)
  • http (^0.0.1-security)
  • socket.io (^2.3.0)
  • socket.io-client (^2.3.0)
  • uuid (^7.0.3)
  • jest (^25.3.0)
  • jest-dom (^4.2.4)

🚨 Testing

All modules and components are tested with jest. To run the tests simply install the dev dependencies and run yarn test. For further information visit the wiki.

πŸ”Ž Usage

coming soon

:octocat: Authors

β™₯️ Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

πŸ“ƒ License

This project is licensed under the MIT License - see the LICENSE file for details

πŸ‘Œ Acknowledgments

  • play poker with your friends 😝

poker's People

Contributors

dependabot[bot] avatar hdptrck avatar michaelbeutler avatar

Stargazers

 avatar

Watchers

 avatar

poker's Issues

Usernames not uniqe

socket.on(LOGIN, async (data) => {
        if (data && data.username && data.username.length > 0 && !data.username.isEmpty()) {
            const username = data.username.trim().trunc(10);
            if (DEBUG) { console.log(`login ${username}`.debug) }

            players.push(new Player(io, socket, username));
            socket.login = true;
            io.to(socket.id).emit(LOGIN_SUCCESS, { username });
        } else {
            if (DEBUG) { console.log(`invalid username`.debug) }
            io.to(socket.id).emit(LOGIN_ERROR, { text: "invalid username" });
        }
});

JWT Auth

using jwt middleware: JWT Middleware

var io = require('socket.io')();
var jwtAuth = require('socketio-jwt-auth');
 
// using middleware
io.use(jwtAuth.authenticate({
  secret: 'Your Secret',    // required, used to verify the token's signature
  algorithm: 'HS256'        // optional, default to be HS256
}, function(payload, done) {
  // done is a callback, you can use it as follows
  User.findOne({id: payload.sub}, function(err, user) {
    if (err) {
      // return error
      return done(err);
    }
    if (!user) {
      // return fail with an error message
      return done(null, false, 'user does not exist');
    }
    // return success with a user info
    return done(null, user);
  });
}));

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.