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:
John Patrick TeruelandCopilot committed 2026-04-24 22:03:36 +08:00
1 parent 4cefdb9083
commit d4751b9061
2 files changed
+26 -41

No files matched your search

+20 -34
View File
@@ -1,19 +1,19 @@
# PayGuard Fraud Detection - Complete Demo Guide
## Quick Start (5 minutes)
## Quick Start (2 minutes)
```bash
# Terminal 1: Start all services
# Terminal 1: Start all services (including consumer)
docker compose up -d --build
# Terminal 2: Start fraud detection consumer
cd consumer && python3 pipeline.py
# Terminal 2: Watch consumer logs (real-time fraud detection)
docker compose logs -f consumer
# Terminal 3: Open in browser
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
2. **API** (http://localhost:8000) - Validates, publishes to Kafka
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)
6. **Redis** - Stores final results
@@ -52,20 +52,15 @@ Transaction → Features → ML Layer 1 → ML Layer 2 → Decision → Risk Ass
docker compose ps
```
Verify all 5 are "Up":
Verify all 6 are "Up":
```
zookeeper - Running
kafka - Healthy
redis - Healthy
api - Healthy with CORS
frontend - Healthy
```
### Consumer Dependencies
```bash
# Make sure Python packages are installed
python3 -m pip install --break-system-packages kafka-python redis requests pybreaker
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
payguard-consumer Up (internal)
```
---
@@ -79,22 +74,13 @@ docker compose ps
```
**Expected output:**
```
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
```
All 6 services should show "Up" status.
### Step 2: Start Consumer Pipeline (1 minute)
### Step 2: Watch Consumer Logs (1 minute)
```bash
# Terminal 2
cd /Users/pat/Projects/PAT/payguard-poc
cd consumer
python3 pipeline.py
docker compose logs -f consumer
```
**Expected output:**
@@ -126,7 +112,7 @@ You'll see the PayGuard transaction form.
### 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] 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] Amount: $5000.00 | Merchant: Electronics Store
+6 -7
View File
@@ -1,19 +1,18 @@
# 🚀 PayGuard Fraud Detection System - Quick Start
## Get Started in 3 Steps (5 minutes)
## Get Started in 2 Steps (2 minutes)
```bash
# 1️⃣ Start all Docker services
# 1️⃣ Start all Docker services (including fraud detection consumer)
docker compose up -d --build
# 2️⃣ Start the fraud detection consumer
cd consumer && python3 pipeline.py
# 3️⃣ Open the frontend
# 2️⃣ Open the frontend
# 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`
---