{"id":13850397,"url":"https://github.com/therewillbecode/poker-maison","last_synced_at":"2025-07-12T22:30:29.617Z","repository":{"id":51136580,"uuid":"189489104","full_name":"therewillbecode/poker-maison","owner":"therewillbecode","description":"🂺 A Multiplayer Poker App Crafted with Haskell and React","archived":false,"fork":true,"pushed_at":"2024-05-19T18:39:40.000Z","size":3369,"stargazers_count":308,"open_issues_count":9,"forks_count":35,"subscribers_count":13,"default_branch":"master","last_synced_at":"2024-08-05T20:32:37.842Z","etag":null,"topics":["cards","game","haskell","poker","react","reactjs"],"latest_commit_sha":null,"homepage":"","language":"Haskell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"ConsenSysMesh/fae-demo","license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/therewillbecode.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-05-30T22:11:45.000Z","updated_at":"2024-08-05T11:40:37.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/therewillbecode/poker-maison","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/therewillbecode%2Fpoker-maison","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/therewillbecode%2Fpoker-maison/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/therewillbecode%2Fpoker-maison/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/therewillbecode%2Fpoker-maison/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/therewillbecode","download_url":"https://codeload.github.com/therewillbecode/poker-maison/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225839486,"owners_count":17532305,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cards","game","haskell","poker","react","reactjs"],"created_at":"2024-08-04T20:01:10.314Z","updated_at":"2024-11-22T03:31:23.911Z","avatar_url":"https://github.com/therewillbecode.png","language":"Haskell","funding_links":[],"categories":["Haskell"],"sub_categories":[],"readme":"# Poker Maison\n\n## A poker app crafted with Haskell and React\n\nSupports games across multiple tables in realtime.\n\nPlayer moves are timed in order to ensure that games keep running if players disconnect.\n\nThe UI and backend are all implemented in less than seven thousand lines of code.\n\n![screenshot](https://s11.gifyu.com/images/SgQfh.gif)\n\n\n[![License: Unlicense](https://img.shields.io/badge/license-Unlicense-blue.svg)](http://unlicense.org/)\n\n![alt text](https://s5.gifyu.com/images/ezgif.com-optimize-1e35dcba1eceb51f5.gif \"Demo\")\n\n## How to run in docker\n\nSkip this section if you would rather avoid docker.\n\n### Docker Prerequisites\n\nIn order to use Docker have the following installed.\n\n- [Docker](https://docs.docker.com/compose/install/) (17.12.0+)\n- [Docker Compose](https://docs.docker.com/v17.09/engine/installation/)\n- [Docker Machine](https://docs.docker.com/machine/install-machine/)\n\nFirstly start Docker Machine\n\n```bash\ndocker-machine start\n```\n\nThen set the correct variables in your terminal so you can connect to Docker Machine\n\n```bash\neval $(docker-machine env)\n```\n\nNow build the images. This will take a while.\n\n```\ndocker-compose up\n```\n\nNow go navigate to http://192.168.99.100:3000 in your browser and the app should be running.\n\nThe above ip address is the one for your docker-machine VM if you are on the default settings. By default docker-machine doesn't serve localhost but instead uses 192.168.99.100 as the host.\n\nYou can simulate multiple players in the same game on on your machine if you navigate to the above url in a few different browser tabs. Eac time you open up a new tab just remember to log out after you have signed in as the browser will cache the access_token for the last logged in user for each new tab as URL is the same.\n\n## Common Docker Problems\n\n### Docker has the wrong TLS setting\n\nIf you get the error below then Docker Compose is not using the correct TLS version.\n\n```\nBuilding web\nERROR: SSL error: HTTPSConnectionPool(host='192.168.99.100', port=2376): Max retries exceeded with url: /v1.30/build?q=False\u0026pull=False\u0026t=server_web\u0026nocache=False\u0026forcerm=False\u0026rm=True (Caused by SSLError(SSLError(1, u'[SSL: TLSV1_ALERT_PROTOCOL_VERSION] tlsv1 alert protocol version (_ssl.c:727)'),))\n```\n\nYou can fix this by setting the following environment variable with the correct TLS version.\n\n```bash\nexport COMPOSE_TLS_VERSION=TLSv1_2\n```\n\n### Container runs out of memory\n\nIf the server docker container runs out of memory whilst building. Whis would look like this.\n\n```\n--  While building package Cabal-2.4.1.0 using:\n      /root/.stack/setup-exe-cache/x86_64-linux/Cabal-simple_mPHDZzAJ_2.4.0.1_ghc-8.6.5 --builddir=.stack-work/dist/x86_64-linux/Cabal-2.4.0.1 build --ghc-options \"\"\n    Process exited with code: ExitFailure (-9) (THIS MAY INDICATE OUT OF MEMORY)\n```\n\nThen set increase the memory available to the VM you are using for docker-machine.\nAssuming your VM is named \"default\", run:\n\n```bash\ndocker-machine stop default\nVBoxManage modifyvm default --memory 4096\ndocker-machine start default\n```\n\n### Slow builds\n\nIf you want to speed up builds then replace `n` in the command below\nwith the number of cores your machine has and run the command.\nThe command below assumes that \"default\" is the name of the VM Docker Machine is using.\n\n```bash\ndocker-machine stop default\nVBoxManage modifyvm default --cpus n\ndocker-machine start default\n```\n\n# Building locally from scratch.\n\nThe following steps are based on an Ubuntu distribution.\n\n## Back End\n\nFirstly make sure you have ghc and stack installed in order to compile the back end written in Haskell.\nIf you need to install the Haskell platform then run\n\n```bash\ncurl -sSL https://get.haskellstack.org/ | sh\n```\n\nSecondly install libpq (c bindings to postgres)\n\n```bash\nsudo apt-get install libpq-dev\n```\n\nNext install redis.\n\n```bash\nsudo apt-get install redis\n```\n\nNavigate to the server/ directory.\n\n```bash\ncd server\n```\n\nCompile the back end poker server.\n\n```bash\nstack build\n```\n\n## Now we need to set some config.\n\nEnsure postgresql 10 is installed and running.\n\nSet the env var so that the server has the postgresql connection string.\nOf course you will need to change the db connection parameters below to match your local database.\n\n```bash\nexport dbConnStr='host=0.0.0.0 port=5432 user=postgres dbname=pokerdbtest password=postgres\n```\n\nSet env variable with the secret key for generating auth tokens.\nNote that this secret must be 32 characters long or it won't work.\n\n```bash\nexport secret=\"changeme077cf4e7441c32d2d0a86b4c\"\n```\n\nLastly ensure redis-server is running in the background on default port\n\n```bash\nredis-server\n```\n\nNow run the server locally. The default user API port is 8000 and websocket port is 5000.\n\n```bash\nstack run\n```\n\n## Front End\n\nInstall node version 10.16.3 and then install yarn globally\n\n```bash\nnpm i -g yarn@1.17.3\n```\n\nInstall a required system dependency for node-sass .\n\n```bash\nsudo apt-get install libpng-dev\n```\n\nNavigate to the client/ directory with\n\n```bash\ncd client\n```\n\nThen just run.\n\n```bash\nyarn start\n```\n\nNow you are ready to play poker!\n\n### Simulating a multiplayer game locally\n\nYou may want to play against yourself when you are developing locally so just\nrun the clients on two separate ports.\n\nIn your first terminal run\n\n```\nPORT=8001 yarn start\n```\n\nThen open another terminal and run\n\n```\nPORT=8002 yarn start\n```\n\nNow just open two tabs in your browser navigating to\n\n```\nlocalhost:8001\n```\n\nand\n\n```\nlocalhost:8002\n```\n\n## Running Tests\n\nTo run the test suite on the backend which has over a hundred tests\n\n```bash\ncd server \u0026\u0026 stack test\n```\n\n## Contributions Welcome\n\nHave a look at the issues if you want some starting ideas on how to get involved.\n\nFeel free to open any issues with potential enhancements or bugs you have found.\n\n## License\n\nThis is free and unencumbered software released into the public domain.  \nFor more information, please refer to the `UNLICENSE` file or [unlicense.org](http://unlicense.org).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftherewillbecode%2Fpoker-maison","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftherewillbecode%2Fpoker-maison","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftherewillbecode%2Fpoker-maison/lists"}