Logo Lanfrica

secbyteX03/mpesa-fraud-guard

Domain:

socioeconomic

Record type:

software
Creator:
sec
Host:
AI + Blockchain fraud detection system for M-Pesa and mobile money. # AI + Blockchain Fraud Prevention for Mobile Money (Kenya) A real-time fraud detection and prevention system for M-Pesa-style mobile money transactions in Kenya, combining AI risk scoring with blockchain-based transaction verification. ## πŸš€ Features - **Real-time Fraud Detection**: AI/ML models to detect suspicious transactions - **Blockchain Verification**: Smart contract-based hold/release mechanism - **Explainable AI**: Clear risk explanations for flagged transactions - **Demo UI**: Interactive web interface to simulate transactions - **Testnet Ready**: Deployable to Ethereum testnets ## πŸ—οΈ Project Structure ``` mpesa-fraud-guard/ β”œβ”€β”€ backend/ # FastAPI backend server β”‚ β”œβ”€β”€ model/ # ML model training and prediction β”‚ β”œβ”€β”€ api/ # REST API endpoints β”‚ └── data/ # Sample transaction data β”œβ”€β”€ frontend/ # React-based web interface β”œβ”€β”€ contracts/ # Solidity smart contracts β”œβ”€β”€ scripts/ # Utility scripts β”œβ”€β”€ tests/ # Test suites └── docs/ # Documentation ``` ## πŸ› οΈ Prerequisites - Python 3.8+ - Node.js 16+ - npm or yarn - Ganache or Hardhat (for local blockchain) - Web3.py or Web3.js ## πŸš€ Quick Start 1. **Clone the repository** ```bash git clone github.com cd mpesa-fraud-guard ``` 2. **Set up backend** ```bash cd backend python -m venv venv source venv/bin/activate # On Windows: .\venv\Scripts\activate pip install -r requirements.txt ``` 3. **Set up frontend** ```bash cd ../frontend npm install ``` 4. **Start local blockchain** ```bash cd ../contracts npx hardhat node ``` 5. **Deploy smart contracts** ```bash npx hardhat run scripts/deploy.js --network localhost ``` 6. **Start backend server** ```bash cd ../backend uvicorn main:app --reload ``` 7. **Start frontend** ```bash cd ../frontend npm start ``` ## πŸ€– AI/ML Components - **Model**: LightGBM classifier with feature importance analysis - **Features**: - Transaction amount …