-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstart.sh
More file actions
executable file
Β·83 lines (67 loc) Β· 2.36 KB
/
start.sh
File metadata and controls
executable file
Β·83 lines (67 loc) Β· 2.36 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
#!/bin/bash
# Dynamic AML System Startup Script
echo "π‘οΈ Dynamic AML Agentic Platform"
echo "================================="
# Check if virtual environment exists
if [ ! -d "venv" ]; then
echo "π¦ Creating virtual environment..."
python3 -m venv venv
echo "β
Virtual environment created"
fi
# Activate virtual environment
echo "π Activating virtual environment..."
source venv/bin/activate
# Install dependencies
echo "π₯ Installing dependencies..."
pip install -r requirements.txt --quiet
# Check if system is ready
echo "π§ Testing system components..."
python3 -c "
from database import AMLDatabase
from sanctions_loader import SanctionsLoader
from transaction_generator import TransactionGenerator
from dynamic_aml_engine import DynamicAMLEngine
print(' β
All components loaded successfully')
"
if [ $? -ne 0 ]; then
echo "β System check failed"
exit 1
fi
# Initialize system
echo "π Initializing AML system..."
python3 -c "
from database import AMLDatabase
from sanctions_loader import SanctionsLoader
from transaction_generator import TransactionGenerator
from dynamic_aml_engine import DynamicAMLEngine
# Setup system
db = AMLDatabase()
loader = SanctionsLoader()
generator = TransactionGenerator(db)
engine = DynamicAMLEngine(db)
# Load initial data
print('π₯ Loading sanctions data from OpenSanctions...')
try:
loader.refresh_sanctions_data()
print('β
Sanctions data loaded successfully')
except Exception as e:
print(f'β Error loading sanctions data: {e}')
print('π‘ Note: Requires Supabase connection for sanctions data')
print('π² Generating initial transactions...')
transactions = generator.generate_mixed_batch(15)
generator.store_transactions(transactions)
print('β‘ Processing through AML engine...')
results = engine.process_batch(transactions)
print(f' Generated {results[\"alert_count\"]} alerts from {results[\"processed_count\"]} transactions')
stats = db.get_statistics()
print(f'π System ready with {stats[\"total_sanctions\"]} sanctions, {stats[\"total_transactions\"]} transactions, {stats[\"active_alerts\"]} alerts')
"
echo ""
echo "π Starting Flask API server..."
echo " API will be available at: http://localhost:5000/api"
echo " Dashboard available at: dashboard/dynamic.html"
echo ""
echo "π₯ Press Ctrl+C to stop the system"
echo ""
# Start the Flask application
python3 app.py