{"id":35828320,"url":"https://github.com/javascript-pro/crypto-casino","last_synced_at":"2026-01-07T21:04:39.996Z","repository":{"id":303141048,"uuid":"1014516688","full_name":"javascript-pro/crypto-casino","owner":"javascript-pro","description":"A Web3 demo app for a provably fair crypto dice game. Built with Next.js, wagmi, viem, and RainbowKit. Includes wallet connection, smart contract interaction, and testnet or local blockchain support. Designed to showcase modern frontend patterns for decentralized apps.","archived":false,"fork":false,"pushed_at":"2025-07-05T23:19:13.000Z","size":191,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-07-05T23:29:33.228Z","etag":null,"topics":["blockchain","casino"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/javascript-pro.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-07-05T22:04:27.000Z","updated_at":"2025-07-05T23:19:17.000Z","dependencies_parsed_at":"2025-07-05T23:29:39.193Z","dependency_job_id":"e35c839e-d2dc-4516-ac12-dee0805689dd","html_url":"https://github.com/javascript-pro/crypto-casino","commit_stats":null,"previous_names":["javascript-pro/crypto-casino"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/javascript-pro/crypto-casino","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/javascript-pro%2Fcrypto-casino","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/javascript-pro%2Fcrypto-casino/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/javascript-pro%2Fcrypto-casino/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/javascript-pro%2Fcrypto-casino/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/javascript-pro","download_url":"https://codeload.github.com/javascript-pro/crypto-casino/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/javascript-pro%2Fcrypto-casino/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28237781,"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","status":"online","status_checked_at":"2026-01-07T02:00:05.975Z","response_time":58,"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":["blockchain","casino"],"created_at":"2026-01-07T21:02:51.179Z","updated_at":"2026-01-07T21:04:39.984Z","avatar_url":"https://github.com/javascript-pro.png","language":"TypeScript","readme":"# Blockchain iGaming\n\nI’m a senior JavaScript developer with over 20 years of experience, currently focused on building high-performance frontend applications using React and TypeScript. Most relevantly, I worked with a Maltese iGaming company — where I contributed to the development of a crypto casino platform.\n\nThat project had no fiat onramps, no KYC, and no banks — users could deposit and withdraw Bitcoin directly, and the games were provably fair.\n\nI was brought on to help shape the frontend architecture, and we built everything from scratch — wallet integrations, animations, real-time UI updates, and a clean user experience tuned for conversion. It was a fast-paced environment, with a small team and a lot of freedom to make technical decisions.\n\nBefore that, I’ve worked across a range of industries — and led frontend teams, shipped PWAs, and built full platforms using modern CI/CD and containerized deployments. I’m especially interested in modular, composable frontend systems and collaborative product development.\n\nWhat draws me to blockchain iGaming and Web3 is the combination of technical ambition and product focus — I like working in gaming, crypto, and DeFi, and solving real-world UX challenges at scale.\n\n## Crypto Casino – Technology Overview (Non-Technical)\n\nThis demo simulates a simple online dice game where users connect their cryptocurrency wallet, roll a dice, and see the result. Behind the scenes, it uses modern tools to ensure the game is **fair**, **secure**, and **transparent**.\n\n## Website Frontend\n\n### Next.js  \nModern framework for building fast and efficient websites. It powers the structure and navigation of our app.\n\n### React  \nHelps us build reusable UI components like buttons, forms, and displays.\n\n### MUI (Material UI)  \nA design system that provides clean, responsive UI elements like cards, buttons, and grids.\n\n## Crypto Integration\n\n### RainbowKit + WalletConnect  \nEnables users to connect their cryptocurrency wallets (like MetaMask) to the app.\n\n### wagmi  \nA toolkit that makes it easy to send transactions and talk to the blockchain from our React app.\n\n### viem  \nPerforms cryptographic operations like hashing, which we use to make the dice game provably fair.\n\n## Provably Fair Dice Game\n\nWe ensure fairness through this process:\n\n1. User generates a secret number (seed).\n2. The app creates a hash of the seed and sends it to the blockchain.\n3. Later, the seed is revealed and verified.\n4. The result is calculated from the original seed.\n\nThis approach proves the result wasn’t tampered with — even by the developer.\n\n## Smart Contracts\n\n### Solidity  \nThe programming language used to write the blockchain-based game logic.\n\n### Hardhat  \nA tool that runs a local Ethereum blockchain on your computer. It’s perfect for testing contracts before going live.\n\n## Development Tools\n\n### TypeScript  \nAdds better error checking to JavaScript. Helps developers catch mistakes early.\n\n### Vercel  \nHosts the finished app so anyone can access it online. Fast and scalable.\n\n## Technology Summary\n\n| Area              | Technology                    | Purpose                                          |\n|-------------------|-------------------------------|--------------------------------------------------|\n| Website           | Next.js + React               | Build and organize the frontend interface        |\n| Design            | MUI                           | Professional, responsive UI components           |\n| Wallet Connect    | RainbowKit + WalletConnect    | Let users connect crypto wallets                 |\n| Blockchain Access | wagmi + viem                  | Communicate securely with Ethereum               |\n| Game Logic        | Solidity                      | Code the rules of the game on the blockchain     |\n| Local Dev Chain   | Hardhat                       | Simulate blockchain for testing                  |\n| Hosting           | Vercel                        | Make the app live on the internet                |\n\n## Summary\n\nCrypto Casino is a showcase of how modern web and blockchain tools can work together to create a fully transparent, user-controlled game. Every roll is verifiable, and every action is owned by the user.\n\nA Web3-enabled demo app that simulates a provably fair dice game using smart contracts and modern frontend tools. Built with **Next.js (App Router)**, **wagmi**, **viem**, **RainbowKit**, and **Hardhat**.\n\n## Tech Stack\n\n| Layer          | Tech Used                                      |\n|----------------|------------------------------------------------|\n| Frontend       | Next.js (App Router), Tailwind CSS, TypeScript |\n| Wallet         | RainbowKit + wagmi + viem                      |\n| Blockchain     | Local Ethereum blockchain (Hardhat)            |\n| Smart Contract | Solidity (DiceGame.sol)                        |\n| Dev Tools      | Ethers v6, Hardhat Toolbox, React Query        |\n\n## Features\n\n- Wallet connection with MetaMask / WalletConnect\n- Provably fair dice game using KECCAK-256 hash\n- Smart contract interactions (commit + reveal)\n- Automatic UI updates from `Reveal` events\n- Fully functional local development with test accounts\n\n## Getting Started\n\n### 1. Clone the Repo\n\n```bash\ngit clone https://github.com/javascript-pro/crypto-casino.git\ncd crypto-casino\n```\n\n### 2. Install Dependencies\n\n```bash\nyarn install\n```\n\n### 3. Start Local Blockchain\n\n```bash\nnpx hardhat node\n```\n\nThis runs a local Ethereum network on `http://127.0.0.1:8545`.\n\n### 4. Deploy the Smart Contract\n\nIn a second terminal tab:\n\n```bash\nnpx hardhat run scripts/deploy.js --network localhost\n```\n\nCopy the address printed in the output and paste it into:\n\n```ts\n// src/lib/contracts.ts\nexport const DICE_GAME_ADDRESS = '0x...'\n```\n\n### 5. Run the Frontend\n\n```bash\nyarn dev\n```\n\nVisit [http://localhost:3000](http://localhost:3000)\n\n## Wallet Setup (MetaMask)\n\n1. Add a **Custom Network** in MetaMask:\n   - Name: Hardhat Localhost  \n   - RPC URL: `http://127.0.0.1:8545`  \n   - Chain ID: `31337`\n\n2. Import an account using one of the private keys shown by `npx hardhat node`.\n\n## How the Game Works\n\n1. Generate a random seed client-side.\n2. Compute the KECCAK-256 hash of the seed.\n3. Call `commit(hash)` on the contract.\n4. Later, call `reveal(seed)` to verify the hash.\n5. The contract emits a `Reveal` event with your dice roll result (1–6).\n\nThis pattern simulates **provably fair randomness**, where the seed is secret until revealed, but verifiable after the fact.\n\n## Project Structure\n\n```\ncontracts/\n  DiceGame.sol          # Solidity smart contract\nscripts/\n  deploy.js             # Hardhat deploy script\nsrc/\n  app/                  # Next.js App Router entry\n  components/           # UI components\n  lib/\n    wagmi.ts            # wagmi config with local chain\n    contracts.ts        # Contract ABI + address\n```\n\n## Smart Contract: `DiceGame.sol`\n\n```solidity\nfunction commit(bytes32 _commitment) external;\nfunction reveal(string memory _seed) external;\nevent Reveal(address indexed player, uint8 roll, string seed);\n```\n\n## Commands Reference\n\n| Command                                                    | Description                  |\n|-------------------------------------------------------------|------------------------------|\n| `yarn dev`                                                 | Start the frontend           |\n| `npx hardhat node`                                         | Run local blockchain         |\n| `npx hardhat run scripts/deploy.js --network localhost`   | Deploy contract              |\n\n## License\n\nMIT — for educational and demo purposes only.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjavascript-pro%2Fcrypto-casino","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjavascript-pro%2Fcrypto-casino","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjavascript-pro%2Fcrypto-casino/lists"}