Two pieces here:
frontend/— your existing FlashGuard React UI, unchanged (same design, same pages), only the default backend port changed from8090to8099because8090is alreadybdh_watchdogin yourdocker-compose.yml.dashboard_bff/— a new FastAPI service that replaces the oldsimulator.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.
# 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 devOpen 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).
| 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 |
- No merchant name reaches the dashboard.
gateway/main.py'semit_alert_to_redisUDF only forwardsaccount_id, amount, ml_fraud_score, rolling_spend_10m, txn_count_10m, is_fraudulent, active_threats, bitmask— it dropsMerchantIDand the original CSVTransactionIDfromlayer0/transaction_connector.py. Dashboard shows"N/A"for merchant until you add those two fields to the emitted alert dict. - a6b_drift_detector, a8_sar_drafter, a10_feedback_loop are islands.
Nothing in
orcestrator/orgateway/main.pycalls 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 inorcestrator/nodes.pyorgateway/main.py'sprocess_alert(). - sanctions_hit only gets set inside the LangGraph
action_gateway/ sanctions node — it's not present on the raw Redis alert, so it defaults toFalseuntil 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.