BattlesBit Documentation
Welcome to the BattlesBit project documentation.
What is BattlesBit?
BattlesBit is a competitive trading game platform where players:
- Pay real entry fees to join trading challenges
- Compete using virtual balance to maximize trading profits
- Winner takes the prize pool (real money)
It’s NOT real trading - it’s a skill-based competition using real market data.
How It Works
Real Money (Entry Fee) → Virtual Trading Balance → Compete → Winner Takes PrizeGame Flow
- Join: Pay entry fee from your wallet
- Trade: Use virtual $100 USDT to open positions
- Compete: Trade using real Binance market data
- Win: Highest profit wins the prize pool + XP + rewards
Projects Overview
| Project | Description | Progress |
|---|---|---|
| Backend | Go-based API server | V1 Complete |
| Admin Panel | React Admin dashboard | V1 Complete |
| Mobile App | Ionic/Capacitor app | ~60% |
| Infrastructure | Terraform IaC | Active |
Backend Service
The core API server handling all business logic.
Tech Stack:
| Technology | Purpose |
|---|---|
| Go | Backend language |
| PostgreSQL | Database (Ent ORM) |
| GraphQL | API layer (gqlgen) |
| NATS JetStream | Event messaging |
| Temporal | Workflow orchestration |
| Solana | Blockchain integration |
| Binance | Market data provider |
Key Features:
- Wallet & settlement system
- Position management
- Real-time PnL calculation
- Matchmaking
- Achievement system
- Notifications
Admin Panel
Internal dashboard for platform management.
Tech Stack:
| Technology | Purpose |
|---|---|
| React 19 | UI framework |
| React Admin 5 | Admin framework |
| MUI 7 | UI components |
| URQL | GraphQL client |
| Vite | Build tool |
| TypeScript | Type safety |
Key Features:
- User management
- Game/Match management
- Wallet administration
- Transaction oversight
- Achievement configuration
- Store management
Mobile Application
The primary user-facing app for iOS, Android, and Web.
Tech Stack:
| Technology | Purpose |
|---|---|
| React 19 | UI framework |
| Ionic React | Mobile UI |
| Capacitor 6 | Native bridge |
| MUI 6 | Components |
| URQL | GraphQL client |
| Zustand | State management |
| Lightweight Charts | Trading charts |
| GSAP | Animations |
Key Features:
- User authentication (email OTP)
- Challenge browsing and joining
- Real-time trading interface
- Live PnL tracking
- Wallet management
- Achievement system
- Leaderboard
Infrastructure
Infrastructure as Code managing DNS, domains, and deployments.
Tech Stack:
| Technology | Purpose |
|---|---|
| Terraform | Infrastructure as Code |
| Terraform Cloud | Remote state |
| Cloudflare | DNS & CDN |
| Cloudflare Pages | Static hosting |
Managed Resources:
- 7 domains (battlesbit.com, .ir, .xyz, etc.)
- 4 Cloudflare Pages projects
- DNS records & email configuration
- Dev environment routing
Current Status
Backend (V1 Complete)
| Status | Modules |
|---|---|
| Done | Wallet, Positions, Room-Based Matching, Achievements, Notifications, Risk Management, Challenge Rules, Match Lifecycle, Social, Analytics, Anti-Cheat (V1), Equity/Margin |
| V2 | ML anti-cheat, Stop-limit/OCO orders, Multi-provider market data |
Admin (~60%)
| Status | Resources |
|---|---|
| Done | Users, Games, Achievements, Badges, Consumables, Risk Management Fields, Challenge Rules |
| In Progress | Analytics dashboard, User Moderation |
| Planned | Audit logs, Advanced analytics |
Mobile (~60%)
| Status | Modules |
|---|---|
| Done | Auth, Challenges, Trading UI, Charts, Achievements |
| In Progress | Wallet flows, Profile editing, Store |
| Planned | Push notifications, Social features, Deep links |
Quick Links
| Section | Description |
|---|---|
| Backend Feature Tracking | Backend development progress |
| Admin Feature Tracking | Admin panel progress |
| Mobile Feature Tracking | Mobile app progress |
| Trading Module | Position management details |
| Challenge Module | Game and match system |
| Mobile Screens | Screen documentation |
| Domains & DNS | Domain configuration |
| Deployments | Cloudflare Pages setup |
| Contributing | How to contribute |
Architecture
┌─────────────────────────────────────────────────────────────┐
│ Mobile App │
│ (React + Ionic + Capacitor) │
│ iOS / Android / Web │
└─────────────────────────────────────────────────────────────┘
│
│ GraphQL
▼
┌─────────────────────────────────────────────────────────────┐
│ Backend Service │
│ (Go) │
├─────────────────────────────────────────────────────────────┤
│ GraphQL API │ Usecases │ Ent ORM │ Temporal │ NATS │
└─────────────────────────────────────────────────────────────┘
│ │ │ │
▼ ▼ ▼ ▼
PostgreSQL Binance WS Solana Redis
(Database) (Market Data) (Blockchain) (Cache)
┌─────────────────────────────────────────────────────────────┐
│ Admin Panel │
│ (React Admin) │
└─────────────────────────────────────────────────────────────┘
│
│ GraphQL
▼
Backend ServiceLast updated on