Files
ljwx-stock/VERIFICATION_CHECKLIST.md
brunoandClaude d364268ca4 fix: Register Claude × DeepSeek collaboration routes in main.py
Fixed missing route registration that prevented the /api/collab/* endpoints from being available.
The claude_deepseek_collab module was imported and implemented but not registered in the FastAPI app,
causing 404 errors on all endpoints including health check, recommend, and batch-recommend.

Changes:
- Updated backend/app/routes/__init__.py to export claude_deepseek_collab module
- Updated backend/main.py to import and register the claude_deepseek_collab router
- All endpoints now properly accessible and working with real Alpha Vantage data

Verified endpoints:
✅ /api/collab/health - System health check
✅ /api/collab/recommend - Single stock/forex analysis with Claude + DeepSeek
✅ /api/collab/batch-recommend - Batch analysis for multiple assets
✅ /api/collab/analyze/{symbol} - Technical signal analysis only

Real data sources verified:
✅ AAPL: $275.25 (Alpha Vantage)
✅ EURUSD=X: 1.16 (ExchangeRate API)

🤖 Generated with Claude Code

Co-Authored-By: Claude <[email protected]>
2025-11-12 14:55:38 +01:00

8.4 KiB

Real Data Integration - Verification Checklist

Use this checklist to verify the system is properly configured and operational.

✅ Pre-Deployment Checks

1. Environment Configuration

# Check .env file has Alpha Vantage key
cat /root/work/stock/.env | grep ALPHA_VANTAGE_API_KEY

# Expected output:
# ALPHA_VANTAGE_API_KEY=your_key_here
# OR (for real key):
# ALPHA_VANTAGE_API_KEY=XXXXXXXXXXXXXXXX

Status: [ ] Checked

2. Docker Containers Status

cd /root/work/stock
docker-compose ps

# Expected output:
# NAME                  STATE           PORTS
# stock_backend         Up (healthy)    0.0.0.0:8001->8000/tcp
# stock_frontend        Up              0.0.0.0:8090->80/tcp
# stock_postgres        Up (healthy)    0.0.0.0:5433->5432/tcp
# stock_redis          Up (healthy)    0.0.0.0:6380->6379/tcp
# stock_adminer        Up              0.0.0.0:8091->8080/tcp

Status: [ ] All containers running

3. Health Endpoint

curl -s http://localhost:8001/api/collab/health | python3 -m json.tool

# Expected output (with real key):
# {
#   "status": "operational",
#   "components": {
#     "ollama": "available",
#     "deepseek": "available",
#     "claude": "available",
#     "yahoo_finance": "available"
#   },
#   "timestamp": "2025-11-12T..."
# }

# Expected output (with demo key):
# {
#   "status": "operational",
#   "components": {
#     "ollama": "unavailable",  # If Ollama not running locally
#     "deepseek": "unavailable",
#     "claude": "available",
#     "yahoo_finance": "available"
#   }
# }

Status: [ ] Endpoint responding

✅ Data Source Verification

4. Alpha Vantage Integration

# Check Alpha Vantage source file exists
ls -l /root/work/stock/backend/data/datasource_alpha_vantage.py

# Expected output: -rw-r--r-- 1 root root 12365 ...

Status: [ ] File exists

5. Forex Integration

# Check Forex source file exists
ls -l /root/work/stock/backend/data/datasource_forex.py

# Expected output: -rw-r--r-- 1 root root 5511 ...

Status: [ ] File exists

6. Route Integration

# Check imports are present
grep -n "get_alpha_vantage_source\|get_forex_source" \
  /root/work/stock/backend/app/routes/claude_deepseek_collab.py

# Expected output: Lines 13-14 should show imports
# Line 13: from data.datasource_alpha_vantage import get_alpha_vantage_source
# Line 14: from data.datasource_forex import get_forex_source

Status: [ ] Imports verified

✅ API Endpoint Tests

7. Test US Stock (AAPL)

curl -s -X POST http://localhost:8001/api/collab/recommend \
  -H "Content-Type: application/json" \
  -d '{"symbol": "AAPL"}' | python3 -m json.tool | head -30

# Expected output:
# {
#   "symbol": "AAPL",
#   "current_price": 193.65 (or similar real price),
#   "deepseek_signal": {
#     "signal": "BUY"|"SELL"|"HOLD",
#     "confidence": 0.0-1.0,
#     ...
#   },
#   "investment_advice": {
#     "symbol": "AAPL",
#     "recommendation": "...",
#     ...
#   }
# }

Status: [ ] Real price returned (not 0 or static demo value)

8. Test Hong Kong Stock

curl -s -X POST http://localhost:8001/api/collab/recommend \
  -H "Content-Type: application/json" \
  -d '{"symbol": "0700.HK"}' | python3 -m json.tool | head -10

# Expected output:
# {
#   "symbol": "0700.HK",
#   "current_price": 123.45 (or similar),
#   ...
# }

Status: [ ] Hong Kong stock data working

9. Test Commodity (Gold)

curl -s -X POST http://localhost:8001/api/collab/recommend \
  -H "Content-Type: application/json" \
  -d '{"symbol": "GC=F"}' | python3 -m json.tool | head -10

# Expected output:
# {
#   "symbol": "GC=F",
#   "current_price": 2060.18 (or similar gold price),
#   ...
# }

Status: [ ] Gold/commodity data working

10. Test Forex

curl -s -X POST http://localhost:8001/api/collab/recommend \
  -H "Content-Type: application/json" \
  -d '{"symbol": "EURUSD=X"}' | python3 -m json.tool | head -10

# Expected output:
# {
#   "symbol": "EURUSD=X",
#   "current_price": 1.092 (or similar exchange rate),
#   ...
# }

Status: [ ] Forex data working

✅ Ollama Integration

11. Check Ollama Connectivity

# If Ollama is running on host
docker exec stock_backend curl http://host.docker.internal:11434/api/version

# Expected output:
# {"version":"0.x.x"}

Status: [ ] Ollama accessible (optional, only if running)

12. Check DeepSeek Model

# On host machine
ollama list | grep deepseek

# Expected output:
# deepseek-coder:6.7b          ...

Status: [ ] DeepSeek model available (optional)

✅ Backend Logs

13. Check for Errors

docker logs stock_backend 2>&1 | grep -i "error\|exception" | tail -5

# Should see minimal errors related to failed API calls
# Expected: Warnings about Ollama if not running, but not critical errors

Status: [ ] No critical errors

14. Check Data Source Logs

docker logs stock_backend 2>&1 | grep -i "alpha_vantage\|forex" | tail -5

# Expected: Some log entries about data source calls

Status: [ ] Data sources being called

✅ Documentation

15. Setup Guide Present

ls -l /root/work/stock/REAL_DATA_SETUP_GUIDE.md

# Expected output: -rw-r--r-- 1 root root 12345 ...

Status: [ ] Setup guide available

16. Summary Document Present

ls -l /root/work/stock/INTEGRATION_SUMMARY.md

# Expected output: -rw-r--r-- 1 root root 23456 ...

Status: [ ] Summary available

✅ Configuration Verification

17. .env File Correct

# Check key variables present
grep -E "ALPHA_VANTAGE_API_KEY|OPENROUTER|OLLAMA" /root/work/stock/.env

# Expected output:
# ALPHA_VANTAGE_API_KEY=demo (or real key)
# OPENROUTER_API_KEY=sk-or-v1-...
# OLLAMA_BASE_URL=http://host.docker.internal:11434
# DEEPSEEK_MODEL=deepseek-coder:6.7b

Status: [ ] Configuration correct

18. .gitignore Updated

# Check .env is in .gitignore
grep ".env" /root/work/stock/.gitignore

# Expected output:
# .env

Status: [ ] .env protected from Git

✅ Performance Tests

19. Response Time Test

# Time a real request
time curl -s -X POST http://localhost:8001/api/collab/recommend \
  -H "Content-Type: application/json" \
  -d '{"symbol": "MSFT"}' > /dev/null

# Expected: 2-3 seconds (warm cache) to 10-15 seconds (cold)

Status: [ ] Response time acceptable

20. Concurrent Requests Test

# Test 3 concurrent requests
for i in 1 2 3; do
  curl -s -X POST http://localhost:8001/api/collab/recommend \
    -H "Content-Type: application/json" \
    -d "{\"symbol\": \"AAPL$i\"}" &
done
wait

# Expected: All requests complete without errors

Status: [ ] Concurrent requests working

✅ Data Quality

21. Real vs Demo Data

# Check if prices are real (non-zero, reasonable values)
curl -s -X POST http://localhost:8001/api/collab/recommend \
  -H "Content-Type: application/json" \
  -d '{"symbol": "AAPL"}' | grep "current_price"

# With real key: current_price: 193.65 (or actual market price)
# With demo key: current_price: 192.x (demo data - similar value)

Status: [ ] Appropriate data source

22. Technical Indicators

# Check if indicators are calculated
curl -s -X POST http://localhost:8001/api/collab/recommend \
  -H "Content-Type: application/json" \
  -d '{"symbol": "AAPL"}' | python3 -m json.tool | grep -A 10 "technical_indicators"

# Expected: ma_5, ma_20, ma_50, rsi, macd values

Status: [ ] Indicators calculated

📋 Final Verification Summary

Pre-Deployment Score

Count your checked items: ___ / 22

Results:

  • 22/22 ✅ PRODUCTION READY - All systems operational
  • 20-21 ✅ READY - Minor issues only (likely Ollama not running)
  • 18-19 ⚠️ MOSTLY READY - Some components not working
  • <18 ❌ NOT READY - Configuration issues present

🚀 Next Steps

  1. If Score ≥ 20: Ready for production with real API keys
  2. If Score < 20: Check failed items and troubleshoot
  3. See REAL_DATA_SETUP_GUIDE.md for detailed troubleshooting

📝 Notes

  • Scores with demo key: Expect Ollama/DeepSeek to show unavailable
  • Real key expected: All components should show available
  • Some yfinance errors in logs are expected (system doesn't use it)
  • Empty cache expected on first run (cold cache test)

Verification Date: _______________ Checked By: _______________ Status: [ ] READY FOR PRODUCTION


For issues, see: /root/work/stock/REAL_DATA_SETUP_GUIDE.md