TribeWarez Terminal
terminal.tribewarez.com
A web-based Web3 gaming and DeFi hub with a retro terminal-style UI. The Terminal is the primary entry point for interacting with the TribeWarez ecosystem -- staking, swapping, managing vaults, and launching games.
Built as a Progressive Web App (PWA) installable on Android and desktop.
Features
X Connect Onboarding
New users are greeted with the XConnectWall -- a full-screen gate requiring:
- Connect X (Twitter) account via OAuth
- Connect a Solana wallet (Phantom, Solflare)
- Claim 1000 NMTC + 1000 PTtC as a welcome reward
Returning users skip the wall automatically (claim state stored in localStorage).
DeFi Panels
| Panel | Functionality |
|---|---|
| Staking | Stake PTtC with flexible, 7-day, or 30-day lock periods. Earn rewards, claim, or emergency unstake. |
| Swap | Trade PTtC/SOL and PTtC/USDC pairs with configurable slippage, real-time quotes, and balance display. |
| Vault | Deposit, withdraw, and create time-locked savings vaults. |
| User Stats | Dashboard showing total staked, rewards earned, swap count, and vault balance. |
Gaming
The Game Directory links out to ecosystem games:
- Mystic Numbers (Match-3 puzzle)
- Numerology Wars (RTS)
- Angels95 (Retro Arcade)
- Wargamez (PvP Arena)
A built-in Dice Game demo is also available directly in the terminal.
Token Access
- Faucet -- Devnet SOL airdrop for testing
- PumpedTribePanel -- PTtC info and pump.fun link
- NMTCPanel -- NMTC info and pump.fun link
- Crypto Shop -- Purchase Premium (1 month) or No-Ads via SOL or NMTC
Tech Stack
| Layer | Technology |
|---|---|
| Frontend | React 18, TypeScript, Vite 5 |
| UI | Tailwind CSS, Radix UI, shadcn-ui, Framer Motion |
| Blockchain | Solana web3.js, Wallet Adapter, SPL Token |
| State | TanStack React Query |
| Backend | Express (Node.js) |
| Runtime | Bun |
| PWA | vite-plugin-pwa (Workbox) |
| Font | JetBrains Mono |
Backend API
The Express server (server/index.ts) exposes:
| Endpoint | Purpose |
|---|---|
GET /api/health | Health check |
GET /api/x-auth/authorize | Start X OAuth flow |
GET /api/x-auth/callback | OAuth callback handler |
POST /api/x-auth/claim | Send NMTC + PTtC to user wallet |
GET /api/staking/* | Staking data (stub) |
GET /api/swap/* | Swap data (stub) |
GET /api/vault/* | Vault data (stub) |
POST /api/crypto/premium-purchase | Premium purchase via SOL/NMTC |
POST /api/crypto/no-ads-purchase | No-ads purchase via SOL/NMTC |
Solana Integration
Contract configuration lives in src/contracts/config.ts:
- Token mints for PTtC and NMTC
- Program IDs for Staking, Swap, and Vault
- Network endpoint configuration
Client SDK in src/contracts/client.ts provides StakingClient, SwapClient, and PDA helper functions.
Environment Variables
VITE_SOLANA_RPC_URL=https://testnet-solana.rpc.gateway.tribewarez.com
VITE_SOL_HELIUS_API_KEY=<helius_key>
VITE_API_BASE_URL=https://terminal.tribewarez.com
X_CLIENT_ID=<x_oauth_client_id>
X_CLIENT_SECRET=<x_oauth_client_secret>
X_CALLBACK_URL=https://terminal.tribewarez.com/api/x-auth/callback
REWARD_WALLET_PRIVATE_KEY=<treasury_wallet_key>
SOLANA_RPC_URL=https://testnet-solana.rpc.gateway.tribewarez.comDocker
The Terminal uses a multi-stage Dockerfile:
- Build stage -- Bun installs dependencies and builds the Vite frontend
- Production stage -- Node.js runs the Express server, serving static files from
dist/
Exposed on port 8882 internally, routed via VIRTUAL_HOST=terminal.tribewarez.com.