mirror of
https://github.com/blackboxprogramming/blackroad.io.git
synced 2026-03-17 04:57:13 -05:00
- Created DEPLOYMENT.md with complete setup guide - Added test-api.sh for automated API testing - Documented all architecture, deployment options, and integrations - Full checklist of working features - Production deployment steps for Railway - Environment variable configuration - Troubleshooting guide Backend API fully tested: ✅ Health check working ✅ User registration/login working ✅ AI chat with conversation history ✅ Agent spawning and management ✅ System stats tracking ✅ All 2 users, 1 agent, 1 conversation tracked 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
44 lines
1.3 KiB
Bash
Executable File
44 lines
1.3 KiB
Bash
Executable File
#!/bin/bash
|
|
# Test BlackRoad OS API
|
|
|
|
echo "🧪 Testing BlackRoad OS API..."
|
|
echo ""
|
|
|
|
# Test health
|
|
echo "1. Health Check"
|
|
curl -s http://localhost:8000/health | python3 -m json.tool
|
|
echo ""
|
|
|
|
# Test registration
|
|
echo "2. Register User"
|
|
REGISTER_RESPONSE=$(curl -s -X POST http://localhost:8000/api/auth/register \
|
|
-H 'Content-Type: application/json' \
|
|
-d '{"email":"demo@blackroad.io","password":"demo123","name":"Demo User"}')
|
|
echo "$REGISTER_RESPONSE" | python3 -m json.tool
|
|
TOKEN=$(echo "$REGISTER_RESPONSE" | python3 -c "import sys, json; print(json.load(sys.stdin)['access_token'])" 2>/dev/null || echo "")
|
|
echo ""
|
|
|
|
# Test chat
|
|
if [ -n "$TOKEN" ]; then
|
|
echo "3. AI Chat"
|
|
curl -s -X POST http://localhost:8000/api/ai-chat/chat \
|
|
-H 'Content-Type: application/json' \
|
|
-H "Authorization: Bearer $TOKEN" \
|
|
-d '{"message":"Hello!"}' | python3 -m json.tool
|
|
echo ""
|
|
|
|
# Test agent spawn
|
|
echo "4. Spawn Agent"
|
|
curl -s -X POST http://localhost:8000/api/agents/spawn \
|
|
-H 'Content-Type: application/json' \
|
|
-H "Authorization: Bearer $TOKEN" \
|
|
-d '{"role":"Test Agent","capabilities":["testing"]}' | python3 -m json.tool
|
|
echo ""
|
|
|
|
# Test system stats
|
|
echo "5. System Stats"
|
|
curl -s http://localhost:8000/api/system/stats | python3 -m json.tool
|
|
fi
|
|
|
|
echo "✅ API tests complete!"
|