{"id":50294732,"url":"https://github.com/chrisrobison/bj","last_synced_at":"2026-05-28T08:04:00.580Z","repository":{"id":274763026,"uuid":"923986703","full_name":"chrisrobison/bj","owner":"chrisrobison","description":"Safe, secure and fair crypto blackjack server and client ","archived":false,"fork":false,"pushed_at":"2025-02-15T15:31:09.000Z","size":4027,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-15T16:28:27.041Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/chrisrobison.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-01-29T07:47:26.000Z","updated_at":"2025-02-15T15:31:12.000Z","dependencies_parsed_at":null,"dependency_job_id":"4da4bf97-b258-4501-b305-6596f0e29465","html_url":"https://github.com/chrisrobison/bj","commit_stats":null,"previous_names":["chrisrobison/bj"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/chrisrobison/bj","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chrisrobison%2Fbj","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chrisrobison%2Fbj/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chrisrobison%2Fbj/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chrisrobison%2Fbj/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chrisrobison","download_url":"https://codeload.github.com/chrisrobison/bj/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chrisrobison%2Fbj/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33599494,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-05-28T02:00:06.440Z","response_time":99,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":[],"created_at":"2026-05-28T08:03:58.910Z","updated_at":"2026-05-28T08:04:00.571Z","avatar_url":"https://github.com/chrisrobison.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🎰 Real-Time Multiplayer Blackjack\n\nA modern, secure, real-time multiplayer Blackjack game implementation using WebSocket technology and Node.js. This project features a responsive web interface, secure authentication, and real-time game state management.\n\n## ✨ Features\n\n- 🎮 Real-time multiplayer gameplay using WebSocket\n- 🔐 Secure user authentication with JWT\n- 📱 Responsive web interface with modern design\n- 🎲 Multiple table support with configurable rules\n- 💰 Transaction management system\n- 🔄 Continuous game state synchronization\n- 🔌 Automatic reconnection handling with exponential backoff\n- 🔒 SSL/TLS encryption for secure communication\n\n## 🛠️ Technology Stack\n\n- **Frontend**:\n  - 🌐 HTML5, CSS3, and vanilla JavaScript\n  - 📡 WebSocket for real-time communication\n  - 👷 Web Workers for background processing\n  - 📱 Responsive design for mobile compatibility\n\n- **Backend**:\n  - ⚡ Node.js\n  - 🚀 Express.js for REST API\n  - 📡 WebSocket (ws) for real-time communication\n  - 🗄️ MySQL database with connection pooling\n  - 🔑 JWT for authentication\n\n## 🏗️ Architecture\n\nThe application follows a client-server architecture with several key components:\n\n- **Client-Side**:\n  - 🎨 Game UI (`game.html`)\n  - 🎮 Game Controller (`gameController.js`)\n  - 🔄 WebSocket Worker (`gameWorker.js`)\n  - 🔐 Authentication handling (`login.html`, `signup.html`)\n\n- **Server-Side**:\n  - 🖥️ Main server (`app.js`)\n  - 🔑 Authentication service (`auth.js`)\n  - 🎲 Game state management (`gameStateManager.js`)\n  - 🎯 Table management (`table.js`)\n  - 💳 Transaction handling (`transactions.js`)\n\n## 🚀 Setup\n\n1. Clone the repository:\n   ```bash\n   git clone https://github.com/yourusername/blackjack-multiplayer.git\n   cd blackjack-multiplayer\n   ```\n\n2. Install dependencies:\n   ```bash\n   npm install\n   ```\n\n3. Set up environment variables:\n   ```bash\n   cp .env.example .env\n   ```\n   Edit `.env` with your configuration:\n   ```\n   PORT=4444\n   DB_USER=your_db_user\n   DB_PASSWORD=your_db_password\n   DB_NAME=blackjack\n   JWT_SECRET=your_jwt_secret\n   ```\n\n4. Set up SSL certificates (required for secure WebSocket):\n   - Place your SSL certificates in the appropriate directory\n   - Update the paths in `app.js`\n\n5. Start the server:\n   ```bash\n   npm start\n   ```\n\n## 📋 Game Rules\n\n- ♠️ Standard Blackjack rules apply\n- 🎴 Configurable number of decks (default: 6)\n- 👥 Dealer must hit on soft 17\n- 💫 Double down allowed on any two cards\n- ✌️ Split allowed (including split aces)\n- 💰 Minimum bet: $1, Maximum bet: $500\n- 👥 Maximum 5 players per table\n\n## 🔒 Security Features\n\n- 🔐 SSL/TLS encryption for all communications\n- 🎫 JWT-based authentication\n- 🔑 Password hashing using SHA-256\n- 🔌 Database connection pooling\n- ✅ Input validation and sanitization\n- 🔐 Secure session management\n\n## 💻 Development\n\nTo run the project in development mode:\n\n```bash\nnpm run dev\n```\n\nThis will start the server with nodemon for automatic reloading during development.\n\n## 🧪 Testing\n\nA test client is included (`test.html`) for debugging and testing the WebSocket functionality. To use it:\n\n1. Start the server\n2. Open `test.html` in your browser\n3. Use the provided interface to test different game actions\n\n## 🤝 Contributing\n\n1. Fork the repository\n2. Create your feature branch (`git checkout -b feature/AmazingFeature`)\n3. Commit your changes (`git commit -m 'Add some AmazingFeature'`)\n4. Push to the branch (`git push origin feature/AmazingFeature`)\n5. Open a Pull Request\n\n## 📜 License\n\nThis project is licensed under the MIT License - see the LICENSE file for details.\n\n## 👏 Acknowledgments\n\n- 🎰 Inspired by classic casino Blackjack games\n- 🌟 Built with modern web technologies\n- 🚀 Designed for scalability and performance\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchrisrobison%2Fbj","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchrisrobison%2Fbj","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchrisrobison%2Fbj/lists"}