How bhuvanbuilds/g-doc works
This is an email threat-investigation application: a user uploads an .eml file, the backend parses it, analyzes technical indicators, enriches evidence, and returns AI findings and a risk assessment for investigation views. The graph preserves the major backend analysis stages and the frontend’s dashboard, investigation, and authentication areas. Backend calls are supported by excerpts; frontend wiring is only partly visible, so uncertain connections are omitted or marked unverified.
Main entry points: evidence_engine.py Evidence Orchestrator · main.py FastAPI Service · upload-panel.tsx Email Upload · dashboard-view.tsx Dashboard
Components 25
Email Ingestion
- FastAPI Service
backend/main.py - Email Parser
backend/parsers/email_parser.py
Evidence Analysis
- Evidence Orchestrator
backend/detection/evidence_engine.py - Header Analysis
backend/parsers/header_analysis.py - Auth Analysis
backend/parsers/auth_analysis.py - URL Analysis
backend/parsers/url_analysis.py - Attachment Analysis
backend/parsers/attachment_analysis.py - Relay Analysis
backend/parsers/relay_analysis.py - Timeline Analysis
backend/parsers/timeline_analysis.py - Risk Assessment
backend/detection/risk_engine.py
Threat Enrichment
- Semantic Analysis
backend/services/groq.py - VirusTotal Lookup
backend/services/virustotal.py - IP Enrichment
backend/services/ipinfo.py - Gemini Service
backend/services/gemini.py
Investigation Frontend
- Web Interface
frontend/src/app/page.tsx - Email Upload
frontend/src/components/dashboard/upload-panel.tsx - Dashboard
frontend/src/components/dashboard/dashboard-view.tsx - Investigation Views
frontend/src/components/investigation/investigation-view.tsx - Result Derivation
frontend/src/lib/derive.ts - Investigation History
frontend/src/lib/history.ts - Investigation API
frontend/src/lib/api.ts
Authentication
- Supabase Clients
frontend/src/lib/supabase/server.ts - Auth Callback
frontend/src/app/auth/callback/route.ts - Sign Out
frontend/src/app/auth/signout/route.ts
Other components
- Analyst
Connections 20
- Analyst → Web Interface: uses
- Web Interface → Email Upload: offers upload
- Email Upload → Investigation API: submits email
- Investigation API → FastAPI Service: requests investigation
- FastAPI Service → Email Parser: parses email
backend/main.py - FastAPI Service → Evidence Orchestrator: builds evidence
backend/main.py - Evidence Orchestrator → Header Analysis: analyzes headers
backend/detection/evidence_engine.py - Evidence Orchestrator → Auth Analysis: analyzes auth
backend/detection/evidence_engine.py - Evidence Orchestrator → URL Analysis: analyzes URLs
backend/detection/evidence_engine.py - Evidence Orchestrator → Attachment Analysis: analyzes attachments
backend/detection/evidence_engine.py - Evidence Orchestrator → Relay Analysis: analyzes relays
backend/detection/evidence_engine.py - Evidence Orchestrator → Timeline Analysis: analyzes timeline
backend/detection/evidence_engine.py - Evidence Orchestrator → VirusTotal Lookup: looks up URLs
backend/detection/evidence_engine.py - Evidence Orchestrator → IP Enrichment: looks up IPs
backend/detection/evidence_engine.py - Evidence Orchestrator → Semantic Analysis: requests semantic analysis
backend/detection/evidence_engine.py - Evidence Orchestrator → Risk Assessment: calculates risk
backend/detection/evidence_engine.py - Dashboard → Email Upload: presents upload
- Dashboard → Investigation History: shows history
- Investigation Views → Result Derivation: derives display data
- Result Derivation → Investigation History: uses history
frontend/src/lib/derive.ts