Skip to content

About

AI-powered scam detection and digital safety assistant built with React, FastAPI and Gemini AI.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Latest commit

ย 

History

6 Commits

Folders and files

NameName
Last commit message
Last commit date
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿ›ก๏ธ ScamShield AI

Your AI Digital Safety Agent

ScamShield AI is an AI-powered digital safety assistant that helps users identify suspicious messages, understand scam indicators, assess risk, and receive practical recovery guidance.

It combines a React frontend, FastAPI backend, and Google Gemini AI to provide an easy-to-use scam detection experience.


๐Ÿš€ Features

๐Ÿ” Scam Message Analysis

Paste a suspicious SMS, WhatsApp message, email, job offer, investment message, or payment request and let ScamShield analyze it.

The system provides:

  • Scam type
  • Risk score
  • Risk level
  • Confidence score
  • Explanation of suspicious indicators
  • Recommended actions

๐Ÿ–ผ๏ธ Screenshot Analysis

Upload a screenshot of a suspicious conversation or message and analyze its contents using AI.

๐Ÿ†˜ Recovery Assistance

If you have already interacted with a scam, ScamShield provides personalized guidance and recommended next steps.

โšก Quick Demo Samples

The application includes sample scenarios such as:

  • ๐Ÿ’ผ Job scams
  • ๐Ÿฆ OTP scams
  • ๐Ÿ’ฐ Investment scams

๐Ÿ—๏ธ Architecture

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚      React.js        โ”‚
โ”‚      Frontend        โ”‚
โ”‚       Vercel         โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
           โ”‚
           โ”‚ REST API
           โ–ผ
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚      FastAPI         โ”‚
โ”‚       Backend        โ”‚
โ”‚       Render         โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
           โ”‚
           โ–ผ
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚   Google Gemini AI   โ”‚
โ”‚   Scam Analysis      โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

๐Ÿ› ๏ธ Tech Stack

Frontend

  • React.js
  • JavaScript
  • HTML
  • CSS
  • Vercel

Backend

  • Python
  • FastAPI
  • Uvicorn
  • Pydantic
  • REST APIs
  • Render

AI

  • Google Gemini AI
  • Google Gen AI SDK

Development Tools

  • Git
  • GitHub
  • VS Code
  • Python Virtual Environment

๐Ÿ“ Project Structure

ScamShield-AI/
โ”‚
โ”œโ”€โ”€ backend/
โ”‚   โ”œโ”€โ”€ main.py
โ”‚   โ”œโ”€โ”€ gemini_service.py
โ”‚   โ”œโ”€โ”€ requirements.txt
โ”‚   โ””โ”€โ”€ venv/
โ”‚
โ”œโ”€โ”€ frontend/
โ”‚   โ”œโ”€โ”€ src/
โ”‚   โ”‚   โ”œโ”€โ”€ App.jsx
โ”‚   โ”‚   โ””โ”€โ”€ ...
โ”‚   โ”œโ”€โ”€ package.json
โ”‚   โ””โ”€โ”€ ...
โ”‚
โ””โ”€โ”€ README.md

Note: Do not commit the venv/ directory to GitHub. Add it to .gitignore.


๐Ÿ”Œ API Endpoints

Method Endpoint Purpose
GET / Backend health/home endpoint
POST /analyze Analyze a suspicious message
POST /recovery Generate recovery guidance
POST /analyze-screenshot Analyze a suspicious screenshot

Example: Analyze a Message

curl -X POST \
  "https://scamshield-ai-dfc5.onrender.com/analyze" \
  -H "Content-Type: application/json" \
  -d '{
    "message": "Congratulations! You have been selected for a work-from-home job. Pay โ‚น1499 as a refundable registration fee within 20 minutes."
  }'

Example Response

{
  "scam_type": "Fake Job / Advance-Fee Scam",
  "risk_score": 95,
  "risk_level": "CRITICAL",
  "confidence": 98,
  "summary": "This message displays clear indicators of an employment scam.",
  "indicators": [
    "Demands an upfront payment or registration fee",
    "Uses artificial urgency",
    "Claims job selection without a prior application process"
  ],
  "recommended_actions": [
    "Do not pay any money or share bank/personal details.",
    "Block and report the sender immediately."
  ]
}

โš™๏ธ Local Setup

1. Clone the Repository

git clone https://github.com/ramritheesh/ScamShield-AI.git
cd ScamShield-AI

2. Backend Setup

Navigate to the backend:

cd backend

Create a virtual environment:

python3 -m venv venv

Activate it:

source venv/bin/activate

Install dependencies:

pip install -r requirements.txt

Create a .env file inside the backend directory:

GEMINI_API_KEY=your_google_gemini_api_key

Start the FastAPI server:

uvicorn main:app --reload

The backend will be available at:

http://127.0.0.1:8000

FastAPI Swagger documentation:

http://127.0.0.1:8000/docs

3. Frontend Setup

Open another terminal:

cd frontend

Install dependencies:

npm install

Start the development server:

npm run dev

Open the URL shown by Vite, usually:

http://localhost:5173

๐Ÿ” Environment Variables

ScamShield requires a Gemini API key.

Create:

backend/.env

Add:

GEMINI_API_KEY=your_google_gemini_api_key

โš ๏ธ Important

Never commit your API key to GitHub.

Add the following to .gitignore:

.env
venv/
__pycache__/
*.pyc

For production deployment, configure GEMINI_API_KEY in the backend hosting platform's environment variables.


๐ŸŒ Deployment

Frontend

The React frontend is deployed using Vercel.

Backend

The FastAPI backend is deployed using Render.

Production architecture:

User
  โ”‚
  โ–ผ
Vercel
React Frontend
  โ”‚
  โ”‚ HTTPS REST API
  โ–ผ
Render
FastAPI Backend
  โ”‚
  โ–ผ
Google Gemini API

๐Ÿงช Example Scam Messages

๐Ÿ’ผ Job Scam

Congratulations! You have been selected for a work-from-home job.
Pay โ‚น1499 as a refundable registration fee within 20 minutes.

๐Ÿ” OTP Scam

Your account will be blocked today.
Share the OTP you received to verify your account immediately.

๐Ÿ’ฐ Investment Scam

Invest โ‚น5000 today and get guaranteed returns of โ‚น50,000 within one week.
Limited slots available. Pay now.

These examples demonstrate common warning signs such as:

  • Artificial urgency
  • Requests for money
  • OTP requests
  • Guaranteed returns
  • Pressure to act immediately
  • Requests for sensitive information

๐ŸŽฏ Why ScamShield AI?

Online scams often rely on:

  • Urgency
  • Fear
  • Attractive rewards
  • Fake job opportunities
  • Impersonation
  • Requests for sensitive information
  • Advance payments

ScamShield AI provides users with a second layer of protection by helping them pause, understand the warning signs, and make safer decisions.

Detect. Understand. Recover.


๐Ÿ”ฎ Future Improvements

Planned improvements include:

  • ๐ŸŒ Multilingual scam detection
  • ๐Ÿ”— URL and link safety analysis
  • ๐Ÿ“ฑ Sender and phone number risk analysis
  • ๐Ÿง  Improved scam classification
  • ๐Ÿ–ผ๏ธ Advanced OCR for screenshots
  • ๐Ÿ“Š Scam trend analytics
  • ๐Ÿ”” Real-time scam alerts
  • ๐Ÿ›ก๏ธ Browser and mobile integration
  • ๐Ÿ’ฌ More personalized recovery workflows

โš ๏ธ Disclaimer

ScamShield AI is an assistive tool and should not be treated as a guaranteed scam detector.

AI-generated results may occasionally be incorrect. Users should independently verify suspicious communications through official channels.

Never share:

  • Passwords
  • OTPs
  • Bank details
  • UPI PINs
  • Credit/debit card details
  • Other sensitive information

๐Ÿ‘จโ€๐Ÿ’ป Author

Ram Ritheesh

Built as an AI-powered digital safety project using:

React.js โ€ข FastAPI โ€ข Python โ€ข Google Gemini AI


โญ Contributing

Contributions, ideas, and improvements are welcome.

1. Fork the repository

2. Create a feature branch

git checkout -b feature/your-feature

3. Make your changes

4. Commit your changes

git add .
git commit -m "Add your feature"

5. Push the branch

git push origin feature/your-feature

6. Open a Pull Request


๐Ÿ“„ License

This project is intended for educational and demonstration purposes.

About

AI-powered scam detection and digital safety assistant built with React, FastAPI and Gemini AI.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages