Claude
|
d551d0c6df
|
Add BR-95 Desktop API backend with real-time data and WebSocket support
This commit implements the complete backend infrastructure for the BR-95
Desktop Operating System interface.
## New Features
1. **BR-95 Router** (`backend/app/routers/br95.py`):
- Data simulator for OS statistics
- 11+ API endpoints for real-time data
- WebSocket support for live updates
- Pydantic models for type safety
2. **API Endpoints** (`/api/br95`):
- `/lucidia` - AI orchestration stats (1000 agents)
- `/agents` - Agent performance metrics
- `/roadchain` - Blockchain statistics
- `/wallet` - RoadCoin wallet balance
- `/miner` - Mining performance
- `/raspberry-pi` - IoT device management
- `/github` - GitHub integration stats
- `/roadmail` - Email statistics
- `/roadcraft` - Game statistics
- `/road-city` - Metaverse statistics
- `/terminal` - Command execution (simulated)
3. **WebSocket** (`/api/br95/ws`):
- Real-time miner updates
- Live blockchain sync
- Wallet balance streaming
- Auto-reconnect on disconnect
4. **Frontend Integration**:
- Updated BR-95 HTML with API calls
- WebSocket client for live updates
- Auto-refresh every 30 seconds
- Real-time stat updates in windows
5. **Railway Deployment**:
- Already configured via railway.toml
- Health check at /health
- Version endpoint at /version
- Documentation in docs/RAILWAY_BR95.md
## Technical Details
- **Data Simulation**: Uses DataSimulator class for realistic stats
- **WebSocket Manager**: ConnectionManager for broadcast messaging
- **Type Safety**: Full Pydantic model validation
- **Performance**: psutil for real CPU/memory metrics
- **Error Handling**: Graceful fallbacks and reconnection
## Deployment
Service runs on:
- Primary: https://app.blackroad.systems
- Railway: https://blackroad-operating-system-production.up.railway.app
Health check: GET /health
Version info: GET /version
API docs: GET /api/docs
## Files Changed
- backend/app/main.py - Registered br95 router
- backend/requirements.txt - Added psutil==5.9.6
- backend/static/index.html - API integration + WebSocket
- backend/app/routers/br95.py - New BR-95 router (700+ lines)
- docs/RAILWAY_BR95.md - Deployment guide
Closes #133 (if exists) - BR-95 backend implementation
|
2025-11-20 21:48:22 +00:00 |
|