Crypto Crash Backend
Crypto Crash is a Node.js and Express backend for a provably fair 'Crash' betting game, integrating real-time cryptocurrency prices and multiplayer game logic.
Crypto Crash Backend Preview

Project Overview

Crypto Crash is a backend implementation of the popular Crash game, where players bet in USD, converted to BTC/ETH at real-time prices. Players watch a multiplier rise and must cash out before the game crashes at a random, provably fair point. The backend manages game rounds, player actions, and real-time updates using Socket.io.

Goals

  • Implement a multiplayer Crash game backend with provably fair mechanics.
  • Integrate real-time cryptocurrency prices for USD-to-crypto conversion.
  • Store game state, player actions, and transaction history in MongoDB.
  • Provide real-time game updates and player interactions via WebSockets.

Key Features

  • Crash Game Logic
    Rounds start every 10 seconds, multiplier increases, and crashes at a random point. Players bet and cash out in real time.
  • Crypto Integration
    Fetches live prices from CoinGecko, converts USD bets to BTC/ETH, and simulates player wallets.
  • Provably Fair Algorithm
    Crash point is generated using SHA256 hashing for transparency and fairness.
  • WebSocket Real-Time Updates
    Players receive live game state, multiplier changes, and can cash out instantly.
  • MongoDB Persistence
    Stores rounds, bets, cashouts, and transaction logs for audit and history.
  • Session-Based Authentication
    Protects game and player routes using Express sessions.

Live Demo & Preview

Currently Not Available.

Technologies Used

Node.js
Express
MongoDB
Socket.io
Ejs
axios
dotenv
mongoose

Architecture & Workflow

Backend Architecture Diagram

Built with Node.js, Express, and Socket.io for real-time multiplayer. MongoDB is used for persistent storage. Game logic and crypto price integration are handled in dedicated service modules. EJS templates provide basic UI for signup, login, and gameplay.

Additional Screenshots

Currently Not Available.

Planned Enhancements

  • Upcoming Features
    • Add player wallet management and transaction history UI.
    • Improve error handling and input validation.
    • Add support for more cryptocurrencies.
    • Implement admin dashboard for round and player monitoring.
    • Enhance provably fair verification with public seed display.