Skip to content

Latest commit

ย 

History

236 Commits

Folders and files

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

Repository files navigation

Satark-AI: Defending Truth in the Age of Generative AI ๐Ÿ›ก๏ธ

Satark-AI Banner

Live App PWA Ready React TypeScript FastAPI PyTorch SpeechBrain Hugging Face Cloudflare Workers Turborepo Docker License


๐ŸŒ Live Demo

๐Ÿ‘‰ Open App โ†’ satark-deepfake.vercel.app

Satark-AI is a production-grade, full-stack deepfake detection and speaker verification platform. Built as a scalable microservices monorepo, it combines advanced audio forensics (MFCC, Spectral Analysis, Zero Crossing Rate), image deepfake detection via Hugging Face Inference API, and deep learning speaker biometrics (ECAPA-TDNN) to identify synthetic media and verify speaker identities in real time โ€” across audio, video, and image inputs.


๐Ÿ“ธ Screenshots

Dashboard Mobile View
Dashboard Mobile
Live Monitor Speaker Identity
Live Monitor Speaker ID

๐ŸŒŸ Feature Overview

๐Ÿ•ต๏ธ Deepfake Audio Detection

  • Wav2Vec2 Model: Transformer-based deep learning model fine-tuned for synthetic speech detection.
  • Multi-Feature Forensics: Analyzes MFCC coefficients, Spectral Rolloff, and Zero Crossing Rate (ZCR) for composite risk scoring.
  • Multi-Format Support: Upload MP3, WAV, or extract audio from MP4 video files โ€” handled via moviepy fallback.
  • Explainable AI (XAI): Returns structured analysisDetails with per-feature reasoning (e.g., "Anomalous zero crossing rate (0.214)").
  • Confidence Scoring: 4-decimal precision confidence score returned per scan.
  • Smart Deduplication: SHA-256 file hashing prevents redundant re-processing of identical files.

๐Ÿ–ผ๏ธ Deepfake Image Detection โ€” Powered by Hugging Face Inference API

Image analysis runs on an entirely separate, serverless pipeline โ€” independent of the Python engine.

  • Models: prithivMLmods/deepfake-detector-model-v1 (face deepfake) + umm-maybe/ai-image-detector (general AI-image) via Hugging Face Inference API โ€” specialized models analyzing facial artifacts and AI-generation patterns.
  • Cloudflare Worker Proxy: A dedicated Cloudflare Worker (satark-image-proxy) sits between the frontend and Hugging Face's API โ€” handling CORS, secret management, size enforcement, and timeout control.
  • Input Formats: Supports multipart/form-data file upload or raw binary body. Images are forwarded to Hugging Face Inference API as binary.
  • 5MB Size Limit: Enforced both via content-length header (pre-read) and actual byteLength post-read โ€” double-layer enforcement.
  • 30s Timeout: AbortController cancels hung Hugging Face requests after 30 seconds, returning 504 gracefully.
  • Output Schema: { isDeepfake: boolean, confidenceScore: float (0โ€“1), details: string } โ€” normalized and validated before returning to client.
  • Robust JSON Parsing: Normalizes response, clamps confidenceScore to [0, 1], falls back gracefully if API returns unexpected format.
  • CORS Whitelisting: Strict origin whitelist (satark-deepfake.vercel.app, localhost:5173, localhost:3000) โ€” no wildcard *.

๐Ÿ†” Voice Biometrics โ€” Speaker Identity

  • Enrollment System: Enroll a speaker by uploading a reference audio sample. ECAPA-TDNN extracts a 192-dim voice embedding stored securely in PostgreSQL.
  • Verification: Match an unknown voice against all enrolled speakers using Cosine Similarity (threshold: 0.75).
  • Scoped Isolation: Users only verify against their own enrolled speakers โ€” cross-user data access is prevented at the query level.
  • Auto-History Logging: Every verification attempt is saved to the scan history table with identity details.

๐ŸŽ™๏ธ Live Monitor

  • Real-Time Protection: Continuously captures microphone input and processes it in 5-second chunks.
  • Instant Feedback: Each chunk is scanned and flagged as real or synthetic with confidence score.
  • Auto-Persistence: All detected threats are saved to the history database automatically.

๐Ÿ“Š Analytics Dashboard

  • Detection Ratio Chart: Donut chart (Recharts PieChart) visualizing Real vs. Fake scan breakdown.
  • Confidence Bucketing: Bar chart grouping scans into High (>80%), Medium (50โ€“80%), and Low (<50%) confidence bands.
  • Summary Cards: Total Scans, Deepfakes Detected, Real Audio count, and Average Confidence โ€” animated with Framer Motion.

๐ŸŽฎ Deepfake Game (Interactive)

  • DeepfakeGame component โ€” an interactive challenge mode that tests the user's ability to distinguish real from AI-generated audio samples.

๐Ÿ’ฌ Feedback System

  • Users can submit feedback on any scan via FeedbackWidget.
  • Stored in the scans.feedback column and retrievable via /scans/:id/feedback.

๐Ÿ“ฑ PWA & Accessibility

  • Progressive Web App: Installable on Android/iOS and Desktop via InstallPWA component. Powered by Workbox service worker with precaching and network-only strategies.
  • Dark / Light Mode: Full theme toggle via theme-provider and mode-toggle.
  • Multilingual Support: Language context (LanguageContext.tsx) with a language toggle component.
  • History & Playback: Review all past scans, listen back to saved audio, and export detailed PDF reports.

๐Ÿ—๏ธ Architecture

Satark-AI is structured as a Turborepo monorepo with three independent microservices and one shared package:

satark-ai/
โ”œโ”€โ”€ apps/
โ”‚   โ”œโ”€โ”€ web/          โ†’ React + Vite  (Frontend)
โ”‚   โ”œโ”€โ”€ api/          โ†’ Hono + Node.js (API Gateway)
โ”‚   โ””โ”€โ”€ engine/       โ†’ FastAPI + Python (AI Engine โ€” Audio/Speaker)
โ”œโ”€โ”€ packages/
โ”‚   โ””โ”€โ”€ shared/       โ†’ Shared Zod schemas & TypeScript types
โ”œโ”€โ”€ cloudflare-worker/ โ†’ satark-image-proxy (Hugging Face image proxy)
โ”œโ”€โ”€ docker-compose.yml
โ””โ”€โ”€ turbo.json

Service Responsibilities

Service Runtime Role Port
apps/web React 18 + Vite User interface, PWA shell 5173
apps/api Node.js + Hono Auth, DB, orchestration 3000
apps/engine Python 3.11 + FastAPI Audio deepfake + speaker inference 8000
cloudflare-worker Cloudflare Workers (V8) Image deepfake proxy โ†’ Hugging Face API Edge

Request Flow

                        โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
                        โ”‚           Browser (React PWA)           โ”‚
                        โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                                   โ”‚              โ”‚
                          Audio/   โ”‚              โ”‚ Image Upload
                          Speaker  โ”‚              โ”‚
                                   โ–ผ              โ–ผ
                        โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”   โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
                        โ”‚  Hono API    โ”‚   โ”‚  Cloudflare Worker   โ”‚
                        โ”‚  Gateway     โ”‚   โ”‚  (satark-image-proxy)โ”‚
                        โ”‚  (Node.js)   โ”‚   โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                        โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜              โ”‚
                               โ”‚                      โ–ผ
                               โ–ผ              โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
                        โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”      โ”‚  Hugging Face    โ”‚
                         โ”‚ FastAPI      โ”‚      โ”‚  Inference API   โ”‚
                         โ”‚ AI Engine    โ”‚      โ”‚  Deepfake Models โ”‚
                        โ”‚ (Python)     โ”‚      โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                        โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                               โ”‚
                   โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
                   โ–ผ                      โ–ผ
           โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”     โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
           โ”‚  PostgreSQL  โ”‚     โ”‚  PyTorch Models  โ”‚
           โ”‚ (Drizzle ORM)โ”‚     โ”‚ Wav2Vec2 +       โ”‚
           โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜     โ”‚ ECAPA-TDNN       โ”‚
                                โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

๐Ÿ“š Documentation

Complete technical documentation for the Satark-AI platform:

Document Description
docs/AI_DISCOVERABILITY_FRAMEWORKS.md AI discoverability & search optimization (AEO, GEO, LLMO, AISEO, E-E-A-T, SEO)
docs/API.md Complete REST API reference (20+ endpoints across 3 services)
docs/ARCHITECTURE.md System design, service map, request flows, C4 diagrams
docs/DB_SCHEMA.md PostgreSQL schema with field-level documentation (Drizzle ORM)
docs/DEPLOYMENT.md Production deployment guide (Vercel + Render + Docker)
docs/EDGE_CASES.md Error handling, graceful degradation, failure modes
docs/TECH_STACK.md Complete technology inventory (40+ packages)
docs/WORKFLOW.md Development workflow, testing strategy, CI/CD pipeline

๐Ÿง  AI Models & Algorithms

Deepfake Detection Pipeline (detect.py)

Signal Feature Extracted Anomaly Trigger
Raw waveform Wav2Vec2 classifier Model confidence > threshold
Frequency domain Spectral Rolloff Rolloff < 2500 Hz
Time domain Zero Crossing Rate ZCR > 0.12
Combined Composite risk score Weighted multi-feature fusion

Speaker Verification Pipeline (speaker.py)

Step Technology Detail
Audio loading Librosa Resampled to 16 kHz mono
Embedding extraction SpeechBrain ECAPA-TDNN 192-dimensional vector
Similarity scoring Cosine Similarity (TypeScript) Computed server-side in API
Match decision Threshold (0.75) score > 0.75 โ†’ Identity Confirmed

Image Deepfake Pipeline (Cloudflare Worker)

Step Component Detail
Request intake Cloudflare Worker Accepts multipart/form-data or raw binary
Size enforcement Worker (double-check) Pre-read via content-length, post-read via byteLength โ€” 5MB cap
Image encoding Worker ArrayBuffer โ†’ Base64 โ†’ Data URI
Vision inference Hugging Face API prithivMLmods/deepfake-detector-model-v1 + umm-maybe/ai-image-detector analyze artifacts
Response parsing extractJSON() Strips markdown fences, extracts {}, clamps score to [0,1]
Timeout control AbortController 30s hard timeout โ†’ 504 response
Output Normalized JSON { isDeepfake, confidenceScore, details }

๐Ÿ—‚๏ธ Codebase Deep Dive

apps/web โ€” Frontend

src/
โ”œโ”€โ”€ api/
โ”‚   โ””โ”€โ”€ client.ts            โ†’ Typed API client (scanAudio, scanUpload, scanImage,
โ”‚                               enrollSpeaker, verifySpeaker, getHistory, submitFeedback)
โ”œโ”€โ”€ components/
โ”‚   โ”œโ”€โ”€ AnalyticsStats.tsx   โ†’ Recharts pie + bar dashboard
โ”‚   โ”œโ”€โ”€ AudioUpload.tsx      โ†’ File picker with drag-drop for audio
โ”‚   โ”œโ”€โ”€ AudioVisualizer.tsx  โ†’ Real-time waveform canvas
โ”‚   โ”œโ”€โ”€ ConfidenceMeter.tsx  โ†’ Animated confidence score bar
โ”‚   โ”œโ”€โ”€ DeepfakeGame.tsx     โ†’ Interactive detection challenge game
โ”‚   โ”œโ”€โ”€ ErrorBoundary.tsx    โ†’ React error boundary wrapper
โ”‚   โ”œโ”€โ”€ FakeHeatmap.tsx      โ†’ Feature-level heatmap visualization
โ”‚   โ”œโ”€โ”€ FeatureChart.tsx     โ†’ Per-feature forensic breakdown chart
โ”‚   โ”œโ”€โ”€ FeedbackWidget.tsx   โ†’ User feedback submission UI
โ”‚   โ”œโ”€โ”€ Footer.tsx
โ”‚   โ”œโ”€โ”€ ImageUpload.tsx      โ†’ Image deepfake upload โ†’ Cloudflare Worker โ†’ Hugging Face API
โ”‚   โ”œโ”€โ”€ InstallPWA.tsx       โ†’ PWA install prompt handler
โ”‚   โ”œโ”€โ”€ LandingNavbar.tsx    โ†’ Public landing page navigation
โ”‚   โ”œโ”€โ”€ language-toggle.tsx  โ†’ i18n language switcher
โ”‚   โ”œโ”€โ”€ LiveMonitor.tsx      โ†’ Real-time mic monitoring (5s chunks)
โ”‚   โ”œโ”€โ”€ mode-toggle.tsx      โ†’ Dark/light theme switch
โ”‚   โ”œโ”€โ”€ Navbar.tsx           โ†’ Authenticated app navigation
โ”‚   โ”œโ”€โ”€ ScanHistory.tsx      โ†’ History list with audio playback
โ”‚   โ”œโ”€โ”€ SpeakerIdentity.tsx  โ†’ Enrollment + verification UI
โ”‚   โ””โ”€โ”€ theme-provider.tsx   โ†’ Global theme context
โ”œโ”€โ”€ context/
โ”‚   โ””โ”€โ”€ LanguageContext.tsx  โ†’ i18n context provider
โ”œโ”€โ”€ lib/
โ”‚   โ””โ”€โ”€ utils.ts             โ†’ Shared utility helpers
โ”œโ”€โ”€ pages/
โ”‚   โ”œโ”€โ”€ History.tsx          โ†’ Full scan history page
โ”‚   โ””โ”€โ”€ Landing.tsx          โ†’ Public marketing landing
โ”œโ”€โ”€ utils/
โ”‚   โ””โ”€โ”€ pdfGenerator.ts      โ†’ jsPDF-powered report generation
โ”œโ”€โ”€ App.tsx                  โ†’ Root router + Clerk provider
โ””โ”€โ”€ AuthenticatedShell.tsx   โ†’ Protected app shell wrapper

Key Libraries:

Library Version Purpose
React 18 Core UI framework
Vite โ€” Build tool + HMR
TypeScript 5.3 Type safety
Tailwind CSS โ€” Utility-first styling
Framer Motion โ€” Animations
Clerk โ€” Auth (JWT)
Recharts โ€” Analytics charts
Lucide React โ€” Icon set
Workbox 7.3 PWA / Service Worker

apps/api โ€” API Gateway

src/
โ”œโ”€โ”€ db/
โ”‚   โ”œโ”€โ”€ index.ts    โ†’ Drizzle + pg connection pool (max 20, timeout 5s, idle 30s)
โ”‚   โ””โ”€โ”€ schema.ts   โ†’ PostgreSQL schema definitions
โ”œโ”€โ”€ middleware/
โ”‚   โ””โ”€โ”€ auth.ts     โ†’ Clerk JWT verification middleware (authMiddleware + requireAuth)
โ”œโ”€โ”€ routes/
โ”‚   โ””โ”€โ”€ speaker.ts  โ†’ /speaker/enroll + /speaker/verify endpoints
โ””โ”€โ”€ index.ts        โ†’ Main Hono app, all route registration

Database Schema:

// scans table
{
  id: serial (PK),
  userId: text (NOT NULL),         // Clerk user ID
  audioUrl: text (NOT NULL),
  isDeepfake: boolean,
  confidenceScore: float8,
  fileHash: text,                  // SHA-256 for deduplication
  audioData: text,                 // Base64 encoded audio (for playback)
  analysisDetails: text,           // Human-readable XAI output
  createdAt: timestamp (default now),
  feedback: text
  // Indexes: userId, createdAt, fileHash
}

// speakers table
{
  id: uuid (PK, random),
  userId: text (NOT NULL),         // Clerk user ID (scoped isolation)
  name: text (NOT NULL),
  embedding: json (NOT NULL),      // 192-dim ECAPA-TDNN float array
  createdAt: timestamp (NOT NULL)
  // Index: userId
}

API Endpoints:

Method Path Auth Description
POST /upload โœ… Upload audio file for deepfake scan
POST /scan โœ… Scan audio from URL
GET /scans โœ… Get user's scan history
GET /audio/:id โœ… Stream audio blob for playback
POST /scans/:id/feedback โœ… Submit feedback on a scan
POST /speaker/enroll โœ… Enroll speaker voice print
POST /speaker/verify โœ… Verify speaker identity

apps/engine โ€” AI Engine

apps/engine/
โ”œโ”€โ”€ main.py           โ†’ FastAPI app, endpoint definitions, lifespan context
โ”œโ”€โ”€ detect.py         โ†’ Deepfake detection pipeline (Wav2Vec2 + spectral)
โ”œโ”€โ”€ detect_image.py   โ†’ Image deepfake detection
โ”œโ”€โ”€ speaker.py        โ†’ ECAPA-TDNN embedding generation + HF patches
โ”œโ”€โ”€ schemas.py        โ†’ Pydantic models (AudioUpload, ScanResult)
โ”œโ”€โ”€ dummy_custom.py   โ†’ SpeechBrain HuggingFace 404 fallback patch
โ”œโ”€โ”€ requirements.txt  โ†’ Pinned Python dependencies
โ””โ”€โ”€ Dockerfile        โ†’ Python 3.11-slim, non-root user (appuser)

Engine Endpoints:

Method Path Description
GET / Health check โ€” {"status": "AI Engine Running"}
POST /scan Scan audio via URL (async download โ†’ analyze)
POST /scan-upload Scan uploaded audio file
POST /analyze Video/audio analysis with moviepy fallback
POST /embed Generate ECAPA-TDNN speaker embedding vector

Performance Notes:

  • Lazy Model Loading: Models load on first request (not at startup) to prevent OOM crashes on free-tier Render instances.
  • Thread Executor: CPU-bound inference runs in loop.run_in_executor() to keep FastAPI async event loop non-blocking.
  • Temp File Cleanup: All uploaded/extracted files are deleted in finally blocks โ€” no disk leaks.

packages/shared

Shared Zod validation schemas and TypeScript types (ScanResultType, AudioUploadSchema, etc.) consumed by both apps/api and apps/web.


.github/workflows/keep-alive.yml

GitHub Actions cron job that pings both Render services every 14 minutes to prevent cold starts on the free tier.

schedule:
  - cron: "*/14 * * * *"

Pings:

  • API: https://satark-ai-f5t7.onrender.com/
  • Engine: https://satark-ai-es1v.onrender.com/

๐Ÿš€ Getting Started

Prerequisites

Requirement Version
Node.js v18+
Python 3.11+
PostgreSQL 14+
Docker (optional) Latest

Option A โ€” Manual Setup (3 Terminals)

1. Clone the Repository

git clone https://github.com/theunstopabble/Satark-AI.git
cd Satark-AI

2. Install Node.js Dependencies

npm install   # installs all workspaces via Turborepo

3. Install Python Dependencies (AI Engine)

cd apps/engine
python -m venv venv
source venv/bin/activate       # Windows: venv\Scripts\activate
pip install torch torchaudio --index-url https://download.pytorch.org/whl/cpu
pip install -r requirements.txt

4. Configure Environment Variables

Create .env files in each app directory:

apps/web/.env

VITE_CLERK_PUBLISHABLE_KEY=pk_test_xxxx
VITE_API_URL=http://localhost:3000

apps/api/.env

DATABASE_URL=postgresql://user:password@localhost:5432/satark_db
CLERK_SECRET_KEY=sk_test_xxxx
CLERK_PUBLISHABLE_KEY=pk_test_xxxx
ALLOWED_ORIGINS=http://localhost:5173
ENGINE_URL=http://localhost:8000

apps/engine/.env

# No required vars โ€” models download from HuggingFace on first run

5. Run Database Migrations

cd apps/api
npx drizzle-kit push

6. Start All Services

Terminal Command
Terminal 1 โ€” Frontend cd apps/web && npm run dev
Terminal 2 โ€” API Gateway cd apps/api && npm run dev
Terminal 3 โ€” AI Engine cd apps/engine && uvicorn main:app --reload --port 8000

Or run everything at once from root:

npm run dev   # Turborepo orchestrates all three concurrently

Option B โ€” Docker Compose

# Copy and fill in your .env values first
cp .env.example .env

docker-compose up --build

Services will start at:

  • Frontend: http://localhost:5173
  • API Gateway: http://localhost:3000
  • AI Engine: http://localhost:8000

Docker security hardening included:

  • Non-root user (appuser) in the engine container
  • no-new-privileges:true security option on all services
  • tmpfs mount for /tmp in API and web containers

โ˜๏ธ Deployment

Service Platform URL
Frontend (apps/web) Vercel satark-deepfake.vercel.app
API Gateway (apps/api) Render satark-ai-f5t7.onrender.com
AI Engine (apps/engine) Render satark-ai-es1v.onrender.com
Image Proxy (Worker) Cloudflare Workers satark-image-proxy.gautamkumar43421.workers.dev
Database Supabase / Neon / Railway PostgreSQL (SSL enabled)

Vercel config (apps/web/vercel.json) โ€” SPA routing rewrites all paths to index.html.


๐Ÿ” Security Architecture

Layer Mechanism Detail
Authentication Clerk JWT All protected routes verify token server-side
Authorization Context-scoped userId userId extracted from auth token โ€” never trusted from request body
Speaker isolation DB-level scoping Verify queries filter by userId โ€” no cross-user voice data access
Speaker threshold Cosine similarity โ‰ฅ 0.75 Strict match threshold prevents false identity confirmations
File handling UUID-prefixed temp files Uploaded files stored with random UUID prefix, deleted post-processing
Container Non-root user Engine runs as appuser โ€” no root privileges inside Docker
Connection pool pg Pool Max 20 connections, 5s timeout, graceful error recovery
Image proxy CORS Origin whitelist Worker rejects requests from unlisted origins โ€” no wildcard *
Image size limit Double-layer check Enforced via content-length header + actual byteLength post-read (5MB cap)
HF key isolation Cloudflare Secrets HF_API_TOKEN never exposed to frontend โ€” stored in Worker environment only

๐Ÿ“ฆ Environment Variables Reference

Variable App Required Description
VITE_CLERK_PUBLISHABLE_KEY web โœ… Clerk frontend public key
VITE_API_URL web โœ… Backend API base URL
DATABASE_URL api โœ… PostgreSQL connection string
CLERK_SECRET_KEY api โœ… Clerk backend secret key
CLERK_PUBLISHABLE_KEY api โœ… Clerk public key (for validation)
ALLOWED_ORIGINS api โœ… CORS allowed origins (comma-separated)
ENGINE_URL api โœ… FastAPI engine base URL
IMAGE_API_URL api โœ… Cloudflare Worker URL for image deepfake proxy
HF_API_TOKEN cloudflare-worker โœ… Hugging Face API token โ€” set as Cloudflare Worker Secret

Note on HF_API_TOKEN: This is stored via wrangler secret put HF_API_TOKEN and is never in source code or .env files. It lives exclusively in Cloudflare's encrypted secret store. Get one free at https://huggingface.co/settings/tokens


๐Ÿค Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

  1. Fork the repository
  2. Create a feature branch (git checkout -b feat/your-feature)
  3. Commit your changes (git commit -m 'feat: add your feature')
  4. Push to the branch (git push origin feat/your-feature)
  5. Open a Pull Request

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

Gautam Kumar โ€” Full-Stack Developer | Solo-shipped SaaS Products | AI Integration

LinkedIn GitHub Portfolio

๐Ÿ“ From Sitamarhi, Bihar ยท Currently in Jaipur, Rajasthan


๐Ÿ“„ License

This project is licensed under the MIT License โ€” see the LICENSE file for details.


Built with โค๏ธ in India ๐Ÿ‡ฎ๐Ÿ‡ณ
Satark-AI โ€” Because the truth still matters.

๐ŸŒ More Projects by Gautam Kumar

Project Description Link
Portfolio Personal portfolio & developer profile gautam-kr.vercel.app
InterviewMinds Production-grade AI Mock Interview Platform interviewminds.vercel.app
SwadKart Multi-vendor food delivery platform with AI chatbot swadkart.vercel.app
TexFolio AI-powered LaTeX resume builder with RBAC texfolio.vercel.app

About

Multi-Model Deepfake Detection & Speaker Verification Platform. Wav2Vec2 audio forensics, NVIDIA NIM (Llama 3.2-90B Vision) image detection, ECAPA-TDNN voice biometrics. Turborepo microservices: React + FastAPI + Hono + Cloudflare Workers.

Topics

Resources

Stars

8 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages