8000 GitHub - Avijit07x/Gambles: GamBles is a full-stack betting game platform inspired by Stake.com, built using the MERN stack (MongoDB, Express.js, React, Node.js). It features wallet-based betting with a Mines and Dice game, user authentication, wallet tracking, and transaction history โ€” all wrapped in a modern, responsive UI. ยท GitHub
[go: up one dir, main page]

Skip to content
Avijit07xPublic
forked from Yashh1524/Gambles

About

GamBles is a full-stack betting game platform inspired by Stake.com, built using the MERN stack (MongoDB, Express.js, React, Node.js). It features wallet-based betting with a Mines and Dice game, user authentication, wallet tracking, and transaction history โ€” all wrapped in a modern, responsive UI.

Resources

Stars

1 star

Watchers

0 watching

Forks

ย 
ย 

Latest commit

ย 

History

109 Commits

Folders and files

NameName
Last commit message
Last commit date
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐ŸŽฎ GamBles โ€“ Stake-Inspired Betting App(MERN Stack)

GamBles is a full-stack betting game platform inspired by Stake.com, built using the MERN stack (MongoDB, Express.js, React, Node.js). It features wallet-based betting with a Mines and Dice game, user authentication, wallet tracking, and transaction history โ€” all wrapped in a modern, responsive UI.

โš ๏ธ This is a learning project and not crypto-based. All funds and bets are simulated with virtual money.


๐Ÿ”— Demo Video ๐Ÿ”— Live Link

๐Ÿš€ Features

  • ๐Ÿ” JWT-based authentication with secure refresh tokens
  • ๐Ÿงฉ Mines game & ๐ŸŽฒ Dice game with profit logic
  • ๐Ÿ’ฐ Real-time wallet system and day-wise and bet-wise wallet graph
  • ๐Ÿ“Š User bet stats and winning streak tracking
  • ๐Ÿ“ค Deposit/withdraw transactions with Razorpay simulation
  • ๐Ÿ›ก๏ธ Admin view and user activity logging
  • ๐Ÿ“ฑ Fully responsive design using Tailwind CSS

๐Ÿ“ฆ Tech Stack

  • Frontend: React, Tailwind CSS, Vite
  • Backend: Node.js, Express.js
  • Database: MongoDB
  • Authentication: JWT (access + refresh tokens)
  • Payments (Simulated): Razorpay
  • Email + OAuth: Resend, Gmail, GitHub
  • Docs: Postman Collection

๐Ÿ“– API Documentation

Explore the complete Postman API collection here:
๐Ÿ”— GamBles Postman Docs

โœจ Highlighted Endpoints

๐Ÿ‘ค User Routes (/api/user)

  • POST /register โ€“ Register new user
  • POST /login โ€“ Log in with credentials
  • POST /logout โ€“ Logout session
  • GET /my-details โ€“ Get logged-in user details
  • POST /refresh-token โ€“ Refresh access token
  • POST /resend-verification โ€“ Resend email verification
  • POST /reset-password โ€“ Request OTP for reset
  • POST /verify-reset-password-otp โ€“ Verify OTP
  • POST /set-new-password โ€“ Reset password
  • GET /get-day-wise-wallet-stats โ€“ Wallet graph data
  • POST /deposit-money โ€“ Add virtual funds

๐Ÿ•น๏ธ Game Routes (/api/games)

  • POST /mines/start-mine โ€“ Start new mines game
  • PATCH /mines/reveal-tile โ€“ Reveal a tile
  • POST /mines/end-mine โ€“ End and cash out
  • POST /dice/roll-dice โ€“ Roll dice and win/lose

๐ŸŽฏ Bet Routes (/api/bet)

  • POST /create-bet โ€“ Record a game bet
  • GET /fetch-bets-by-user โ€“ Get all user bets
  • POST /fetch-user-bet-by-game โ€“ Filter bets by game
  • GET /get-user-totalwin-and-winningstreak โ€“ Stats summary

๐Ÿ’ธ Transaction Routes (/api/transaction)

  • POST /create-transaction โ€“ Deposit/Withdraw money
  • GET /get-all-transaction-by-user-id โ€“ Get full transaction history
  • POST /update-transaction-status โ€“ Admin: update payout status

๐Ÿงพ Razorpay Routes (/api/razorpay)

  • POST /create-deposit-order โ€“ Start a simulated Razorpay order
  • POST /verify-deposit-payment โ€“ Verify simulated deposit
  • POST /withdraw-payout-razorpay โ€“ Simulated Razorpay payout

๐Ÿ“ Environment Variables

๐Ÿ” Backend โ€“ server/.env

MONGODB_URI=your_mongo_uri
SECRET_KEY_ACCESS_TOKEN=your_access_secret
SECRET_KEY_REFRESH_TOKEN=your_refresh_secret
NODE_ENV=development

CLIENT_URL=http://localhost:5173
SERVER_URL=http://localhost:3000

RESEND_API_KEY=your_resend_api_key

SMTP_USER=your_smtp_user
SMTP_PASSWORD=your_smtp_password
SENDER_EMAIL=your_sender_email

GOOGLE_CLIENT_ID=your_google_client_id
GOOGLE_CLIENT_SECRET=your_google_client_secret

GITHUB_CLIENT_ID=your_github_client_id
GITHUB_CLIENT_SECRET=your_github_client_secret

RAZORPAY_KEY_ID=your_razorpay_key_id
RAZORPAY_KEY_SECRET=your_razorpay_key_secret
RAZORPAYX_ACCOUNT_NUMBER=your_account_number

๐Ÿ’ป Frontend โ€“ client/.env

VITE_API_URL=http://localhost:3000
VITE_RAZORPAY_KEY_ID=your_razorpay_key_id

๐Ÿ› ๏ธ Getting Started

# 1. Clone the repository
git clone https://github.com/YashBhut1524/Gambles
cd Gambles

# 2. Set up frontend
cd client
npm install
cp .env.example .env
# Add your VITE_API_URL and Razorpay Key

# 3. Set up backend
cd ../server
npm install
cp .env.example .env
# Fill out all required keys in .env

# 4. Run development servers
npm run dev     # in /server
npm run dev     # in /client

๐Ÿ“ธ Screenshots



๐Ÿ”— Connect with Me


๐Ÿง‘โ€๐Ÿ’ป License

This project is open-source and available under the MIT License.


๐Ÿค Contributing

Feel free to fork the repo, open issues, or submit pull requests. All suggestions, features, or improvements are welcome!

About

GamBles is a full-stack betting game platform inspired by Stake.com, bui 531F lt using the MERN stack (MongoDB, Express.js, React, Node.js). It features wallet-based betting with a Mines and Dice game, user authentication, wallet tracking, and transaction history โ€” all wrapped in a modern, responsive UI.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages

0