Next-Generation UPI Payment App with AI-Powered Fraud Detection & Multi-Language Voice Assistant
Features β’ Tech Stack β’ Installation β’ Documentation β’ Architecture
KAVACH is a comprehensive UPI payment application designed for the Indian market, featuring advanced security, multi-language support, and accessibility-first design. Built with cutting-edge fraud detection using Machine Learning and Natural Language Processing, KAVACH ensures safe and secure digital transactions for everyone.
- π€ AI-Powered Fraud Detection - Real-time ML-based transaction and OTP fraud analysis
- π£οΈ Voice Assistant - Voice-powered UPI transactions in 22+ Indian languages
- π Advanced Security - Biometric authentication, behavioral analysis, SIM binding
- π° Complete Loan System - Apply, track, and manage loans with EMI calculator
- π± QR Payments - Scan and generate UPI QR codes instantly
- π« Spam Detection - Identify fraudulent SMS and calls
- π Multi-Language - Support for 22 Indian regional languages
- π΄ Offline OTP - TOTP-based offline OTP generation
- π Behavior Analytics - Real-time user behavior monitoring
| Feature | Description |
|---|---|
| ML Fraud Detection | Hugging Face BERT integration for OTP and transaction fraud analysis |
| Real-time Monitoring | SMS and transaction monitoring with risk scoring |
| Behavioral Biometrics | Touch patterns, typing speed, and cursor tracking analysis |
| Spam Detection | AI-powered SMS and call spam identification |
| SIM Binding | Auto-logout and data wipe on SIM card change |
| Screen Security | Screenshot and screen recording prevention |
| Feature | Description |
|---|---|
| Voice Transactions | Voice-powered UPI payments with speech-to-text |
| QR Code Payments | Scan merchant QR codes or generate personal QR codes |
| Contact Picker | Send money to contacts directly |
| Transaction History | Complete payment history with fraud scores |
| Offline OTP | TOTP-based OTP generation without internet |
| Balance Check | Real-time balance inquiry |
| Feature | Description |
|---|---|
| Loan Application | Apply for Personal, Business, Education, Home, Vehicle loans |
| EMI Calculator | Real-time EMI calculation with amortization schedule |
| Loan Dashboard | Track all loans (Pending, Active, Completed) |
| EMI Payments | Pay EMIs with due date reminders |
| Early Payment | Calculate savings on early loan closure |
| Feature | Description |
|---|---|
| 22+ Languages | Hindi, Bengali, Telugu, Tamil, Marathi, Gujarati, Kannada, Malayalam, Punjabi, Odia, Assamese, Urdu, and more |
| Voice Assistant | Hands-free operation for visually impaired users |
| Text-to-Speech | Screen reader support |
| Simple UI | Senior-citizen friendly interface |
| Educational Videos | UPI tutorial videos in regional languages |
| Feature | Description |
|---|---|
| Behavior Dashboard | Visualize typing patterns, cursor movements, gestures |
| Fraud Alerts | Real-time notifications for suspicious activities |
| Activity Logs | Complete audit trail of user actions |
| Security Dashboard | Centralized security status overview |
| SMS Fraud Dashboard | Monitor and manage SMS fraud detections |
React Native 0.81.5 + Expo ~54.0.25| Category | Technologies |
|---|---|
| Framework | React Native, Expo |
| Navigation | @react-navigation/native, @react-navigation/native-stack |
| State Management | React Context API, React Hooks |
| UI Components | react-native-gesture-handler, react-native-safe-area-context |
| Internationalization | i18next, react-i18next |
| Authentication | expo-local-authentication (Fingerprint/Face ID) |
| Camera & QR | expo-camera, react-native-svg |
| Speech/Voice | expo-speech, @deepgram/sdk |
| Security | expo-screen-capture, expo-secure-store |
| Storage | @react-native-async-storage/async-storage |
Node.js + Express + MongoDB| Category | Technologies |
|---|---|
| Runtime | Node.js |
| Framework | Express 4.18.2 |
| Database | MongoDB, Mongoose 8.0.3 |
| Authentication | jsonwebtoken, bcryptjs |
| ML/NLP | Natural 6.10.2, Axios (Hugging Face API) |
| Security | OTPLib 12.0.1, express-validator |
| QR Codes | qrcode 1.5.3 |
| File Upload | multer 1.4.5 |
| CORS | cors 2.8.5 |
| Service | Purpose |
|---|---|
| Hugging Face | ML-based fraud detection (BERT models) |
| Deepgram | Speech-to-Text for voice assistant |
| Cashfree | Payment gateway integration |
| MongoDB Atlas | Cloud database (production) |
- Node.js (v18 or higher) - Download
- MongoDB (v6.0 or higher) - Download
- Git - Download
- Expo CLI - Install via npm
- Android Studio (for Android) or Xcode (for iOS)
# Clone the repository
git clone https://github.com/Debjyoti-sarkar/KAVACH.git
cd KAVACH
# Run automated setup
.\quick-start.ps1# Install frontend dependencies
npm install
# Install backend dependencies
cd backend
npm install
cd ..Create backend/.env file:
# Server Configuration
PORT=5000
NODE_ENV=development
# Database
MONGO_URI=mongodb://localhost:27017/kavach
# Authentication
JWT_SECRET=your-super-secret-jwt-key-minimum-32-characters
# ML Services (Optional)
HUGGING_FACE_TOKEN=your_huggingface_token_hereWindows:
mongod --dbpath="C:\data\db"macOS/Linux:
brew services start mongodb-communitycd backend
npm run devVerify at: http://localhost:5000
Edit services/api.ts:
export const API_URL = __DEV__
? "http://localhost:5000/api" // For emulator/simulator
: "https://your-api.com/api"; // For productionFor Android Emulator: Use http://10.0.2.2:5000/api
npm startThen:
- Press
ifor iOS simulator - Press
afor Android emulator - Scan QR code with Expo Go app for physical device
| Document | Description |
|---|---|
| SETUP_GUIDE.md | Complete installation and deployment guide |
| FEATURES_README.md | Detailed feature documentation |
| MERGE_COMPLETE.md | Feature integration summary |
| backend/README.md | Backend API documentation |
| QUICKSTART.md | Quick start guide |
βββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Mobile App (Expo) β
β ββββββββββββ ββββββββββββ βββββββββββββββββββ β
β β Screens β β Services β β Context/Hooks β β
β ββββββ¬ββββββ ββββββ¬ββββββ ββββββ¬βββββββββββββ β
β β β β β
β βββββββββββββββ΄βββββββββββββββ β
β βΌ β
β API Service (Axios) β
ββββββββββββββββββββββ¬βββββββββββββββββββββββββββββββββ
β HTTP/REST
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Backend (Express.js) β
β ββββββββββββ ββββββββββββ βββββββββββββββββββ β
β β Routes ββ β Services ββ β Models β β
β ββββββββββββ ββββββββββββ ββββββ¬βββββββββββββ β
β β² β² β β
β β ββββββββββββββββΌββββββββββββ β
β β βΌ β β
β Middleware MongoDB ML API β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββ
KAVACH/
βββ π± Mobile App
β βββ screens/ # All UI screens
β βββ components/ # Reusable components
β βββ navigation/ # Navigation configuration
β βββ services/ # API & utility services
β βββ hooks/ # Custom React hooks
β βββ contexts/ # Context providers
β βββ constants/ # Theme, i18n config
β βββ utils/ # Helper functions
β
βββ π§ Backend
β βββ models/ # 8 Mongoose models
β βββ services/ # 8 Business logic services
β βββ routes/ # 12 API route handlers
β βββ middleware/ # Auth & validation
β βββ config/ # Database configuration
β βββ server.js # Express server entry
β
βββ π Documentation
βββ SETUP_GUIDE.md
βββ FEATURES_README.md
βββ MERGE_COMPLETE.md
POST /api/auth/register- Register new userPOST /api/auth/login- User loginGET /api/auth/me- Get current userPUT /api/auth/change-pin- Change PIN
POST /api/transactions/send- Send money (with fraud check)GET /api/transactions- Get transaction historyGET /api/transactions/:id- Get transaction details
POST /api/ml/analyze-text- ML text analysisPOST /api/ml/analyze-otp- OTP fraud detectionGET /api/fraud-alerts- Get fraud alertsPOST /api/fraud-alerts- Create fraud alert
POST /api/loans/apply- Apply for loanGET /api/loans- Get user loansGET /api/loans/:id- Get loan detailsGET /api/loans/:id/emis- Get loan EMI schedule
GET /api/emi- Get user EMIsGET /api/emi/due- Get due EMIsPOST /api/emi/:id/pay- Pay EMI
POST /api/qr/generate- Generate UPI QR codePOST /api/qr/parse- Parse QR code
POST /api/spam/analyze-message- Analyze SMSPOST /api/spam/analyze-phone- Check phone numberPOST /api/spam/check-otp-legitimacy- Verify OTP message
GET /api/offline-otp/generate- Generate TOTPPOST /api/offline-otp/verify- Verify TOTP
Full API documentation: backend/README.md
cd backend
# Test health check
curl http://localhost:5000
# Test user registration
curl -X POST http://localhost:5000/api/auth/register \
-H "Content-Type: application/json" \
-d '{"phoneNumber":"9876543210","name":"Test User","pin":"123456"}'# Clear cache and restart
npm start -- --clear
# Run on specific platform
npm run ios
npm run android- β JWT Authentication - Secure token-based auth
- β PIN Hashing - bcrypt password hashing
- β Biometric Auth - Fingerprint/Face ID support
- β Screen Security - Screenshot/recording prevention
- β SIM Binding - Device security with SIM verification
- β CORS Protection - Cross-origin request filtering
- β Input Validation - express-validator for all inputs
- β Activity Logging - Complete audit trail
- β Fraud Scoring - ML-based risk assessment
Contributions are welcome! Please follow these steps:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- Saket Raj - @Saket Raj
- Hugging Face for ML models
- Expo team for the amazing framework
- MongoDB for database solutions
- React Native community
For issues and questions:
- π§ Email: support@kavach.app
- π Issues: GitHub Issues
- π Docs: Documentation
Made with β€οΈ for safer digital payments in India
β Star this repository if you find it helpful!
π₯ Download β’ π Docs β’ π Report Bug