This project includes a Vite + React frontend and a FastAPI backend.
npm i
npm run devThe frontend reads VITE_API_BASE_URL and defaults to http://127.0.0.1:8000.
The repository is preconfigured for Firebase Hosting. Set VITE_API_BASE_URL in .env.production, then run:
npm run deploy:hostingFor the GitHub Actions Firebase Hosting deployment, the following repository secrets must also be configured so Firebase Authentication is initialized in the production browser build:
VITE_FIREBASE_API_KEYVITE_FIREBASE_AUTH_DOMAINVITE_FIREBASE_DATABASE_URLVITE_FIREBASE_PROJECT_IDVITE_FIREBASE_STORAGE_BUCKETVITE_FIREBASE_MESSAGING_SENDER_IDVITE_FIREBASE_APP_IDVITE_FIREBASE_MEASUREMENT_ID
These are Firebase Web SDK configuration values; they are embedded in the frontend bundle by design. Keeping them in GitHub Actions secrets avoids coupling the repository to one deployment environment and ensures the production build receives the same configuration as local development.
cd backend
python -m venv .venv
# Windows: .venv\Scripts\activate
# Linux/macOS: source .venv/bin/activate
pip install --extra-index-url https://download.pytorch.org/whl/cpu -r requirements.txt
cd ..
uvicorn backend.main:app --reload --host 127.0.0.1 --port 8000The backend dependencies now use CPU-only PyTorch wheels and opencv-python-headless, avoiding CUDA packages and unnecessary GUI libraries in server deployments.
The backend has a production Dockerfile at backend/Dockerfile and listens on the platform-provided PORT (default 8000).
From the repository root:
docker build -t veritasai-backend ./backend
docker run --rm -p 8000:8000 --env-file backend/.env veritasai-backendFor Render, Railway, Fly.io, Google Cloud Run, or another Docker-compatible service, use backend/ as the Docker build context and backend/Dockerfile as the Dockerfile. The service should expose HTTP on $PORT.
Configure Firebase credentials using either:
FIREBASE_SERVICE_ACCOUNT_PATH, orGOOGLE_APPLICATION_CREDENTIALS
and configure the frontend's VITE_API_BASE_URL to the deployed backend URL.
The FaceForensics++ Xception checkpoint is approximately 84 MB and is kept outside the Python dependency installation. Put it at backend/models/faceforensics_xception.pth or configure the path using the backend's video model settings. If the checkpoint is not available, the backend can still start; video model readiness should be checked before enabling video analysis.
FastAPI persists users and analysis history to Firestore when Firebase Admin credentials are available. If credentials are missing or invalid, the backend falls back to in-memory storage.
Collections used by the backend:
usersanalysis_history
- Login:
/api/auth/login - Signup:
/api/auth/signup - Text analysis:
/api/analyze/text - URL checker:
/api/analyze/url - Image upload:
/api/analyze/image - Video upload:
/api/analyze/video - History:
/api/history