Update documentation - consumer now in Docker
- README: 3 steps → 2 steps (no manual consumer startup needed) - DEMO: Updated quick start to use 'docker compose logs -f consumer' - Updated references from 'Consumer Terminal' to 'consumer logs' - Clarified that entire system runs via 'docker compose up -d' Co-authored-by: Copilot <[email protected]>
This commit is contained in:
1 parent
4cefdb9083
commit
d4751b9061
2 files changed
+26
-41
No files matched your search
@@ -1,19 +1,19 @@
|
|||||||
# PayGuard Fraud Detection - Complete Demo Guide
|
# PayGuard Fraud Detection - Complete Demo Guide
|
||||||
|
|
||||||
## Quick Start (5 minutes)
|
## Quick Start (2 minutes)
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# Terminal 1: Start all services
|
# Terminal 1: Start all services (including consumer)
|
||||||
docker compose up -d --build
|
docker compose up -d --build
|
||||||
|
|
||||||
# Terminal 2: Start fraud detection consumer
|
# Terminal 2: Watch consumer logs (real-time fraud detection)
|
||||||
cd consumer && python3 pipeline.py
|
docker compose logs -f consumer
|
||||||
|
|
||||||
# Terminal 3: Open in browser
|
# Terminal 3: Open in browser
|
||||||
http://localhost:3000
|
http://localhost:3000
|
||||||
```
|
```
|
||||||
|
|
||||||
Then submit transactions and watch fraud detection work!
|
Then submit transactions and watch fraud detection work in real-time!
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
@@ -30,7 +30,7 @@ Transaction → Features → ML Layer 1 → ML Layer 2 → Decision → Risk Ass
|
|||||||
1. **Frontend** (http://localhost:3000) - User submits transactions
|
1. **Frontend** (http://localhost:3000) - User submits transactions
|
||||||
2. **API** (http://localhost:8000) - Validates, publishes to Kafka
|
2. **API** (http://localhost:8000) - Validates, publishes to Kafka
|
||||||
3. **Kafka** - Message broker queues transactions
|
3. **Kafka** - Message broker queues transactions
|
||||||
4. **Consumer** - Picks up messages and runs ML pipeline
|
4. **Consumer** (Docker container) - Picks up messages and runs ML pipeline
|
||||||
5. **ML Models** - Score fraud risk (0.0-1.0 scale)
|
5. **ML Models** - Score fraud risk (0.0-1.0 scale)
|
||||||
6. **Redis** - Stores final results
|
6. **Redis** - Stores final results
|
||||||
|
|
||||||
@@ -52,20 +52,15 @@ Transaction → Features → ML Layer 1 → ML Layer 2 → Decision → Risk Ass
|
|||||||
docker compose ps
|
docker compose ps
|
||||||
```
|
```
|
||||||
|
|
||||||
Verify all 5 are "Up":
|
Verify all 6 are "Up":
|
||||||
```
|
```
|
||||||
zookeeper - Running
|
NAME STATUS PORTS
|
||||||
kafka - Healthy
|
payguard-zookeeper Up 2181
|
||||||
redis - Healthy
|
payguard-kafka Healthy 9092
|
||||||
api - Healthy with CORS
|
payguard-redis Healthy 6379
|
||||||
frontend - Healthy
|
payguard-api Healthy with CORS 8000
|
||||||
```
|
payguard-frontend Healthy 3000
|
||||||
|
payguard-consumer Up (internal)
|
||||||
### Consumer Dependencies
|
|
||||||
|
|
||||||
```bash
|
|
||||||
# Make sure Python packages are installed
|
|
||||||
python3 -m pip install --break-system-packages kafka-python redis requests pybreaker
|
|
||||||
```
|
```
|
||||||
|
|
||||||
---
|
---
|
||||||
@@ -79,22 +74,13 @@ docker compose ps
|
|||||||
```
|
```
|
||||||
|
|
||||||
**Expected output:**
|
**Expected output:**
|
||||||
```
|
All 6 services should show "Up" status.
|
||||||
NAME STATUS PORTS
|
|
||||||
payguard-zookeeper Up 2181
|
|
||||||
payguard-kafka Healthy 9092
|
|
||||||
payguard-redis Healthy 6379
|
|
||||||
payguard-api Healthy with CORS 8000
|
|
||||||
payguard-frontend Healthy 3000
|
|
||||||
```
|
|
||||||
|
|
||||||
### Step 2: Start Consumer Pipeline (1 minute)
|
### Step 2: Watch Consumer Logs (1 minute)
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# Terminal 2
|
# Terminal 2
|
||||||
cd /Users/pat/Projects/PAT/payguard-poc
|
docker compose logs -f consumer
|
||||||
cd consumer
|
|
||||||
python3 pipeline.py
|
|
||||||
```
|
```
|
||||||
|
|
||||||
**Expected output:**
|
**Expected output:**
|
||||||
@@ -126,7 +112,7 @@ You'll see the PayGuard transaction form.
|
|||||||
|
|
||||||
### Step 5: Submit Test Transactions (6 minutes)
|
### Step 5: Submit Test Transactions (6 minutes)
|
||||||
|
|
||||||
Submit these 4 scenarios in order. After each one, watch the Consumer Terminal for output.
|
Submit these 4 scenarios in order. After each one, watch the Consumer logs for output.
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
@@ -151,7 +137,7 @@ Description: Morning coffee purchase
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
**Watch Consumer Terminal:**
|
**Watch consumer logs (from Terminal 2):**
|
||||||
```
|
```
|
||||||
[INFO] [TRANSACTION INTAKE] Processing transaction: txn_abc123
|
[INFO] [TRANSACTION INTAKE] Processing transaction: txn_abc123
|
||||||
[INFO] Amount: $75.50 | Merchant: Starbucks Coffee
|
[INFO] Amount: $75.50 | Merchant: Starbucks Coffee
|
||||||
@@ -188,7 +174,7 @@ Description: Laptop purchase
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
**Watch Consumer Terminal:**
|
**Watch consumer logs (from Terminal 2):**
|
||||||
```
|
```
|
||||||
[INFO] [TRANSACTION INTAKE] Processing transaction: txn_def456
|
[INFO] [TRANSACTION INTAKE] Processing transaction: txn_def456
|
||||||
[INFO] Amount: $5000.00 | Merchant: Electronics Store
|
[INFO] Amount: $5000.00 | Merchant: Electronics Store
|
||||||
|
|||||||
@@ -1,19 +1,18 @@
|
|||||||
# 🚀 PayGuard Fraud Detection System - Quick Start
|
# 🚀 PayGuard Fraud Detection System - Quick Start
|
||||||
|
|
||||||
## Get Started in 3 Steps (5 minutes)
|
## Get Started in 2 Steps (2 minutes)
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# 1️⃣ Start all Docker services
|
# 1️⃣ Start all Docker services (including fraud detection consumer)
|
||||||
docker compose up -d --build
|
docker compose up -d --build
|
||||||
|
|
||||||
# 2️⃣ Start the fraud detection consumer
|
# 2️⃣ Open the frontend
|
||||||
cd consumer && python3 pipeline.py
|
|
||||||
|
|
||||||
# 3️⃣ Open the frontend
|
|
||||||
# Visit http://localhost:3000 in your browser
|
# Visit http://localhost:3000 in your browser
|
||||||
```
|
```
|
||||||
|
|
||||||
**That's it!** Now submit transactions and watch fraud detection work in real-time.
|
**That's it!** The entire system runs in Docker. Submit transactions and watch fraud detection work in real-time.
|
||||||
|
|
||||||
|
Monitor consumer logs with: `docker compose logs -f consumer`
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user