Skip to content

Repository files navigation

SafeForward Scam Shield

Detect scams and misinformation in forwarded messages — built for elderly and non-tech-savvy users.

Paste an SMS, email, WhatsApp forward, or social post. SafeForward uses Google Gemini to return a clear verdict, plain-language explanation, and a concrete next step.

Features

  • Simple verdicts: SAFE, SUSPICIOUS, or LIKELY SCAM
  • Plain English explanations written for seniors and less tech-confident users
  • Red flags and a specific safe action to take
  • Sample messages to try the analyzer quickly
  • Larger text mode and a short safety guide in the UI
  • Works locally with Express, or on Vercel via the serverless /api/analyze route

Tech stack

  • React 19 + TypeScript + Vite
  • Tailwind CSS + Motion
  • Express (local API)
  • Google Gemini (@google/genai)
  • Vercel serverless functions for production API

Prerequisites

Setup

npm install
cp .env.example .env

Edit .env and set:

GEMINI_API_KEY=your_gemini_api_key

APP_URL is optional for local development.

Run locally

npm run dev

Open http://localhost:3000. The Express server serves the Vite app and the POST /api/analyze endpoint.

Scripts

Command Description
npm run dev Start the local Express + Vite development server
npm run build Build the frontend and bundle the server
npm start Run the production server from dist/
npm run preview Preview the Vite production build
npm run lint Type-check with TypeScript
npm run clean Remove build artifacts

API

POST /api/analyze

Request body:

{
  "message": "Your forwarded text here"
}

Example response:

{
  "verdict": "LIKELY SCAM",
  "confidence": 92,
  "red_flags": ["Requests urgent money transfer", "Impersonates bank staff"],
  "plain_explanation": "This message tries to scare you into sending money quickly. Real banks do not ask for this over text.",
  "safe_action": "Do not click any links or reply. Delete the message and call your bank using the number on your card."
}

Deploy on Vercel

  1. Connect the repo to Vercel.
  2. Set GEMINI_API_KEY in the project Environment Variables.
  3. Deploy. The serverless handler in api/analyze.ts serves analysis requests.

Project structure

├── api/                 # Vercel serverless analyze route
├── assets/              # Static assets
├── src/
│   ├── components/      # UI components
│   ├── data/            # Sample messages
│   ├── App.tsx
│   ├── main.tsx
│   └── types.ts
├── server.ts            # Local Express + Vite server
├── vercel.json
└── package.json

Privacy note

Messages you submit are sent to the Gemini API for analysis. Do not paste passwords, OTPs, full card numbers, or other highly sensitive personal data.

License

Private project — all rights reserved.

About

helps people (especially elderly and non-tech-savvy users) detect scams and misinformation in forwarded messages (WhatsApp texts, SMS, emails).

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages