Web3 gaming platform on Stacks blockchain with on-chain tipping using BIT tokens.
- Frontend: Vite + React + TypeScript
- Backend: Express + MongoDB Atlas
- Blockchain: Stacks (Clarity smart contracts)
- Wallet: Leather/Xverse integration via @stacks/connect
- Monorepo: pnpm workspaces
bitgame/
├─ apps/
│ ├─ web/ # Frontend (Vite + React)
│ ├─ api/ # Backend (Express + MongoDB)
│ └─ contracts/ # Clarity smart contracts
├─ games-external/ # External HTML games
└─ tools/ # Build tools & sync scripts
- Node.js 18+
- pnpm
- MongoDB Atlas account
- Clarinet (for smart contracts)
-
Install dependencies
pnpm install
-
Setup environment variables
cp .env.example .env # Edit .env with your MongoDB URI and contract addresses -
Deploy contracts (Clarinet)
cd apps/contracts clarinet integrate -
Sync external games
pnpm sync:games
-
Seed database
pnpm seed
-
Start development servers
# Terminal 1: Backend pnpm dev:api # Terminal 2: Frontend pnpm dev:web
-
Open browser
http://localhost:5173
- Wallet Integration: Connect with Leather or Xverse
- Multiple Games: Play Snake, Math Quiz, and more
- Social Feed: Share scores Twitter-style
- On-chain Tipping: Send BIT tokens to players
- Leaderboards: Compete for high scores
- Profile: View your stats and wallet balance
pnpm dev:web- Start frontend dev serverpnpm dev:api- Start backend dev serverpnpm sync:games- Sync external games to public folderpnpm seed- Seed database with initial datapnpm test:contracts- Run Clarity contract testspnpm clarinet:devnet- Start Clarinet devnet
- Create folder in
apps/web/src/games/{game-name}/ - Add
index.tsxandmanifest.json - Implement BitgameBridge SDK for score submission
- Create folder in
games-external/{game-name}/ - Add
index.htmlandmanifest.json - Run
pnpm sync:gamesto copy to public folder
SIP-010 fungible token for tipping and rewards.
On-chain game registry and score verification.
GET /api/games- List all gamesGET /api/games/:slug- Get game detailsPOST /api/games/:slug/score- Submit scoreGET /api/leaderboard/:slug- Get leaderboardGET /api/feed- Get social feedPOST /api/feed/:id/like- Like postPOST /api/feed/:id/repost- RepostPOST /api/feed/:id/tip- Record tip transaction
MIT