| # Testing the Dashboard Integration |
|
|
| ## β
Verification Steps |
|
|
| ### 1. Check Build Output |
| ```bash |
| ls -la /home/dashboard/out/ |
| # Should show: index.html, _next/, accounts/, config/, logs/, metrics/ |
| ``` |
|
|
| ### 2. Verify Module Import |
| ```bash |
| cd /home |
| python3 -c "from kiro.dashboard_static import setup_dashboard_routes; print('β OK')" |
| ``` |
|
|
| ### 3. Check Server Logs |
| When starting the gateway, you should see: |
| ``` |
| Dashboard API routes registered |
| Dashboard static files mounted at /shin (from /home/dashboard/out) |
| ``` |
|
|
| ### 4. Test Routes (after server starts) |
|
|
| #### Dashboard Pages |
| ```bash |
| # Root page |
| curl -I http://localhost:8000/shin/ |
| |
| # Metrics page |
| curl -I http://localhost:8000/shin/metrics/ |
| |
| # Static assets |
| curl -I http://localhost:8000/shin/_next/static/... |
| ``` |
|
|
| #### API Endpoints |
| ```bash |
| # Health check (no auth) |
| curl http://localhost:8000/api/dashboard/health |
| |
| # Stats (requires auth) |
| curl -H "X-Dashboard-Key: your-key" \ |
| http://localhost:8000/api/dashboard/stats |
| ``` |
|
|
| ### 5. Browser Test |
| 1. Start gateway: `python3 main.py --port 8000` |
| 2. Open: `http://localhost:8000/shin` |
| 3. Check: |
| - [ ] Page loads with animations |
| - [ ] Sidebar navigation works |
| - [ ] All routes accessible |
| - [ ] Charts render (may show "no data" if no traffic) |
| - [ ] Styles applied correctly |
|
|
| ## π― Expected Results |
|
|
| ### Server Startup |
| ``` |
| β Dashboard API routes registered |
| β Dashboard static files mounted at /shin |
| β Server running on http://0.0.0.0:8000 |
| ``` |
|
|
| ### Browser |
| - Modern, animated dashboard interface |
| - Dark theme with gradients |
| - Smooth transitions and hover effects |
| - All pages accessible via sidebar |
|
|
| ### API |
| - Health endpoint returns JSON with status |
| - Other endpoints require X-Dashboard-Key header |
| - CORS not needed (same origin) |
|
|
| ## π Common Issues |
|
|
| ### Issue: 404 on /shin |
| **Cause**: Dashboard not built |
| **Fix**: `npm run build` |
|
|
| ### Issue: Blank page |
| **Cause**: JavaScript errors or wrong base path |
| **Fix**: Check browser console, verify next.config.ts has basePath: '/shin' |
|
|
| ### Issue: API calls fail |
| **Cause**: Missing credentials or wrong API key |
| **Fix**: Configure .env with PROXY_API_KEY |
|
|
| ### Issue: Styles missing |
| **Cause**: Static files not loading |
| **Fix**: Check /shin/_next/ is accessible, rebuild dashboard |
| |
| ## β
Success Criteria |
| |
| All of these should work: |
| - [x] Dashboard builds without errors |
| - [x] Module imports successfully |
| - [x] Server starts and mounts /shin route |
| - [x] Browser loads dashboard at /shin |
| - [x] Navigation between pages works |
| - [x] Animations and styles display correctly |
| - [x] API endpoints respond (with proper auth) |
| |
| |