How osaidsheikh1509-wq/cyber_risk works
Cyber Risk Tracker supports analyst workflows for threat registration, risk assessment, investigation timelines, and multilingual voice/audio intelligence. The main path runs from the React dashboard through typed API requests into FastAPI endpoints, repository selection, and persistent storage; AI and Sarvam services handle assessment and briefings. Edges reflect README statements or shown source references and calls; several storage and endpoint internals were not sampled, so those links are documented or conservatively omitted.
Main entry points: main.py FastAPI Router · threatApi.ts Threat API Client · threats.py Threat Operations · mongo_repo.py Mongo Repositories
Components 21
Analyst Interface
- Threat Dashboard
frontend/src/App.tsx - Threat Detail
frontend/src/components/ThreatDetailPage.tsx - Briefing Player
frontend/src/components/SpokenBriefingModal.tsx - Threat API Client
frontend/src/services/threatApi.ts
API Workflows
- FastAPI Router
backend/app/main.py - Threat Operations
backend/app/api/v1/endpoints/threats.py - Threat Statistics
backend/app/api/v1/endpoints/stats.py - AI Assessment Route
backend/app/api/v1/endpoints/ai.py - Voice Intake Route
backend/app/api/v1/endpoints/voice.py
Risk Intelligence
- Risk Model Providers
backend/app/services/risk_model.py - Sarvam Services
backend/app/services/sarvam.py - Risk Scoring
backend/app/core/risk_calculator.py - Briefing Cache
backend/app/services/briefing_cache.py
Persistence
- Repository Selection
backend/app/repositories/dependencies.py - SQLite Repositories
backend/app/repositories/sqlite_repo.py - Mongo Repositories
backend/app/repositories/mongo_repo.py - SQLite Database
backend/app/core/database.py - MongoDB
backend/app/core/mongo.py - Threat Models
backend/app/models/threat.py
Other components
- Security Analyst
- AI Model Service
Connections 29
- Security Analyst → Threat Dashboard: uses
README.md - Threat Dashboard → Threat API Client: requests data
frontend/src/App.tsx - Threat Detail → Threat API Client: requests timeline
frontend/src/components/ThreatDetailPage.tsx - Briefing Player → Threat API Client: requests briefing
frontend/src/components/SpokenBriefingModal.tsx - Threat API Client → Threat Operations: HTTP requests
frontend/src/services/threatApi.ts - Threat API Client → AI Assessment Route: assesses threat
frontend/src/services/threatApi.ts - Threat API Client → Voice Intake Route: submits voice
README.md - FastAPI Router → Threat Operations: mounts routes
backend/app/main.py - FastAPI Router → Threat Statistics: mounts routes
backend/app/main.py - FastAPI Router → AI Assessment Route: mounts routes
backend/app/main.py - FastAPI Router → Voice Intake Route: mounts routes
backend/app/main.py - Threat Operations → Repository Selection: uses repositories
backend/app/api/v1/endpoints/threats.py - Threat Statistics → Repository Selection: uses repositories
backend/app/api/v1/endpoints/stats.py - Threat Operations → Risk Scoring: calculates risk
backend/app/api/v1/endpoints/threats.py - Threat Operations → Sarvam Services: generates briefing
backend/app/api/v1/endpoints/threats.py - AI Assessment Route → Risk Model Providers: assesses event
backend/app/api/v1/endpoints/ai.py - AI Assessment Route → Risk Scoring: calculates score
backend/app/api/v1/endpoints/ai.py - Voice Intake Route → Sarvam Services: transcribes audio
backend/app/api/v1/endpoints/voice.py - Voice Intake Route → Risk Model Providers: assesses transcript
backend/app/api/v1/endpoints/voice.py - Risk Model Providers → Sarvam Services: calls provider
backend/app/services/risk_model.py - Risk Model Providers → AI Model Service: optional model
README.md - Repository Selection → SQLite Repositories: selects backend
backend/app/repositories/dependencies.py - Repository Selection → Mongo Repositories: selects backend
backend/app/repositories/dependencies.py - SQLite Repositories → SQLite Database: reads and writes
- Mongo Repositories → MongoDB: reads and writes
- Mongo Repositories → Risk Scoring: calculates risk
backend/app/repositories/mongo_repo.py - Mongo Repositories → Briefing Cache: uses cache
backend/app/repositories/mongo_repo.py - FastAPI Router → Threat Models: initializes models
backend/app/main.py - FastAPI Router → SQLite Database: creates tables
backend/app/main.py