TrueAuth is a proof-of-concept authentication system integrating:
- Firebase Authentication for identity verification
- Client-side facial recognition using
face-api.js - Express backend issuing application-level JWT tokens
- PostgreSQL for persistent user storage
The system demonstrates hybrid authentication combining third-party identity verification with biometric enrollment and token-based authorization.
✔ Face-Based Registration & Login
✔ Firebase ID Token Verification
✔ JWT-Based Protected Routes
✔ PostgreSQL User Persistence
✔ Modular Backend Architecture
- React (Vite)
face-api.jsfor facial detection & embeddings- Firebase Client SDK
- Axios for API communication
- Node.js + Express
firebase-adminfor verifying Firebase tokensjsonwebtokenfor issuing JWTspgfor PostgreSQL integrationdotenvfor environment configurationcorsfor cross-origin handling
TrueAuth/ │ ├── Backend/ │ ├── controllers/ │ ├── routes/ │ ├── index.js │ ├── serviceAccountKey.json │ └── .env │ └── Frontend/ ├── src/ ├── components/ ├── public/models/ └── vite.config.js
- User authenticates via Firebase.
- Firebase ID token is sent to backend.
- Backend verifies token using
firebase-admin. - Backend issues application-level JWT.
- JWT grants access to protected routes.
- Facial embedding is enrolled client-side.
Create .env inside Backend/:
PORT=4000 JWT_SECRET=your_strong_secret postgres_user=your_user postgres_host=localhost postgres_db=your_database postgres_password=your_password postgres_port=5432
Do not commit:
.envserviceAccountKey.json
| Column Name | Data Type | Constraint | Default Value |
|---|---|---|---|
| id PK | uuid | NOT NULL | uuid_generate_v4() |
| firebase_uid | text | NOT NULL | — |
| name | text | NOT NULL | — |
| text | NOT NULL | — | |
| face_embedding | double precision[] | — | — |
| face_registered | boolean | — | false |
| created_at | timestamp without time zone | — | now() |
CREATE EXTENSION IF NOT EXISTS "uuid-ossp";
CREATE TABLE users ( id uuid PRIMARY KEY DEFAULT uuid_generate_v4(), firebase_uid text NOT NULL UNIQUE, name text NOT NULL, email text NOT NULL UNIQUE, face_embedding double precision[], face_registered boolean DEFAULT false, created_at timestamp without time zone DEFAULT now() );
cd Backend
npm install
node index.jscd Frontend
npm install
npm run dev- 🔐 Use a strong JWT_SECRET
- 🚫 Never commit credentials
- 🌐 Use HTTPS in production
- 🚦 Add rate limiting before deployment
- 👁️ Biometric data must be handled with extreme caution in production systems
- Not production-hardened
- Limited abuse protection
- Intended for architectural experimentation
TrueAuth v1.0 — Biometric Authentication Prototype
