# BlackRoad OS - Complete Deployment Guide ## ๐ŸŽฏ Status: FULLY WIRED AND WORKING! All components of BlackRoad OS are now wired together and functional: โœ… Backend API (FastAPI) running at `localhost:8000` โœ… Frontend apps using unified API client (`blackroad-api.js`) โœ… Authentication system working (JWT tokens) โœ… AI Chat working with real backend โœ… Agent spawning working โœ… Payment integration ready โœ… Unified navigation across all apps (`blackroad-nav.js`) โœ… All apps deployed to https://blackroad.io via GitHub Pages ## ๐Ÿ—๏ธ Architecture ### Backend (FastAPI) - **Location**: `/backend/main.py` - **Port**: 8000 (local), configurable via $PORT env var - **Features**: - JWT authentication - AI chat with conversation management - Agent spawning and management - Blockchain transactions - Stripe payment integration - File management - Social feed - System stats ### Frontend (Static HTML/JS) - **Hosting**: GitHub Pages at https://blackroad.io - **API Client**: `blackroad-api.js` (unified API wrapper) - **Navigation**: `blackroad-nav.js` (shared navigation component) - **Apps**: - `index.html` - Main app with auth and pricing - `chat.html` - AI chat interface - `agents-live.html` - Agent dashboard - `blockchain-live.html` - RoadChain explorer - `files-live.html` - File manager - `social-live.html` - Social network - `wallet.html` - Multi-wallet crypto - `ledger.html` - Ledger hardware wallet - `integrations.html` - External services - `dashboard.html` - Master control panel ## ๐Ÿš€ Quick Start ### 1. Run Backend Locally ```bash cd backend pip install -r requirements.txt python3 main.py ``` Backend will run on http://localhost:8000 Test it: ```bash curl http://localhost:8000/health ``` ### 2. Open Frontend ```bash # Frontend is already deployed at https://blackroad.io # Or open local files open index.html ``` Frontend automatically connects to: - `localhost:8000` when running locally - `https://api.blackroad.io` when on production domain ### 3. Test Complete Flow ```bash chmod +x test-api.sh ./test-api.sh ``` This will test: - โœ… Health check - โœ… User registration - โœ… AI chat - โœ… Agent spawning - โœ… System stats ## ๐Ÿ“ฆ Deploy Backend to Railway ### Option 1: Via Railway CLI (requires login) ```bash cd backend railway login railway init railway up ``` ### Option 2: Via Railway Dashboard 1. Go to https://railway.app 2. Create new project 3. Connect to GitHub repo: `blackboxprogramming/blackroad.io` 4. Set root directory to `/backend` 5. Railway auto-detects `Procfile` and `requirements.txt` 6. Add environment variables: - `SECRET_KEY` - Your JWT secret - `STRIPE_SECRET_KEY` - Your Stripe key 7. Deploy! ### Option 3: Deploy from this directory ```bash # Create railway.toml in backend directory cat > backend/railway.toml <