Skip to main content

Demo Dashboard

Professional-grade Streamlit dashboard for demonstrating and testing the fraud detection system.


Overview

The demo dashboard provides a visual interface for:

  • Real-time transaction testing with attack simulation presets
  • Score visualization with interactive gauges
  • Analytics and decision history
  • Policy inspection

URL: http://localhost:8501


Dashboard Sections

System Status (Sidebar)

The sidebar displays real-time system health:

IndicatorDescription
System StatusOverall health (Healthy/Degraded/Down)
RedisVelocity counter store status
PostgreSQLEvidence storage status
PolicyPolicy engine loaded status
Policy VersionCurrent policy version number

Also shows API endpoint information and last decision summary.


Transaction Simulator

Interactive form for submitting test transactions with pre-configured attack scenarios.

Attack Presets

PresetDescriptionExpected Decision
Normal TransactionTypical legitimate $50 transactionALLOW
Card Testing AttackSmall $1 amount with datacenter IPREVIEW/BLOCK
Velocity AttackHigh-value $1500 from new accountFRICTION/REVIEW
Geographic AnomalyUS card transacting from NigeriaREVIEW
Bot/Emulator AttackEmulated device via Tor exit nodeBLOCK
Friendly Fraud RiskHigh-value from dispute-prone profileFRICTION

Customizable Fields

  • Amount (dollars)
  • Service ID (telco service identifier)
  • Event Subtype (sim_activation, topup, device_upgrade, sim_swap)
  • Card Token
  • User ID / Subscriber ID
  • Phone Number and IMEI (telco-specific)
  • Device flags (Emulator, Rooted)
  • Network flags (Tor, Datacenter, VPN)

Decision Result Display

When a transaction is submitted, the dashboard shows:

Decision Badge

Large colored badge indicating the decision:

  • ALLOW (green) - Transaction approved
  • FRICTION (yellow) - Additional verification required (3DS, OTP)
  • REVIEW (orange) - Manual review queue
  • BLOCK (red) - Transaction declined

Score Gauges

Four interactive gauges showing:

GaugeDescriptionColor Scale
Overall RiskCombined risk score (0-100%)Green to Red
CriminalCriminal fraud probabilityGreen to Red
Friendly FraudFriendly fraud probabilityGreen to Red
Bot ScoreAutomation/bot probabilityGreen to Red

Color thresholds:

  • 0-30%: Green (low risk)
  • 30-60%: Yellow (medium risk)
  • 60-80%: Orange (elevated risk)
  • 80-100%: Red (high risk)

Detailed Score Breakdown

Expandable section showing individual detector scores:

  • Card Testing Score
  • Velocity Score
  • Geo Anomaly Score
  • Confidence Level

Triggered Reasons

Each risk factor that contributed to the decision is displayed as a card:

[CRITICAL] BOT_EMULATOR
Device appears to be an emulator

[HIGH] BOT_TOR_EXIT
Transaction from Tor exit node

Severity levels: CRITICAL, HIGH, MEDIUM, LOW

Friction/Review Information

If friction is required, shows:

  • Friction type (3DS, OTP, STEP_UP, CAPTCHA)
  • User-facing message

If review is required, shows:

  • Review priority (HIGH, MEDIUM, LOW)
  • Review notes summarizing concerns

Analytics Dashboard

Visual analytics for the last 24 hours of transactions.

Key Metrics Row

MetricDescription
Total TransactionsCount of decisions made
Avg Risk ScoreMean risk score
P95 Risk Score95th percentile risk score
Avg LatencyMean processing time
P99 Latency99th percentile processing time

Decision Distribution Chart

Donut chart showing breakdown of decisions:

  • ALLOW (green)
  • FRICTION (yellow)
  • REVIEW (orange)
  • BLOCK (red)

Hourly Transaction Volume

Bar chart showing transaction count per hour.

Latency Over Time

Line chart showing average latency per hour with 200ms target line.


Decision History

Query historical decisions from PostgreSQL evidence table.

Filters

  • Limit: 25, 50, 100, or 250 records
  • Decision type: Multi-select ALLOW/FRICTION/REVIEW/BLOCK

Table Columns

ColumnDescription
Transaction IDUnique transaction identifier
DecisionALLOW/FRICTION/REVIEW/BLOCK
AmountTransaction amount in dollars
Risk ScoreOverall risk percentage
LatencyProcessing time in milliseconds
TimeTimestamp of decision

Summary Statistics

  • Approval Rate (% ALLOW decisions)
  • Block Rate (% BLOCK decisions)
  • Avg Risk Score
  • Avg Latency

Policy Inspector

View the current policy configuration without editing.

Policy Overview

  • Version number
  • Default action
  • Description

Score Thresholds

Display of threshold configuration for each score type:

Score TypeBlockReviewFriction
Risk90%70%50%
Criminal85%65%45%
Friendly95%60%40%

Active Rules

Expandable list of all enabled rules showing:

  • Rule name and priority
  • Description
  • Action (BLOCK, REVIEW, FRICTION)
  • Friction type (if applicable)
  • Conditions (JSON format)

Lists Summary

Count of entries in:

  • Blocklists (Cards, Devices, IPs, Users)
  • Allowlists (Cards, Users, Services)

Raw Policy

Expandable section showing full YAML configuration.


Policy Settings (v1.1)

Edit policy configuration with full version control and audit trail.

Current Version Info

Displays at the top:

  • Current Version (semantic: MAJOR.MINOR.PATCH)
  • Last Changed By
  • Last Updated timestamp
  • Policy Hash (for integrity)

Thresholds Tab

Interactive sliders for each score type (Risk, Criminal, Friendly):

  • Friction Threshold (green zone)
  • Review Threshold (yellow zone)
  • Block Threshold (red zone)

Validation: Ensures friction < review < block. Invalid configurations are blocked.

Rules Tab

Existing Rules Display:

  • Sorted by priority (lower = higher priority)
  • Status indicators (enabled/disabled)
  • Expandable details with conditions JSON
  • Delete button for each rule

Add New Rule Form:

  • Rule ID and Name
  • Description
  • Priority (1-1000)
  • Enabled toggle
  • Action (ALLOW, FRICTION, REVIEW, BLOCK)
  • Friction Type (3DS, OTP, STEP_UP, CAPTCHA)
  • Review Priority (LOW, MEDIUM, HIGH, URGENT)
  • Conditions (JSON editor)

Blocklists Tab

Manage blocked entities:

List TypeDescription
Card TokensPermanently block specific cards
Device IDsBlock compromised devices
IP AddressesBlock malicious IPs
User IDsBlock fraudulent users

Each item can be added or removed. Changes create new policy versions.

Allowlists Tab

Manage trusted entities that skip fraud checks:

List TypeDescription
Card TokensVIP or corporate cards
User IDsVerified trusted subscribers
Service IDsWhitelisted telco services

Version History Tab

View complete policy change history:

  • Version number with active indicator
  • Change type (threshold, rule_add, rule_delete, rollback, etc.)
  • Change summary
  • Changed by (user)
  • Created at timestamp
  • Rollback button for non-active versions

Rollback creates a new version from old content (immutable history).


Running the Dashboard

Prerequisites

  • Fraud API running on port 8000
  • Redis running on port 6379
  • PostgreSQL running on port 5432

Start Command

cd /Users/omega/Projects/FraudDetection
streamlit run dashboard.py --server.port 8501

Environment Variables

VariableDefaultDescription
FRAUD_API_URLhttp://localhost:8000Fraud API endpoint
POSTGRES_URLpostgresql://fraud_user:fraud_pass@localhost:5432/fraud_detectionDatabase URL

UI/UX Design

Color Scheme

ElementColorUsage
Primary#3b82f6Buttons, links, active states
Success#10b981ALLOW decisions, healthy status
Warning#f59e0bFRICTION decisions, degraded status
Danger#ef4444BLOCK decisions, errors
Review#f97316REVIEW decisions

Typography

  • Headers: System font, bold
  • Body: System font, regular
  • Metrics: Monospace for numbers
  • Code: Monospace with background

Layout

  • Responsive two-column layout for simulator
  • Full-width charts for analytics
  • Collapsible sections for detailed information
  • Sticky sidebar for system status

Demo Workflow

  1. Start with Normal Transaction

    • Show ALLOW decision
    • Point out low risk scores
    • Highlight fast latency (<10ms)
  2. Card Testing Attack

    • Show detection of small amount + datacenter IP
    • Explain velocity counter concept
  3. Geographic Anomaly

    • Show country mismatch detection
    • Explain geo-risk scoring
  4. Bot/Emulator Attack

    • Show BLOCK decision
    • Walk through multiple triggered reasons
    • Point out CRITICAL severity flags
  5. Analytics Dashboard

    • Show decision distribution
    • Highlight latency performance
    • Explain 200ms target
  6. Decision History

    • Filter by BLOCK decisions
    • Show evidence capture for disputes
  7. Policy Inspector

    • Explain threshold configuration
    • Show rule priority system
    • Demonstrate hot-reload capability
  8. Policy Settings (v1.1)

    • Adjust a threshold slider (show validation)
    • Add a test rule (show version increment)
    • View version history
    • Demonstrate rollback capability

Troubleshooting

Dashboard Not Loading

Check that Streamlit is installed:

pip install streamlit plotly pandas

API Connection Failed

Verify API is running:

curl http://localhost:8000/health

Database Connection Failed

Check PostgreSQL connection:

docker-compose ps

Charts Not Displaying

Ensure Plotly is installed:

pip install plotly

Dashboard Version: 1.1 Last Updated: January 3, 2026 - Added Policy Settings tab with version control