Skip to content

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FlashGuard Dashboard — wired to the real engine

Two pieces here:

  • frontend/ — your existing FlashGuard React UI, unchanged (same design, same pages), only the default backend port changed from 8090 to 8099 because 8090 is already bdh_watchdog in your docker-compose.yml.
  • dashboard_bff/ — a new FastAPI service that replaces the old simulator.py-based backend. It talks to your REAL microservices (gateway, agent6, bdh_watchdog, a5/a8/a10 pathway agents) over Redis + REST, and exposes the exact same routes the frontend already calls, so the UI code needs no rewrite.

Run order

# 1) the real backend stack
cd FraudDetectionUsingPathway-main
cp .env.example .env        # fill in GROQ_API_KEY
docker compose up --build

# 2) the dashboard BFF
cd dashboard_bff
pip install -r requirements.txt
uvicorn main:app --reload --port 8099

# 3) the frontend
cd frontend
npm install
npm run dev

Open the dashboard, go to Settings, confirm API base URL is http://localhost:8099 and WS URL is ws://localhost:8099/ws/stream (these are now the defaults).

What's real now vs. before

Page Before (flashguard.zip) Now
Live feed / Dashboard random.uniform() fake txns Real txns read off gateway:alerts + pathway:events Redis streams, merged by txn_id
Orchestrator random active_node Derived from actual llm_escalated flag returned by the LangGraph graph
Watchdog random pass-rates Real session data from bdh_watchdog's /sessions
Compliance Groq LLM or hardcoded KB Real call to a5_compliance_rag (sentence-transformer vector search over your actual policy docs)
SAR random hardcoded narrative Real call to a8_sar_drafter when a txn is FREEZE/LOCK_CARD
Drift random.random() per hour Real a6b_drift_detector (ADWIN + HalfSpaceTrees) score per txn, bucketed by hour
Feedback static list Real call to a10_feedback_loop (online River logistic regression), logged locally
Manual submit fake action logic Proxies straight to gateway /submit, which runs the actual LangGraph orchestrator

Real gaps found in your own backend (not something I invented — flag these)

  1. No merchant name reaches the dashboard. gateway/main.py's emit_alert_to_redis UDF only forwards account_id, amount, ml_fraud_score, rolling_spend_10m, txn_count_10m, is_fraudulent, active_threats, bitmask — it drops MerchantID and the original CSV TransactionID from layer0/transaction_connector.py. Dashboard shows "N/A" for merchant until you add those two fields to the emitted alert dict.
  2. a6b_drift_detector, a8_sar_drafter, a10_feedback_loop are islands. Nothing in orcestrator/ or gateway/main.py calls them — they're fully working Pathway pipelines with no traffic. The BFF calls them itself (real HTTP calls, not fake data) so their dashboard tabs have live data, but if you want the actual pipeline to do this wiring, it belongs in orcestrator/nodes.py or gateway/main.py's process_alert().
  3. sanctions_hit only gets set inside the LangGraph action_gateway/ sanctions node — it's not present on the raw Redis alert, so it defaults to False until the orchestrator actually runs that node for a txn.

Test end-to-end from my side wasn't possible — I don't have Docker/Redis in this sandbox — so this is built strictly against your code's documented contracts (ports in docker-compose.yml, schemas in each agent.py/api.py). Run it and if any endpoint 500s, paste me the error and I'll fix that specific one without touching anything else.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages