Skip to content

r14dd/matchsentinel

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

37 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

-----------------------------------------------------

➤ MatchSentinel

Live Fraud Defense Platform

Transaction Intelligence → AI Risk Scoring → Rule Engine Flags → Case Ops → Notifications → Reporting

Built as a production‑style, end‑to‑end system with Spring Boot microservices, RabbitMQ, PostgreSQL + Liquibase, and a cinematic React + Vite analyst dashboard.

Java Spring Boot RabbitMQ PostgreSQL Vite TypeScript

MatchSentinel Live Dashboard Demo (AWS EC2)

Recorded against a live AWS EC2 deployment.


-----------------------------------------------------

➤ ⚡ What is MatchSentinel?

MatchSentinel is a real, event‑driven fraud defense platform that actually runs end‑to‑end. It ingests transactions, scores risk, flags anomalies, opens cases, sends notifications, and rolls everything into daily reporting — all visible in a live analyst console.


-----------------------------------------------------

➤ ✨ Why it stands out

  • Full pipeline: Transaction → AI → Rule Engine → Case → Notification → Reporting
  • Event‑driven architecture with RabbitMQ
  • Service‑level persistence (Postgres + Liquibase per service)
  • Idempotent reporting updates (safe with at‑least‑once delivery)
  • Live dashboard with filters, drill‑downs, and pipeline simulator
  • Clean separation of concerns, production‑style structure

-----------------------------------------------------

➤ 🧠 Design Decisions

Decision Why it matters
RabbitMQ event bus Decouples services, enables async processing, and supports at‑least‑once delivery across the pipeline.
Per‑service Postgres + Liquibase Keeps data ownership clear and migrations explicit. Each service evolves independently.
Idempotent reporting updates Reporting safely handles retries and duplicate events — critical in real event‑driven systems.
AI service isolated Scoring logic can evolve (heuristics → ML) without touching upstream services.
Rule engine separated from AI Keeps deterministic policy rules distinct from probabilistic AI scoring.

-----------------------------------------------------

➤ 🏗️ Architecture (high‑level)

MatchSentinel Architecture


-----------------------------------------------------

➤ 🧩 Services

Service Port Purpose
Auth Service 8081 Authentication (foundation; UI integration pending)
Transaction Service 8082 Ingest transactions + publish events
Rule Engine Service 8083 Heuristic + AI‑driven flags
Case Service 8084 Case creation + assignment + status
Notification Service 8085 Sends notifications and stores audit trail
Reporting Service 8086 Daily rollups + idempotent event counters
AI Service 8087 Risk scoring (heuristic model v1)

-----------------------------------------------------

➤ 🚀 Quickstart (Docker)

docker compose up -d --build

-----------------------------------------------------

➤ ✅ Health checks

curl -s http://localhost:8081/actuator/health | jq .
curl -s http://localhost:8082/actuator/health | jq .
curl -s http://localhost:8083/actuator/health | jq .
curl -s http://localhost:8084/actuator/health | jq .
curl -s http://localhost:8085/actuator/health | jq .
curl -s http://localhost:8086/actuator/health | jq .
curl -s http://localhost:8087/actuator/health | jq .

-----------------------------------------------------

➤ ☁️ Deployment (AWS EC2)

This demo was deployed on AWS EC2 and recorded from a live VM environment.

1) Launch EC2

  • Instance type: t3.small (t3.medium if builds are slow)
  • OS: Ubuntu 22.04/24.04
  • Security Group inbound:
    • 22 (SSH)
    • 8081–8087 (services)
    • 15672 (RabbitMQ UI, optional)

2) Install Docker + Compose (on the VM)

sudo apt update
sudo apt install -y docker.io docker-compose git
sudo usermod -aG docker $USER
newgrp docker

3) Deploy

git clone https://github.com/r14dd/matchsentinel.git
cd matchsentinel
docker-compose up -d --build

4) Verify

curl -s http://<your-ec2-ip>:8082/actuator/health | jq .

5) Run UI locally against the VM

In ui/.env, point all service URLs to your EC2 public IPv4, then:

npm run dev

-----------------------------------------------------

➤ 🎛️ Run the UI (Live Dashboard)

cd ui
npm install
npm run dev

Open: http://localhost:5173

Ensure these env vars exist in ui/.env:

VITE_TRANSACTION_SERVICE_URL=http://localhost:8082
VITE_RULE_ENGINE_URL=http://localhost:8083
VITE_CASE_SERVICE_URL=http://localhost:8084
VITE_NOTIFICATION_SERVICE_URL=http://localhost:8085
VITE_REPORTING_SERVICE_URL=http://localhost:8086
VITE_AI_SERVICE_URL=http://localhost:8087

-----------------------------------------------------

➤ ⚙️ One‑click demo (Pipeline Simulator)

In the UI, open Pipeline Simulator and click Run Pipeline.

Expected flow:

  • Transaction created
  • AI score generated
  • Rule Engine flag created
  • Case opened
  • Notification sent
  • Reporting counters updated

-----------------------------------------------------

➤ 🔬 Manual smoke test (API)

# ➤ Create a transaction
curl -s -X POST http://localhost:8082/api/transactions \
  -H "Content-Type: application/json" \
  -d '{
    "accountId":"11111111-1111-1111-1111-111111111111",
    "amount":15000.00,
    "currency":"USD",
    "country":"IR",
    "merchant":"Test Merchant",
    "occurredAt":"2026-01-26T10:15:30Z"
  }' | jq .

# ➤ AI Decision
curl -s "http://localhost:8087/api/ai/decisions?transactionId=<TX_ID>" | jq .

# ➤ Flags
curl -s "http://localhost:8083/api/flags" | jq .

# ➤ Cases
curl -s "http://localhost:8084/api/cases" | jq .

# ➤ Notifications
curl -s "http://localhost:8085/api/notifications" | jq .

# ➤ Reporting
curl -s "http://localhost:8086/api/reports/daily?date=2026-01-26" | jq .

-----------------------------------------------------

➤ 🧪 Testing

Each service supports unit + integration tests (Testcontainers for Postgres/RabbitMQ).

Example:

cd services/reporting-service
./mvnw -Pintegration-tests -Dtest=ReportingIntegrationTest test

-----------------------------------------------------

➤ 🎨 UI Highlights

  • Dark cinematic theme
  • Pipeline simulator (full flow trigger)
  • Filterable tables (flags, cases, notifications)
  • Live detail drawer with case actions + AI insights
  • Auto‑refresh toggle

-----------------------------------------------------

➤ 🧠 Tech Stack

  • Java 17 / Spring Boot 3.5.x
  • RabbitMQ event bus
  • PostgreSQL + Liquibase per service
  • Testcontainers for integration tests
  • React + Vite + TypeScript UI

-----------------------------------------------------

➤ 🛣️ What’s next (ideas)

  • Auth + RBAC integration in UI
  • WebSocket streaming
  • Persist case notes in backend
  • Exportable reporting APIs
  • Observability dashboards (Prometheus + Grafana)

-----------------------------------------------------


➤ Authors


➤ License

MIT

About

MatchSentinel is a real, event‑driven fraud defense platform that actually runs end‑to‑end. It ingests transactions, scores risk, flags anomalies, opens cases, sends notifications, and rolls everything into daily reporting — all visible in a live analyst console.

Resources

Stars

Watchers

Forks

Contributors