Frontend GUI built with Vite + React + TypeScript (Tailwind + shadcn/ui). It provides:
- Media capture & upload for deepfake detection (camera video/audio, photo capture, screen recording, file upload).
- Result details + history view backed by the backend logging endpoints.
- PWA support via
vite-plugin-pwa(service worker registration insrc/main.tsx).
npm installCreate a .env file in the project root (you can copy from env.example). At minimum you need:
VITE_API_BASE_URL(required): base URL for the backend API (used by Axios insrc/api/baseApi.ts).
Example .env.example
npm run devThen open:
- App:
http://localhost:8080/
VITE_API_BASE_URL: backend API base URL (example:http://localhost:8000). The frontend calls endpoints like:POST /analyze_imagePOST /analyze_videoPOST /analyze_audioGET /logs/allGET /logs/get_by_id?id=...DELETE /logs/delete_by_id?id=...
All media requests are multipart/form-data with form field file.
- Image:
POST /analyze_image - Video:
POST /analyze_video - Audio:
POST /analyze_audio - Logs:
GET /logs/allGET /logs/get_by_id?id=...DELETE /logs/delete_by_id?id=...
- Dev:
npm run dev(Vite dev server; configured to run on port8080invite.config.ts) - Build:
npm run build(outputs static assets todist/) - Preview production build:
npm run preview - Lint:
npm run lint
- App entrypoint:
src/main.tsx- Mounts React app
- Registers the PWA service worker (auto-update)
- Routing:
src/App.tsx/main app (scanner/upload/paste/screen recorder + history)/scan_result/:idscan result details (fetches log row by id)
- API layer:
src/api/baseApi.tscreates the Axios instance usingVITE_API_BASE_URLimageDetection.ts,videoDetection.ts,audioDetection.tscall/analyze_*handling/apiLogHandling.tscalls/logs/*
- UI components:
src/components/Scanner.tsx: capture from camera/mic and send to backendScreenRecorder.tsx: record the screen and send to backendUpload.tsx: upload demo files or user files and send to backendHistory.tsx: list/delete scan logs; deep-links to result details
The repo includes demo assets under public/demos/ (images, audio, video) used by the in-app demo menu.
DeepTrustGUI/
public/
demos/
...
src/
api/
audio/
image/
video/
handling/
baseApi.ts
components/
ui/
Scanner.tsx
ScreenRecorder.tsx
Upload.tsx
History.tsx
pages/
MainApp.tsx
ScanResult.tsx
NotFound.tsx
App.tsx
main.tsx
vite.config.ts
package.json
This is a static frontend. Deploy the contents of dist/ produced by npm run build to any static host.
- Important:
VITE_API_BASE_URLis embedded at build time by Vite. Make sure it points to the correct backend in the environment where you build.