This project now includes:
- A Vite + React frontend in the repository root
- A FastAPI backend in
backend/
- Install dependencies:
```bash
npm i
```
- Start the frontend:
```bash
npm run dev
```
The frontend reads VITE_API_BASE_URL and defaults to http://127.0.0.1:8000.
This repository is preconfigured for Firebase Hosting with:
firebase.json(servesdist/and rewrites SPA routes toindex.html).firebaserc(default Firebase project:veritasai-6e4ac)- npm script:
deploy:hosting
- Set production API URL (required):
```bash
cp .env.production.example .env.production
```
Edit `.env.production` and set:
```bash
VITE_API_BASE_URL=https://your-backend-domain.com
```
- Login to Firebase CLI:
```bash
npx firebase-tools login
```
- Deploy hosting:
```bash
npm run deploy:hosting
```
- If you want a different Firebase project, switch it before deploy:
```bash
npx firebase-tools use --add
```
Firebase app + Cloud Firestore are initialized in src/app/lib/firebase.ts.
Optional Vite environment variables:
VITE_FIREBASE_API_KEYVITE_FIREBASE_AUTH_DOMAINVITE_FIREBASE_PROJECT_IDVITE_FIREBASE_STORAGE_BUCKETVITE_FIREBASE_MESSAGING_SENDER_IDVITE_FIREBASE_APP_IDVITE_FIREBASE_MEASUREMENT_ID
If omitted, the app uses your provided Firebase config values.
To use Google sign-in/sign-up, enable Google as a sign-in provider in Firebase Console:
- Firebase Console -> Authentication -> Sign-in method -> Google -> Enable
- Create and activate a Python virtual environment.
- Install backend dependencies:
```bash
pip install -r backend/requirements.txt
```
- Run the API:
```bash
uvicorn backend.main:app --reload --host 127.0.0.1 --port 8000
```
FastAPI persists users and analysis history to Firestore when Firebase Admin credentials are available.
Configure one of the following before starting backend:
FIREBASE_SERVICE_ACCOUNT_PATH(path to Firebase service account JSON), orGOOGLE_APPLICATION_CREDENTIALS(Application Default Credentials).
Firestore collections used by backend:
usersanalysis_history
If credentials are missing or invalid, backend falls back to in-memory storage.
The following user inputs are connected to FastAPI endpoints:
- Login form (
/api/auth/login) - Signup form (
/api/auth/signup) - Text analysis input (
/api/analyze/text) - URL checker input (
/api/analyze/url) - Image upload (
/api/analyze/image) - Video upload (
/api/analyze/video) - History view (
/api/history)