HawkLens is designed for speed, modularity, and real-time insights. This document outlines the core components and data flow of the system.
graph TD
User([User/Browser]) <--> Dashboard[Premium Web Dashboard]
User <--> CLI[Command Line Interface]
Dashboard <--> API[REST & SSE API Server]
CLI <--> Engine[Managed Worker Pool]
API <--> Engine
Engine <--> Plugins[OSINT Plugin Registry]
Plugins --> Twitter[Twitter Plugin]
Plugins --> YouTube[YouTube Plugin]
Plugins --> Reddit[Reddit Plugin]
Plugins --> Instagram[Instagram Plugin]
Plugins --> TikTok[TikTok Plugin]
Engine --> DB[(PostgreSQL)]
Engine --> Cache[(Redis)]
Engine --> Search[(Elasticsearch)]
The heart of HawkLens is the Dispatcher. It manages a finite pool of workers that process scan jobs concurrently. This prevents platform-specific delays from blocking the entire system and allows for efficient resource management.
- Dispatcher: Manages the job queue and results channel.
- Workers: Individual goroutines that fetch data from plugins.
For the dashboard, HawkLens uses SSE to stream results. As soon as a worker retrieves data from a platform, it is pushed through the SSE stream to the connected client, providing a "live" intelligence feed.
The system uses an interface-based registry. Adding a new platform is as simple as implementing the Plugin interface and calling Register(). This decoupling allows for rapid expansion without touching the engine core.
- Request: User submits a query via CLI or Dashboard.
- Dispatch: The Engine breaks the request into "Jobs" (one per registered plugin).
- Execution: Workers pick up jobs and execute the
Fetchmethod of the respective plugin. - Analysis: Results are passed through the NLP pipeline (Sentiment & Topics).
- Diffusion:
- Persistence: Results are saved to PostgreSQL.
- Stream: Results are sent to the user via SSE or CLI Table.
- Index: Results are indexed in Elasticsearch for future search.
- Graceful Shutdown: The API server and Dispatcher handle context cancellation to ensure clean exits.
- Rate Limiting: Integrated Redis logic to prevent API bans on target platforms.
- Type Safety: Built entirely in Golang with strong interface contracts.