|
1 |
| -# fraud_detection_node |
| 1 | +# Fraud Detection Backend API |
| 2 | + |
| 3 | +## Overview |
| 4 | +This API is a core component of a security module designed for robust account management in the banking sector. It enhances user security through authentication and real-time fraud detection, specifically targeting spam and malicious URLs to safeguard users. |
| 5 | + |
| 6 | +## Core Components |
| 7 | + |
| 8 | +### User Authentication and Authorization Module |
| 9 | +- **Description**: Ensures access is granted only to legitimate users using advanced mechanisms like two-factor authentication (2FA) and biometric verification. |
| 10 | +- **Features**: |
| 11 | + - Roles and permissions management to control user actions within their accounts. |
| 12 | + |
| 13 | +### Fraud Detection Module |
| 14 | +- **Description**: Incorporates a GPT module and utilizes real-time machine learning algorithms to analyze transaction patterns and detect anomalies. |
| 15 | +- **Real-Time Monitoring**: Capable of reading user SMS messages in real-time to evaluate and score URLs for legitimacy, alerting users about potential phishing URLs instantly. |
| 16 | +- **Data Processing**: Designed to handle and process large volumes of data efficiently. |
| 17 | + |
| 18 | +### MongoDB Database |
| 19 | +- **Description**: Utilized for storing user data, transaction histories, and a blacklist of malicious URLs. |
| 20 | +- **Capabilities**: |
| 21 | + - Supports high availability, horizontal scaling, and geographic distribution essential for large-scale banking applications. |
| 22 | + |
| 23 | +## Key Features |
| 24 | + |
| 25 | +- **Real-Time Alert System**: Sends instant notifications to users upon detecting suspicious activities or URLs. |
| 26 | +- **Data Privacy and Security**: All user data is encrypted and securely stored, adhering to the latest data protection regulations. |
| 27 | +- **Scalability**: Capable of managing increasing data volumes without performance loss. |
| 28 | +- **API Integration**: Provides seamless integration with existing banking applications through RESTful APIs. |
| 29 | + |
| 30 | +## Security Protocols |
| 31 | + |
| 32 | +- **Data Transmission**: Uses TLS for secure data transmission. |
| 33 | +- **Maintenance**: Regularly updates and patches to safeguard against new vulnerabilities. |
| 34 | +- **Monitoring and Auditing**: Continuously monitors and logs all activities for complete traceability and auditability. |
| 35 | + |
| 36 | +## Getting Started |
| 37 | + |
| 38 | +### Prerequisites |
| 39 | +- Node.js version 12.x or higher. |
| 40 | +- MongoDB version 4.4 or higher. |
| 41 | +- An operational environment that supports Docker (optional). |
| 42 | + |
| 43 | +### Installation Instructions |
| 44 | + |
| 45 | +```bash |
| 46 | +git clone https://github.com/yourusername/fraud-detection-api.git |
| 47 | +cd fraud-detection-api |
| 48 | +npm install pm2 -g |
| 49 | +pm2 start all |
| 50 | +``` |
| 51 | + |
| 52 | +### Build the Docker image and run the container: |
| 53 | +```Using Docker: |
| 54 | +docker-compose up -d |
| 55 | +``` |
| 56 | + |
| 57 | +### Configuration |
| 58 | +Create a .env file in the root directory and populate it with necessary configurations: |
| 59 | +``` |
| 60 | +PORT=8080 |
| 61 | +DB_HOST=localhost |
| 62 | +MongoDB_USER=admin |
| 63 | +MongoDB_PASSWORD=Password@123 |
| 64 | +LoginUser=admin |
| 65 | +LoginPass=Password@123 |
| 66 | +DB_URL=mongodb://localhost:27017/userMng |
| 67 | +USER_SECRET_KEY=7d43071c-b9ed-4426-bc6f-8a1d58334c60 |
| 68 | +APP_SECRET_KEY=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9 |
| 69 | +Google_Client_ID=1080268202505-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.apps.googleusercontent.com |
| 70 | +Google_Client_Secret=GOCSPX-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx |
| 71 | +//Session Expire in hours |
| 72 | +expiresIn="24h" |
| 73 | +//tokenExpiryDays in Days |
| 74 | +tokenExpiryDays="1" |
| 75 | +//OTPExpiryMins in Min |
| 76 | +OTPExpiryMins ="5" |
| 77 | +userAPICountCAP=167 |
| 78 | +
|
| 79 | +``` |
| 80 | + |
| 81 | +### API Endpoints |
| 82 | +## User Management |
| 83 | + |
| 84 | +- Register Mobile No: `http://{{hosted_server_ip}}:8080/api/v1/users/register` |
| 85 | +- OTP Verification: `http://{{hosted_server_ip}}:8080/api/v1/users/verify-otp` |
| 86 | +- Resend OTP: `http://{{hosted_server_ip}}:8080/users/resendOTP` |
| 87 | +- Set MPIN: `http://{{hosted_server_ip}}:8080/api/v1/users/mpin/set` |
| 88 | +- Login with MPIN: `http://{{hosted_server_ip}}:8080/users/mpinlogin` |
| 89 | +- Update Profile: `http://{{hosted_server_ip}}:8080/api/v1/users/profile/update` |
| 90 | +- View Profile: `http://{{hosted_server_ip}}:8080/users/viewProfile?mobile=8707516276` |
| 91 | +- Google SSO Login: `http://{{hosted_server_ip}}:8080/auth/google/` |
| 92 | +- Logout Single Session: `http://{{hosted_server_ip}}:8080/auth/google/` |
| 93 | +- Logout All Sessions: `http://{{hosted_server_ip}}:8081/api/v1/users/logout/all` |
| 94 | + |
| 95 | +### Fraud Detection |
| 96 | +- Process SMS for Fraud Detection: http://{{hosted_server_ip}}:8080/process-json |
| 97 | + |
| 98 | +``` |
| 99 | +header: optional |
| 100 | +message: |
| 101 | +{ |
| 102 | + "SMS-Deatil": { |
| 103 | + "header": "ICICIBK01", |
| 104 | + "message": "Dear Customer, your SBI account has been temporarily blocked due to incomplete KYC updates. To restore access, please visit https://spam_url.com and complete your KYC immediately. Regards, SBI Head Office." |
| 105 | + } |
| 106 | +} |
| 107 | +
|
| 108 | +``` |
| 109 | + |
| 110 | +### Postman Collection |
| 111 | +You can access the Postman collection for this API using the following public link: Access Postman Collection <https://api.postman.com/collections/25261584-2b1e88bf-04c0-450a-903f-c55d6a7b65bb?access_key=PMAT-01JGRSZTN7RDHTM6CBYB5BQDAN> |
| 112 | + |
| 113 | +### Contributing |
| 114 | +Contributions are encouraged. Please refer to the CONTRIBUTING.md for contribution guidelines. |
| 115 | + |
| 116 | +### License |
| 117 | +This project is licensed under the MIT License - see the LICENSE.md file for details. |
| 118 | + |
| 119 | +### Acknowledgments |
| 120 | +- Appreciation to all team members and contributors. |
| 121 | +- Acknowledgment of any third-party libraries used. |
| 122 | +``` |
| 123 | +This version of the README includes complete information on the API endpoints, how to run the application using different methods, and a link to access the API via a Postman collection. This setup is intended to guide users through installation, configuration, and initial usage of the Fraud Detection Backend API. |
| 124 | +``` |
0 commit comments