How duynguyen658/gamedefi works
Hào Khí Đại Việt is a history-themed strategy GameFi: players enter as guests or authenticate with a wallet, choose a faction, prepare an army, select a historical campaign battle, and can use advisor, marketplace, reward, and DEX features. The frontend excerpts show the app-level navigation and wallet/faction hooks; backend route wiring and battle calculation are sampled, but most individual routes and integrations are not, so uncertain internal calls are omitted.
Main entry points: main.py FastAPI application · App.tsx App navigation · api.ts API client · dex DEX providers
Components 23
Game client
- App navigation
vietnam-history-gamefi/frontend/src/App.tsx - Game screens
vietnam-history-gamefi/frontend/src/components - Wallet session
vietnam-history-gamefi/frontend/src/hooks/useWallet.ts - Faction selection
vietnam-history-gamefi/frontend/src/hooks/useFaction.ts - API client
vietnam-history-gamefi/frontend/src/services/api.ts
Gameplay services
- FastAPI application
vietnam-history-gamefi/backend/app/main.py - Wallet and guest auth
vietnam-history-gamefi/backend/app/api/auth.py - Battle routes
vietnam-history-gamefi/backend/app/api/battle.py - Battle simulation
vietnam-history-gamefi/backend/app/domain/battle_engine.py - Game feature routes
vietnam-history-gamefi/backend/app/api - Reward claims
vietnam-history-gamefi/backend/app/api/reward.py
Blockchain and DeFi
- Blockchain routes
vietnam-history-gamefi/backend/app/api/blockchain.py - DEX routes
vietnam-history-gamefi/backend/app/api/dex.py - Solana adapter
vietnam-history-gamefi/backend/app/blockchain/solana_adapter.py - Solana game program
vietnam-history-gamefi/blockchain/solana/programs/history_game/src/lib.rs - DEX providers
vietnam-history-gamefi/backend/app/dex
State and persistence
- Gameplay state
vietnam-history-gamefi/backend/app/core/store.py - Reward persistence
vietnam-history-gamefi/backend/app/rewards/persistence.py - DEX persistence
vietnam-history-gamefi/backend/app/dex/persistence.py
Other components
- Player
- Configured database
- Solana network
- DEX networks
Connections 25
- Player → App navigation: uses
- App navigation → Game screens: renders
- App navigation → Wallet session: uses
- App navigation → Faction selection: uses
- Wallet session → API client: requests auth
- Faction selection → API client: loads and registers
- API client → FastAPI application: sends API requests
- FastAPI application → Wallet and guest auth: mounts
- FastAPI application → Battle routes: mounts
- FastAPI application → Game feature routes: mounts
- FastAPI application → Reward claims: mounts
- FastAPI application → Blockchain routes: mounts
- FastAPI application → DEX routes: mounts
- Wallet and guest auth → Gameplay state: creates players
- Battle simulation → Gameplay state: reads and records
- Reward claims → Reward persistence: persists claims
- Reward persistence → Configured database: reads and writes
- FastAPI application → DEX persistence: initializes
- DEX persistence → Configured database: reads and writes
- FastAPI application → DEX providers: creates provider
- DEX routes → DEX providers: uses provider
- DEX providers → DEX networks: trades against
- Blockchain routes → Solana adapter: resolves adapter
- Solana adapter → Solana network: submits transactions
- Solana game program → Solana network: deployed on