Web3 post-apocalyptic survival game with Solana NFT characters, real-time multiplayer, autonomous NPC system, and complex EARTH token economy.
Earth 2089 is a blockchain-based survival RPG set in a post-apocalyptic world where players mint NFT characters, explore a dangerous wasteland, mine resources, trade items, and build their survival empire. The game features a sophisticated economy backed by the EARTH token and powered by Solana blockchain technology.
- Character Creation & NFT Minting - Create unique survivors with visual customization (2 SOL mint cost)
- Post-Apocalyptic Exploration - Navigate dangerous zones on an interactive world map
- Mining & Resource Gathering - Extract valuable materials while managing energy and health
- Real-Time Trading - Buy and sell items in dynamic player-driven markets
- Character Progression - Level up through exploration, mining, and trading
- Equipment System - Customize appearance with clothing, accessories, and gear
- Solana NFT Characters - Each character is a unique NFT with metadata and visual traits
- EARTH Token Economy - In-game currency backed by SOL with transparent tokenomics
- Multi-Wallet Support - Phantom, Solflare, and other Solana wallet adapters
- Blockchain Trading - Secure, transparent item and character trading
- Token Bridge - Exchange between in-game EARTH and external currencies
- Real-Time Chat - Communicate with other players in your current location
- Live Player Tracking - See who's active in each zone
- Leaderboards - Compete for top rankings in wealth, level, and achievements
- Social Economy - Player-driven markets and collaborative gameplay
- AI-Powered Characters - Autonomous NPCs that mine, trade, and interact
- Dynamic Economy - NPCs contribute to market activity and price discovery
- Behavioral Variety - Different NPC personalities and activity patterns
- Real-Time Integration - NPCs operate continuously in the game world
- React 19 with TypeScript and Vite build system
- Tailwind CSS 4 with shadcn/ui component library
- D3.js for interactive SVG world map
- WebSocket connections for real-time features
- React Context providers for state management
- Netlify Functions - 40+ serverless API endpoints
- Supabase - Real-time database with live subscriptions
- Solana Web3.js - Blockchain operations and wallet integration
- Node.js NPC Engine - Autonomous character system
- PostgreSQL via Supabase with auto-generated TypeScript types
- Real-time subscriptions for live gameplay features
- Location-based data for world map interactions
- Character persistence with equipment and stats
- Node.js 22+
- Solana wallet (Phantom recommended)
- 2+ SOL for character minting
- Android Studio (for mobile development)
-
Clone and install:
git clone <repository-url> cd earth npm install
-
Environment setup:
cp .env.example .env # Edit .env with your actual values- Configure Supabase credentials
- Set up Solana RPC endpoints
- Add wallet keypairs for development
-
Development servers:
# Frontend development npm run dev # Backend functions npm run functions:dev # NPC engine npm run npc:dev # Generate database types npm run types
-
Access the game:
- Frontend:
http://localhost:5173 - Backend:
http://localhost:8888
- Frontend:
-
Android development:
# Build and run Android app npm run build npx cap sync android npx cap run android
- Cost: 2 SOL per character NFT
- Distribution:
- 1.0 SOL → EARTH token purchase
- 0.75 SOL → Development reserve
- 0.25 SOL → System inventory backing
- Backed Currency - Every EARTH token has SOL backing
- Starting Amount - New characters begin with 1,200 EARTH
- Use Cases - Mining equipment, trading, travel, items
- Exchange Rate - 1 EARTH ≈ $1 USD equivalent
- Player-Driven Markets - Dynamic pricing based on supply/demand
- Resource Scarcity - Limited resources create competitive mining
- Economic Zones - Different areas have varying resource availability
- NPC Market Activity - Autonomous characters contribute to liquidity
- SVG-Based Rendering - Scalable vector graphics with D3.js
- Zone-Based Travel - Energy costs and health risks vary by region
- Real-Time Population - See active players in each location
- Resource Distribution - Different zones offer unique mining opportunities
- Safe Zones - Low risk, basic resources, player hubs
- Mining Regions - High-value resources, moderate danger
- Wasteland - Extreme risk, rare materials, PvP zones
- Trading Posts - Commercial hubs with NPC merchants
- Independent Decision Making - NPCs choose actions based on AI logic
- Economic Participation - Buy, sell, mine, and accumulate resources
- Social Interaction - Chat and respond to player communications
- Realistic Simulation - Energy, health, and economic constraints
- Behavior Profiles - Different NPC personality types
- Activity Schedules - Mining, trading, and rest cycles
- Economic Settings - Spending patterns and market participation
- Location Preferences - Zone-specific NPC distributions
- Character Creation - Visual customization and NFT minting
- World Map - Interactive travel and location selection
- Mining Interface - Resource extraction with risk/reward mechanics
- Inventory Management - Equipment and item organization
- Market Trading - Buy/sell interface with real-time pricing
- Chat System - Location-based communication
- Profile & Stats - Character progression and achievements
- Economy Overview - Market data and token metrics
- Player Analytics - Activity, retention, and engagement stats
- NPC Management - Configure autonomous character behavior
- Content Management - Items, locations, and game balance
# Development
npm run dev # Start Vite dev server
npm run functions:dev # Start Netlify dev with functions
npm run npc:dev # Run NPC engine in development
# Production
npm run build # Build for production
npm run functions:build # Build Netlify functions
npm run npc:start # Start NPC engine in production
# Android Development
npx cap sync android # Sync web assets to Android
npx cap run android # Build and run Android app
npx cap open android # Open Android Studio
# Utilities
npm run lint # ESLint checking
npm run types # Generate Supabase types- Layered Assets - Modular clothing and accessory system
- Gender Options - Male and female base models
- Equipment Variety - Clothing, outerwear, accessories, tools
- Visual Persistence - Character appearance saved to blockchain
- Base Models - Core character foundations
- Clothing - T-shirts, jackets, specialized gear
- Accessories - Sunglasses, jewelry, tools
- Equipment - Mining gear, weapons, survival tools
- Frontend: React 19, TypeScript, Vite, Tailwind CSS 4
- Mobile: Capacitor for Android app, Solana Mobile Stack compatible
- UI Components: Radix UI, shadcn/ui
- Blockchain: Solana Web3.js, SPL Token, Metaplex
- Database: Supabase (PostgreSQL) with real-time subscriptions
- Backend: Netlify Functions, Node.js NPC engine
- Graphics: D3.js for maps, Canvas for character rendering
- Real-Time: WebSocket connections, Supabase subscriptions
- API Documentation - Complete API reference
- Android Development - Mobile development and Solana Mobile integration
- Tokenomics - Economic mechanics and token design
- Map System - World geography and location details
- Development Guide - Architecture and coding standards
- Roadmap - Feature development timeline
- Frontend: Netlify static hosting
- Functions: Netlify serverless functions
- Database: Supabase managed PostgreSQL
- Blockchain: Solana mainnet integration
VITE_SUPABASE_URL- Supabase project URLVITE_SUPABASE_ANON_KEY- Supabase anonymous keyVITE_SOLANA_RPC_URL- Solana RPC endpointVITE_ENVIRONMENT- Environment flag (dev/prod)
- Fork the repository
- Create a feature branch
- Follow TypeScript and React best practices
- Test with local NPC engine
- Submit pull request with detailed description
This project uses dual licensing:
The source code is licensed under MIT License - see LICENSE file for details.
- ✅ Free to use, modify, and distribute
- ✅ Commercial use allowed
- ✅ Build your own projects with this code
All visual assets, artwork, and creative content are proprietary - see ASSETS_LICENSE file for details.
- ❌ Assets cannot be used commercially
- ❌ Cannot create competing games with our assets
- ❌ Character designs, logos, and branding are protected
- ✅ Code study and local development allowed
Summary: Use our code to build amazing games, but create your own visual identity and assets!
- Live Game: [Coming Soon]
- Documentation: See
/docsfolder - Community: Discord Community
- Support: GitHub Issues
Earth 2089 - Survive the wasteland, build your empire, own your destiny.
