A Telegram-based deepfake and scam detection system with a Telegram bot, Telegram Mini App (TMA), and Supabase-backed data layer.
- Live app: https://nahthatsfake.vercel.app/
- Source: https://github.com/frpboy/NahThatsFake
- AI-assisted image/deepfake analysis
- Multi-provider URL safety checks
- Telegram bot and Mini App workflows
- Premium plans and payment integrations (Razorpay and Telegram Stars)
- Referral credits
- Abuse prevention and rate limiting
- Check history and usage analytics
The following paths reflect the current repository tree:
NahThatsFake/
├── .env.example # Shared environment-variable template
├── bot/
│ ├── src/
│ │ ├── handlers/
│ │ ├── middleware/
│ │ ├── services/
│ │ └── utils/
│ ├── tests/
│ ├── package.json
│ ├── package-lock.json
│ └── pnpm-lock.yaml
├── tma/
│ ├── api/index.js # Vercel API entry point
│ ├── public/
│ │ ├── css/
│ │ ├── js/
│ │ ├── index.html
│ │ └── premium.html
│ ├── server.js
│ ├── package.json
│ ├── package-lock.json
│ └── pnpm-lock.yaml
├── supabase/
│ └── migrations/ # Checked-in SQL migration files
├── Documents/ # Project specifications and reports
├── Current_Schema.md # Schema snapshot; explicitly context-only
├── DEPLOYMENT.md
├── docker-compose.yml
├── nginx.conf
└── vercel.json
There is no shared/ or top-level docs/ directory in the current tree. Project documents are under Documents/.
- Node.js and TypeScript
- grammY
- Supabase JavaScript client
- Axios and node-cron
- Vanilla HTML, CSS, and JavaScript
- Node.js and Express
- Telegram Web App SDK
- Supabase and Razorpay integrations
- Supabase PostgreSQL with SQL migrations and Row Level Security
- Vercel for the Mini App/API deployment
- Docker Compose and Nginx configuration for self-hosted deployments
- Sightengine for image analysis
- Google Safe Browsing and VirusTotal for URL intelligence
- Razorpay and Telegram Stars for payments
- Node.js 20 or newer (the checked-in Supabase client dependency requires Node.js 20+)
- npm
- A Telegram bot token
- A Supabase project
- Provider credentials for the features you intend to enable
git clone https://github.com/frpboy/NahThatsFake.git
cd NahThatsFakeThe only checked-in environment template is the root .env.example. Create a component-local environment file so the process can load it from its working directory:
cp .env.example bot/.env
cp .env.example tma/.envEdit each file and keep only the values required by that server. At minimum, the bot requires BOT_TOKEN, SUPABASE_URL, and SUPABASE_SERVICE_ROLE_KEY. The bot also accepts optional detection-provider credentials and TMA_URL.
The TMA server uses SUPABASE_URL and SUPABASE_ANON_KEY; payment and webhook functionality may require the corresponding server-side Razorpay and Supabase credentials. Set ALLOWED_ORIGINS to the exact trusted web origins for the deployment.
Never commit either .env file. Never expose the Supabase service-role key or Razorpay secret to browser-side code.
The bot directory currently contains an npm lockfile:
cd bot
npm ci
npm run typecheck
npm run build
npm startcd tma
npm ci
npm startPackage-manager note: the repository root, bot, and TMA currently contain both npm and pnpm lockfiles. This README uses the checked-in npm lockfiles for reproducible npm installs. The canonical package-manager policy and lockfile cleanup are tracked separately in issue #373. Do not update only one lockfile when changing dependencies; keep the competing lockfiles synchronized until that policy is resolved. The root package manifest is not a workspace entry point for the bot or TMA.
The executable SQL files are under supabase/migrations/. The old paths supabase/schema.sql, supabase/rls_policies.sql, and supabase/functions.sql do not exist in this repository.
Important safeguards:
Current_Schema.mdis labelled as a context-only schema snapshot; it is not a migration and must not be executed as SQL.- The migrations directory contains both timestamped and legacy-named SQL files. Do not assume a simple alphabetical replay is safe.
- This repository does not currently include
supabase/config.toml; a linked Supabase CLI migration workflow is therefore not configured by this checkout. - For an existing project, reconcile its applied migration history before running anything. Do not replay the full directory against a live database.
- For a fresh project, have the database owner review the migration dependencies and apply the intended sequence in a disposable/staging project before production.
No production migration should be run as part of local setup or this documentation change.
DEPLOYMENT.md— deployment options and operational checklistDocuments/Tech_Stack_Report.md— technology stack reportDocuments/Project_Status_Report.md— project statusDocuments/BSChecker_Doc1_PRD.htmlthroughDocuments/BSChecker_Doc13_Tracker.html— product and engineering specificationsCurrent_Schema.md— reference snapshot only, not executable SQL
The schema includes user accounts, checks, cached results, payments, referrals, groups, abuse flags, feedback, and related operational data. Consult the checked-in migrations and current database state rather than treating this summary as a complete schema definition.
/start— onboarding/check— start a content check/credits— view credit balance/refer— referral link/history— recent checks/premium— premium options
The application has individual and group plans, including time-based subscriptions and credit packs. The live Mini App is the source of truth for currently offered prices and payment options.
- Supabase Row Level Security
- Bot-side abuse detection and rate limiting
- Server-side payment verification
- Environment-based secret configuration
- Image analysis without intentionally retaining uploaded image files as application content
See DEPLOYMENT.md for the deployment overview. The repository includes:
vercel.jsonfor Vercel routingdocker-compose.ymlfor container orchestrationnginx.confas a self-hosted reverse-proxy example
Review environment variables, CORS origins, TLS configuration, database migration state, and health checks before deploying. The checked-in deployment files are examples and must be reconciled with the target environment.
- Review the repository issues and existing pull requests before starting work.
- Create a focused feature branch.
- Follow the component's existing package and test conventions.
- Run the relevant type checks, builds, and tests.
- Open a pull request with the rationale and validation evidence.
MIT — see LICENSE.
Nah That's Fake — making the internet a safer place, one check at a time.