How farhanhussain02/lightning-guard-prototype works
Lightning Guard is a web threat-analysis product. A user enters text or attaches documents/images in the React analyzer; it submits text or files to the Node backend, which uses Gemini and, for supported files, OCR or DOCX parsing. The interface presents a classification, confidence, findings, recommendations, and reporting services. Frontend request/response handling is excerpted; backend internals and the reporting implementation were not sampled, so those relationships rely on README statements.
Main entry points: ThreatAnalyzer.tsx Input and results · server.js Analysis API · Index.tsx Analyzer page · ui UI component library
Components 14
Web interface
- React app and routes
src/App.tsx - Analyzer page
src/pages/Index.tsx - Input and results
src/components/ThreatAnalyzer.tsx - Lightning backdrop
src/components/LightningBackground.tsx - Wave backdrop
src/components/WaveBackground.tsx - Threat reports
src/components/ThreatAnalyzer.tsx
Analysis service
- Analysis API
backend/server.js
Analysis integrations
- Threat intelligence
- Image text OCR
- DOCX parsing
Interface support
- UI component library
src/components/ui - Toast state
src/hooks/use-toast.ts - Style utilities
src/lib/utils.ts
Other components
- User
Connections 14
- User → Input and results: enters or uploads
src/components/ThreatAnalyzer.tsx - React app and routes → Analyzer page: routes to
src/App.tsx - Analyzer page → Input and results: renders
src/pages/Index.tsx - Analyzer page → Lightning backdrop: renders
src/pages/Index.tsx - Analyzer page → Wave backdrop: renders
src/pages/Index.tsx - Input and results → Analysis API: posts text or files
src/components/ThreatAnalyzer.tsx - Analysis API → Threat intelligence: requests analysis
- Analysis API → Image text OCR: extracts image text
- Analysis API → DOCX parsing: parses DOCX
- Analysis API → Input and results: returns analysis
src/components/ThreatAnalyzer.tsx - Input and results → Threat reports: presents report services
src/components/ThreatAnalyzer.tsx - Input and results → UI component library: renders with
src/components/ThreatAnalyzer.tsx - Input and results → Toast state: notifies through
src/components/ThreatAnalyzer.tsx - UI component library → Style utilities: merges styles
src/components/ui/button.tsx