Skip to content

zuhairah87/Trade_Guard-teamOverfitters

Repository files navigation

🛡️ TradeGuard - AI-Powered Fraud Monitoring Dashboard

A comprehensive fraud monitoring dashboard built with React, integrated with AWS services for real-time fraud detection and analysis.

TradeGuard Dashboard React AWS TypeScript

🚀 Features

📊 Dashboard Analytics

  • Real-time fraud monitoring and detection
  • Interactive KPI cards with key metrics
  • Advanced data filtering and search capabilities
  • Sortable transaction tables with comprehensive data views
  • Geographic distribution analysis with pie charts
  • Deposit vs Withdrawals visualization

🤖 AI-Powered Fraud Analysis

  • Amazon Bedrock Integration - Claude & Llama model support
  • Intelligent risk assessment and scoring
  • Automated fraud pattern detection
  • Detailed investigation reports
  • Priority-based alert system

☁️ AWS Cloud Integration

  • AWS Lambda - Serverless backend API
  • Amazon S3 - Data storage and file management
  • Amazon SNS - Real-time fraud notifications
  • API Gateway - Secure REST API endpoints

🔒 Security & Compliance

  • Soft lock management for suspicious accounts
  • KYC status tracking and monitoring
  • Audit trail and export capabilities
  • Secure credential management

🏗️ Architecture

Frontend (React) ↔ API Gateway ↔ Lambda Functions ↔ AWS Services
                                      ↓
                              Bedrock AI | S3 | SNS

📋 Prerequisites

  • Node.js 16.x or later
  • npm or yarn
  • AWS Account with appropriate permissions
  • AWS CLI configured (for Lambda deployment)

🚀 Quick Start

1. Clone the Repository

git clone https://github.com/yourusername/tradeguard-dashboard.git
cd tradeguard-dashboard

2. Install Dependencies

npm install

3. Start Development Server

npm start

The dashboard will be available at http://localhost:3000

4. Configure AWS Services

Configure S3

  1. Click "⚙️ Configure S3" in the dashboard
  2. Enter your AWS credentials and S3 bucket name
  3. Test the connection

Configure Bedrock AI

  1. Click "⚙️ Configure AI" in the dashboard
  2. Choose between Claude or Llama models
  3. Enter your AWS credentials and region

Configure SNS

  1. Click "⚙️ Configure SNS" in the dashboard
  2. Enter your SNS topic ARN and credentials
  3. Test notification delivery

Configure Lambda API

  1. Deploy the Lambda backend (see Backend Setup)
  2. Click "⚙️ Configure Lambda" in the dashboard
  3. Enter your API Gateway URL

🔧 Backend Setup (AWS Lambda)

Deploy Lambda Functions

  1. Navigate to Lambda directory:

    cd lambda-functions
  2. Install dependencies:

    npm install
  3. Configure environment variables:

    export BEDROCK_MODEL_ID="anthropic.claude-3-sonnet-20240229-v1:0"
    export S3_BUCKET="your-tradeguard-bucket"
    export SNS_TOPIC_ARN="arn:aws:sns:us-east-1:123456789012:TradeGuard-Alerts"
  4. Deploy to AWS:

    npx serverless deploy --stage prod --region us-east-1
  5. Get API Gateway URL from deployment output and configure in frontend

📁 Project Structure

TradeGuardUI/
├── src/
│   ├── snsService.ts          # SNS notification service
│   ├── s3Service.ts           # S3 file management service
│   ├── bedrockService.ts      # AI analysis service
│   └── lambdaService.ts       # Lambda API service
├── lambda-functions/
│   ├── src/
│   │   ├── health.js          # Health check endpoint
│   │   ├── analyze-fraud.js   # AI fraud analysis
│   │   ├── transactions.js    # Transaction management
│   │   └── analytics.js       # Metrics and trends
│   ├── serverless.yml         # Serverless deployment config
│   └── package.json           # Lambda dependencies
├── TradeGuardDashboard.tsx    # Main dashboard component
├── index.html                 # HTML template
├── package.json               # Frontend dependencies
└── README.md                  # This file

🔌 API Endpoints

Health & Status

  • GET /health - API health check

Fraud Analysis

  • POST /analyze-fraud - AI-powered fraud risk analysis

Transaction Management

  • GET /transactions - Retrieve all transactions
  • POST /transactions - Upload/update transactions
  • GET /transactions/{id} - Get specific transaction

Analytics

  • GET /analytics/metrics - Fraud metrics dashboard
  • GET /analytics/trends - Historical trend data

🎯 Usage Examples

Import Transaction Data

  1. Click "Import TSV" in the dashboard
  2. Paste your transaction data in TSV format
  3. Click "Apply" to process the data

Analyze Suspicious Activity

  1. Click on a suspicious transaction row
  2. Click "Analyze with AI" to get detailed risk assessment
  3. Review AI-generated recommendations and investigation report

Manage S3 Files

  1. Click "📁 S3 Files" to view stored data
  2. Upload, download, or delete files as needed
  3. Files are automatically organized by date and type

Send Fraud Alerts

  1. Configure SNS with your notification preferences
  2. Alerts are automatically sent when suspicious activity is detected
  3. Notifications include detailed analysis and recommended actions

🔐 Security Features

  • IAM Role-based Access Control
  • API Key Authentication (optional)
  • CORS Configuration for secure frontend-backend communication
  • Environment Variable Management for sensitive credentials
  • Input Validation and sanitization
  • Audit Logging for all actions

📊 Monitoring & Analytics

  • CloudWatch Integration for logs and metrics
  • Real-time Health Monitoring with status indicators
  • Performance Metrics tracking
  • Error Rate Monitoring and alerting
  • Cost Optimization with usage analytics

🚀 Deployment Options

Frontend Deployment

  • Vercel - One-click deployment
  • Netlify - Static site hosting
  • AWS S3 + CloudFront - Scalable hosting
  • Docker - Containerized deployment

Backend Deployment

  • AWS Lambda - Serverless (recommended)
  • AWS ECS - Containerized deployment
  • AWS EC2 - Traditional server deployment

🧪 Testing

Frontend Testing

npm test

Backend Testing

cd lambda-functions
npm test

Integration Testing

# Test API endpoints
curl https://your-api-gateway-url/health

📈 Performance Optimization

  • Lazy Loading for large datasets
  • Virtual Scrolling for table performance
  • Caching for frequently accessed data
  • CDN Integration for static assets
  • Database Indexing for query optimization

🤝 Contributing

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

📝 License

This project is licensed under the MIT License - see the LICENSE file for details.

🆘 Support

🙏 Acknowledgments

  • AWS for cloud infrastructure services
  • Anthropic for Claude AI models
  • Meta for Llama AI models
  • React team for the amazing framework
  • Recharts for beautiful data visualizations

🔄 Version History

  • v1.0.0 - Initial release with core fraud monitoring
  • v1.1.0 - Added AWS Lambda integration
  • v1.2.0 - Enhanced AI analysis with Bedrock
  • v1.3.0 - Improved UI with Roboto fonts and better UX

Built with ❤️ for fraud prevention and financial security

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published