Inspiration
Inspiration
Scams work by rushing people. A message says a grandson is in jail, or asks for gift cards, and tells you to keep it secret. By the time someone thinks twice, the money is gone. We wanted to add a pause at the one moment that matters: right before the payment.
What it does
ScamShield Guardian checks a payment request before PayPal checkout opens. The user enters who they are paying, the amount, the reason, and optionally pastes the message they received. Google Gemini returns a verdict, an estimated risk score, and a few plain-language reasons.
- Lower risk: PayPal Sandbox buttons appear.
- Risky: a warning is shown, and the user must tick a confirmation box first.
- Likely scam: there is no payment button. The server refuses to create the PayPal order, and a "Message my family" button prepares an alert text.
Results are cautious AI suggestions, not guarantees. The final decision always stays with the user.
How we built it
Node.js and Express on the backend, and a one-page, mobile-first frontend with large text and calm colors.
- POST /api/analyze calls the native Gemini API with a strict system prompt that asks for cautious, JSON-only answers. The server strips code fences, validates the JSON, and falls back to a keyword check if the AI call fails.
- The server saves the verdict and amount in memory under a random verdict ID that expires after 15 minutes.
- POST /api/orders returns HTTP 403 for a likely scam, requires confirmation for a risky result, and otherwise creates a PayPal Sandbox order (Orders API v2, USD) using the amount saved on the server.
- POST /api/orders/:id/capture captures the order after approval.
- The PayPal JS SDK buttons call these endpoints. All keys live in environment variables.
- Deployed on Render, with the code on GitHub under the MIT license.
Challenges we ran into
- Google retired Gemini 2.5 Flash while we were building, so our AI calls fell back to the keyword check until we switched models. The model is now configurable with an environment variable.
- Keeping the AI cautious. We tuned the prompt so it uses words like "may" and "resembles" and never claims certainty.
- PayPal Sandbox checkout errors until we fixed our test account setup.
- We built and deployed the whole project from a phone.
Accomplishments that we're proud of
- A real end-to-end flow: AI verdict, a server-side payment gate, and a PayPal Sandbox order that is created and captured.
- The gate is enforced on the server, not only in the interface.
- The app keeps working if the AI is unavailable.
- A calm, large-text design for people who are rushed or worried.
What we learned
Put the check at the moment of payment, enforce rules on the server, and never present an AI opinion as a guarantee. APIs and models change, so keep them configurable and have a fallback.
What's next
More languages, real alerts to trusted contacts, and integration inside a payment app.
What it does
How we built it
Challenges we ran into
Accomplishments that we're proud of
What we learned
What's next for Scamshield Guardian
Built With
- css3
- express.js
- github
- google-gemini
- html5
- javascript
- node.js
- paypal
- paypal-sandbox
- render