How seifmahmoud63/cto-copilot works
CTO Watch is an engineering-leadership dashboard backed by a FastAPI service. Users pass a password/TOTP access gate, then view GitHub pull-request intelligence and engineer impact, chat with a database-aware copilot, use a voice agent, or preview scheduled executive PDF reports. The graph preserves those documented product branches and the storage and AI layers. Some routes and service implementations were only sampled or indexed, so those links are limited to relationships shown in excerpts or stated in the README.
Main entry points: routes.py HTTP and WebSocket API · github_service.py GitHub PR intelligence · report_service.py Daily report generation · llm_service.py Summary LLM routing
Components 23
Access
- Private-route gate
app/core/auth_gate.py - Login endpoints
app/api/auth.py - Password and TOTP
app/services/auth_service.py
PR Intelligence
- GitHub PR intelligence
app/services/github_service.py - JEV impact model
app/services/jev_service.py - Summary LLM routing
app/services/llm_service.py - LLM circuit breaker
app/services/circuit_breaker.py
AI Copilots
- LangGraph chat agent
app/services/chat_service.py - Live voice agent
app/services/voice_service.py
Executive Reports
- Report task scheduler
app/services/celery_app.py - Daily report generation
app/services/report_service.py - Report PDF
app/services/report_service.py
Data Layer
- Persistence operations
app/services/db_service.py - Async DB sessions
app/db/session.py - MySQL records
Other components
- Engineering leaders
- CTO Watch dashboard
web/app.js - HTTP and WebSocket API
app/api/routes.py - Amazon Bedrock
- Groq fallback
- GitHub API
- Deepgram agent
- Redis task broker
Connections 30
- Engineering leaders → CTO Watch dashboard: uses
README.md - CTO Watch dashboard → HTTP and WebSocket API: calls API
README.md - HTTP and WebSocket API → Private-route gate: guards routes
app/main.py - Private-route gate → Password and TOTP: verifies cookies
app/core/auth_gate.py - HTTP and WebSocket API → Login endpoints: serves login
app/main.py - Login endpoints → Password and TOTP: handles auth
app/api/auth.py - Password and TOTP → Async DB sessions: opens sessions
app/services/auth_service.py - HTTP and WebSocket API → GitHub PR intelligence: requests PR data
app/api/routes.py - GitHub PR intelligence → GitHub API: fetches PRs
- GitHub PR intelligence → Summary LLM routing: generates summaries
app/services/github_service.py - GitHub PR intelligence → JEV impact model: uses impact model
app/services/github_service.py - GitHub PR intelligence → Persistence operations: persists PRs
app/services/github_service.py - GitHub PR intelligence → Summary LLM routing: requests summaries
app/services/github_service.py - Summary LLM routing → LLM circuit breaker: checks availability
app/services/llm_service.py - Summary LLM routing → Amazon Bedrock: calls primary
app/services/llm_service.py - Summary LLM routing → Groq fallback: falls back
app/services/llm_service.py - HTTP and WebSocket API → LangGraph chat agent: dispatches messages
app/api/routes.py - LangGraph chat agent → Persistence operations: queries live data
app/services/chat_service.py - HTTP and WebSocket API → Live voice agent: opens session
app/api/routes.py - Live voice agent → Deepgram agent: streams audio
- HTTP and WebSocket API → Report task scheduler: checks task status
app/api/routes.py - Report task scheduler → Daily report generation: schedules generation
app/services/celery_app.py - Report task scheduler → Redis task broker: queues tasks
- HTTP and WebSocket API → Daily report generation: serves report features
app/api/routes.py - Daily report generation → GitHub PR intelligence: loads PR metrics
app/services/report_service.py - Daily report generation → Persistence operations: loads engineer data
app/services/report_service.py - Daily report generation → Summary LLM routing: generates analysis
app/services/report_service.py - Daily report generation → Report PDF: renders report
app/services/report_service.py - Persistence operations → Async DB sessions: opens sessions
app/services/db_service.py - Async DB sessions → MySQL records: reads and writes
app/db/session.py