How vakeer56/exploitx works
Purpose and Runtime Entry Points
ExploitX is a MERN financial-crime investigation platform for tracing illicit cryptocurrency movement, scoring risk, estimating interception windows, and producing investigator-facing outputs. Express starts from backend/server.js, composes middleware/routes in backend/src/app.js, and serves /api. The primary React/Vite client boots at frontend/src/main.jsx and routes/views are composed in frontend/src/App.jsx.
Persistence and Case State
MongoDB is the production system of record for transactions, graph edges, investigations, scam/bridge intelligence, console consensus state, synthetic cases, and copilot plans. Database definitions and driver initialization are in backend/src/db/definitions.js and backend/src/db/index.js; backend/src/db/memoryDriver.js is an explicitly non-persistent demo/test alternative. Initial/demo data is seeded through backend/src/seed/seed.js and demo/seed_data.json.
Investigation Pipeline
POST /api/investigate/:txHash enters through backend/src/routes/investigate.js and orchestrates the pipeline in backend/src/services/pipeline.js:
1. acquire/store transaction evidence;
2. expand transaction relationships;
3. evaluate risk signals;
4. compute the golden interception window;
5. produce evidence-grounded narration;
6. persist the completed investigation for later reports.
This is the main control boundary between HTTP/API handling and forensic domain engines.
Chain Intake and Graph Expansion
Ingestion hashes and stores incoming evidence in backend/src/ingestion/hashAndStore.js. Live and synthetic chain sources are abstracted behind adapters: backend/src/adapters/liveChainRouter.js, backend/src/adapters/explorerAdapter.js, and backend/src/adapters/syntheticCaseAdapter.js. Provider implementations include Etherscan, public RPC, and Solana under backend/src/adapters/providers/. backend/src/engines/graphEngine.js traverses persisted directed edges subject to graph/fan-out configuration, while backend/src/adapters/bridgeAdapter.js and backend/src/graph/mixerIndex.js identify cross-chain and mixer boundaries.
Detection, Timing, and Async Follow-up
backend/src/engines/detectionEngine.js applies weighted behavioral rules, including scam intelligence, rapid fan-out, structuring, bridge exits, and other configured indicators. backend/src/engines/raceEngine.js estimates probabilistic settlement/interception windows. Long-running deep tracing and revictimization monitoring are separated from request work through backend/src/queues/deepTraceQueue.js, backend/src/workers/deepTraceWorker.js, backend/src/queues/revictimizationQueue.js, and backend/src/workers/revictimizationWorker.js.
Governance, Access, and Audit
Consensus-based changes to detection weights are handled by backend/src/console/analystConsole.js and persisted via backend/src/console/consoleRepository.js; API exposure is in backend/src/routes/console.js. Authorization is attribute/policy oriented: backend/src/security/middleware.js, backend/src/security/policyEngine.js, and the OPA policy policies/access.rego. Authentication, case-read resolution, cross-jurisdiction grants, rank enforcement, and audit logging form a security boundary under backend/src/security/.
Narration, Copilot, and Reporting
Narration combines deterministic facts/templates with an optional self-hosted Ollama phi3 model: backend/src/engines/narrationLayer.js, backend/src/narration/llamaClient.js, and backend/src/narration/narrationFacts.js. Failure or timeout falls back locally rather than calling third-party AI. The analyst-approved query-plan flow is isolated in backend/src/copilot/investigationCopilot.js and backend/src/routes/copilot.js. Investigation evidence becomes case packets, PDFs, prosecutor briefs, and victim advisories through backend/src/reporting/casePacket.js, backend/src/reporting/pdfReport.js, and backend/src/reporting/prosecutorBriefGenerator.js.
External Boundaries and Deployment
Material services are MongoDB, optional local/controlled Ollama, and blockchain/scam-data providers represented by backend/src/adapters/providers/ and backend/src/adapters/scamDbAdapter.js; circuit breakers protect provider access in backend/src/adapters/circuitBreakers.js. Law-enforcement workflow integrations are adapterized in backend/src/integrations/ncrpIntakeAdapter.js, backend/src/integrations/cctnsCaseLinkAdapter.js, and backend/src/integrations/fiuFreezeAdapter.js. Container topology is defined by backend/Dockerfile and docker-compose.yml.
Main entry points: pipeline.js Investigation pipeline · index.js MongoDB case store · hashAndStore.js Evidence hashing & storage · graphEngine.js Relationship expansion
Components 22
Investigator Client
- React/Vite client
frontend/src/main.jsx - Investigation views
frontend/src/App.jsx
API & Security
- Express API · Serves the /api boundary.
backend/server.js - App routes & middleware
backend/src/app.js - Policy authorization · Enforces attributes, grants, rank, and audit.
backend/src/security/middleware.js - Investigation endpoint
backend/src/routes/investigate.js
Forensic Pipeline
- Investigation pipeline · Coordinates acquisition through persisted investigation.
backend/src/services/pipeline.js - Evidence hashing & storage
backend/src/ingestion/hashAndStore.js - Chain source adapters · Routes live and synthetic chain evidence.
backend/src/adapters/liveChainRouter.js - Relationship expansion · Traverses directed edges within fan-out limits.
backend/src/engines/graphEngine.js - Bridge & mixer detection
backend/src/adapters/bridgeAdapter.js - Risk scoring · Applies weighted behavioral and scam signals.
backend/src/engines/detectionEngine.js - Interception window
backend/src/engines/raceEngine.js - Evidence narration · Uses local deterministic fallback on model failure.
backend/src/engines/narrationLayer.js
Async, Governance & Outputs
- Deep trace & monitoring · Separates long-running tracing and revictimization monitoring.
backend/src/workers/deepTraceWorker.js - Detection-weight consensus
backend/src/console/analystConsole.js - Approved query plans
backend/src/copilot/investigationCopilot.js - Case packets & briefs
backend/src/reporting/casePacket.js
Data & External Services
- MongoDB case store · Stores evidence, graphs, cases, intelligence, and plans.
backend/src/db/index.js - Blockchain & scam providers · Provider adapters are circuit-breaker protected.
- Local Ollama phi3
backend/src/narration/llamaClient.js - Law-enforcement systems
backend/src/integrations/fiuFreezeAdapter.js
Connections 26
- React/Vite client → Investigation views: renders
- Investigation views → Express API: /api requests
- Express API → App routes & middleware: composes
- App routes & middleware → Policy authorization: applies
- Policy authorization → Investigation endpoint: authorizes
- Investigation endpoint → Investigation pipeline: POST investigate
- Investigation pipeline → Evidence hashing & storage: acquires evidence
- Evidence hashing & storage → Chain source adapters: fetches chain data
- Chain source adapters → Blockchain & scam providers: queries
- Evidence hashing & storage → MongoDB case store: stores hashed evidence
- Investigation pipeline → Relationship expansion: expands relationships
- Relationship expansion → MongoDB case store: reads persisted edges
- Relationship expansion → Bridge & mixer detection: checks boundaries
- Investigation pipeline → Risk scoring: evaluates risk
- Risk scoring → MongoDB case store: uses intelligence
- Investigation pipeline → Interception window: estimates window
- Investigation pipeline → Evidence narration: builds narrative
- Evidence narration → Local Ollama phi3: optional generation
- Investigation pipeline → MongoDB case store: persists investigation
- Investigation pipeline → Deep trace & monitoring: queues follow-up
- Deep trace & monitoring → MongoDB case store: updates cases
- Detection-weight consensus → Risk scoring: governs weights
- Detection-weight consensus → MongoDB case store: persists consensus
- Approved query plans → MongoDB case store: stores approved plans
- Case packets & briefs → MongoDB case store: reads investigation evidence
- Case packets & briefs → Law-enforcement systems: supports workflow