This README outlines how the African Trade Empire application has been enhanced with Bitcoin ecosystem cryptocurrencies (BTC, STX, and sBTC) through integration with the Stacks blockchain.
African Trade Empire is a blockchain-based trading simulation game that now incorporates Stacks wallet connectivity and a crypto trading minigame. The application simulates trading routes across Africa while leveraging Bitcoin ecosystem tokens.
- Connect with Stacks wallets (Leather and Xverse)
- Authenticate users through their Bitcoin or Stacks credentials
- View wallet balances and history
- Withdraw earned tokens directly to connected wallets
- Trade Bitcoin ecosystem assets (BTC, STX, sBTC) across global crypto hubs
- Strategic trading simulation with market price differences
- Earn real crypto rewards through gameplay
- Withdraw earned assets to your personal wallet
- Stacks Connect integration for wallet authentication
- React-based game interfaces
- Responsive design for all devices
- Framer Motion animations for smooth user experience
- Clone the repository:
git clone https://github.com/yourusername/africa-trade-empire.git
cd africa-trade-empire- Install dependencies:
npm install
# or
yarn install- Add required Stacks dependencies:
npm install @stacks/connect @stacks/transactions- Create
.env.localfile with configuration:
NEXT_PUBLIC_STACKS_NETWORK=testnet
- Start the development server:
npm run dev
# or
yarn dev├── components/
│ ├── layout/
│ │ └── Navbar.js # Navigation with wallet connection
│ ├── games/
│ │ ├── NFTTradingGame.js # Original card-based game
│ │ └── CaravanRoutesGame.js # Crypto trading simulation
│ └── ui/ # Reusable UI components
├── context/
│ └── AuthContext.js # Authentication with Stacks wallet
├── config/
│ ├── flow.config.js # Flow blockchain configuration
│ └── stacks.config.js # Stacks blockchain configuration
├── pages/
│ ├── _app.js # Application entry
│ ├── index.js # Landing page
│ ├── dashboard/ # User dashboard
│ └── play/ # Games interface
└── public/ # Static assets
The application uses Stacks Connect for wallet authentication:
import { showConnect } from '@stacks/connect';
const connectStacksWallet = async () => {
showConnect({
appDetails: {
name: 'African Trade Empire',
icon: window.location.origin + '/appIcon.jpg',
},
redirectTo: '/',
onFinish: (data) => {
setStacksUser(data.userSession.loadUserData());
},
network: 'testnet'
});
};The Crypto Caravan game allows players to trade BTC, STX, and sBTC between global markets with different price multipliers. Players can:
- Choose a trader (representing a caravan in the original game)
- Select a destination city
- Choose which cryptocurrency to trade
- Complete trades to earn profit based on market differences
- After 10 turns, withdraw earnings to their connected wallet
- Phase 1: ✅ Stacks wallet integration
- Phase 2: ✅ Crypto-themed trading game
- Phase 3: 🔄 Real token rewards system
- Phase 4: 🔄 NFT merchant marketplace
- Phase 5: 🔄 Cross-chain compatibility
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the MIT License - see the LICENSE file for details.
- Bitcoin and Stacks communities
- Stacks Connect for wallet integration
- Lucide React for beautiful icons
- Framer Motion for animations
For more information, contact: support@africantrade.empire