docs: add comprehensive documentation for coding agents
Created detailed documentation files to guide coding agents in implementing
the fixes and improvements identified in the functionality review:
1. API_DOCUMENTATION_GUIDE.md
- Complete API endpoint catalog
- Authentication documentation
- REST API endpoints (health, user, trading, orders, market data, research, backtesting, feature flags, admin)
- WebSocket namespaces (/trading, /admin, /)
- Error responses and error codes
- Rate limiting recommendations
- Request ID propagation
- Deprecation policy
- OpenAPI/Swagger generation guide
- Documentation maintenance process
2. ARCHITECTURE_DOCUMENTATION.md
- System overview and high-level architecture
- Monorepo structure and directory layout
- Backend architecture (component structure, data flow, trading loop)
- Web architecture (component structure, data flow, UI architecture)
- Mobile architecture (component structure, data flow)
- Shared code architecture (shared modules, platform integration)
- Data architecture (Cosmos DB containers, data flow)
- Service boundaries (backend, platform-service, web, mobile responsibilities)
- Integration points (backend ↔ platform-service, web ↔ backend, mobile ↔ backend, etc.)
- Security architecture (authentication, authorization, tenant isolation)
- Monitoring & observability (telemetry, logging)
- Deployment architecture (Docker, environment variables)
- Scalability considerations (horizontal scaling, WebSocket scaling)
3. TROUBLESHOOTING_GUIDE.md
- Backend issues (won't start, health check failing, trading loop not running, orders not executing, reconciliation failures)
- Web issues (won't load, authentication failing, WebSocket connection failing, data not updating)
- Mobile issues (won't launch, authentication failing, WebSocket connection failing, data not updating)
- Database issues (Cosmos DB connection failing, slow performance, data inconsistency)
- Authentication issues (platform-service unreachable, JWT token invalid)
- WebSocket issues (connection drops, not receiving events)
- Performance issues (backend slow response times, web slow load times)
- Deployment issues (Docker build failing, container won't start)
- Escalation procedures (when to escalate, escalation steps, on-call contact, incident response)
- Common error messages (backend, web, mobile)
- Monitoring and alerts (key metrics, alert thresholds, monitoring tools)
4. ONBOARDING_GUIDE.md
- Project overview (what is the trading dashboard, tech stack, key concepts)
- Prerequisites (required software, required accounts, optional tools)
- Development setup (clone repo, install dependencies, configure environment, verify setup)
- Project structure (monorepo layout, key files)
- Development workflow (starting development, making changes, commit message format, pushing changes)
- Testing (backend tests, web tests, mobile tests, verification script)
- Code review process (PR process, PR checklist, code review guidelines)
- Common tasks (adding backend endpoint, adding web component, adding mobile screen, adding feature flag)
- Resources (documentation, external documentation, tools)
- Getting help (internal resources, common issues, asking questions)
- Best practices
- Next steps (first week, first month, ongoing)
These documentation files provide detailed guidance for coding agents to implement
the fixes and improvements identified in FUNCTIONALITY_REVIEW.md without needing
to understand the entire codebase from scratch.