Get started

Run the project locally: clone the repo, set up the backend and frontend, configure optional environment variables, and deploy to production when ready.

Overview

The project has two main parts: a FastAPI backend (see fast-api-server/) that loads model artifacts and serves /health and /predict, and a frontend (Next.js) in web/ that proxies those to /api/health and /api/predict. A legacy Flask backend remains in backend/ for reference only.

Prerequisites

  • Python 3.10+ (for FastAPI backend)
  • Node.js 18+ and npm (for frontend)
  • Git (to clone the repository)
  • Model artifacts exported into fast-api-server/artifacts/ (see training-models/ notebooks)

Installation

Clone the repository and install dependencies for backend and frontend.

git clone https://github.com/zuberkhan01st/Vcs-DeepFake-Audio-Detection
cd Vcs-DeepFake-Audio-Detection

Backend (FastAPI, recommended)

Create a virtual environment in fast-api-server/, install dependencies, and point ARTIFACTS_DIR at your saved model artifacts.

cd fast-api-server
python -m venv venv
# Windows: venv\Scripts\activate
# macOS/Linux: source venv/bin/activate
pip install -r requirements.txt

export ARTIFACTS_DIR=./artifacts
uvicorn app.main:app --host 0.0.0.0 --port 8000

Frontend

From the project root, install and run the Next.js app.

cd web
npm install

Configuration

Optional environment variables:

  • Backend (FastAPI): ARTIFACTS_DIR (default: ./artifacts), APP_WORKERS, PORT (for Docker/Nginx stack).
  • Frontend: BACKEND_URL in .env.local (e.g. http://127.0.0.1:8000 or http://127.0.0.1:10000).

Download & model

Training runs live in training-models/. After training, export artifacts (model checkpoint, scaler, keep-mask, prototypes, config, feature names) into fast-api-server/artifacts/ as described in the FastAPI README. The backend reads everything from there via ARTIFACTS_DIR.

Running the app

Start the FastAPI backend first, then the frontend.

Terminal 1 (backend)

cd fast-api-server
# with venv activated
export ARTIFACTS_DIR=./artifacts
uvicorn app.main:app --host 0.0.0.0 --port 8000

Terminal 2 (frontend)

cd web
npm run dev

Open http://localhost:3000. Use Detect to upload audio and get predictions.

Production deployment

For production, use the Docker stack in fast-api-server/ (FastAPI + Gunicorn + Nginx) or run FastAPI behind Gunicorn and Nginx yourself. The Next.js app can run as a Node.js service behind the same Nginx instance or your provider's load balancer. See Deployment for a full walkthrough.

Next steps

  • Deployment โ€” host locally or on a VPS, FastAPI Docker backend, Nginx, SSL, security.
  • API reference โ€” endpoints, schemas, code examples.
  • Mission โ€” why we build this and how to contribute.