Deployment Options
Relevant source files
The following files were used as context for generating this wiki page:
TrueLens offers a multi-tier deployment architecture designed to handle content verification, document analysis, and cryptographic signing. The system is split into a Next.js frontend application and a FastAPI-based backend service, allowing for flexible hosting across cloud providers like Vercel and Render.
The deployment infrastructure supports various workloads, from lightweight text analysis using stylometry to resource-intensive machine learning models like DistilBERT and RoBERTa for AI detection. Enterprise-grade options even include on-premise ML hosting for organizations with strict data sovereignty requirements.
Sources: truelens-app/src/app/developers/page.tsx:216, truelens-app/README.md:29, truelens-backend/requirements.txt:38
Frontend Deployment
The frontend of TrueLens is built with Next.js and is optimized for deployment on the Vercel Platform. It utilizes a variety of client-side libraries for real-time interactions, such as framer-motion for animations and html5-qrcode for scanning document verification codes.
Frontend Technologies
| Component | Technology | Description |
|---|---|---|
| Framework | Next.js 16.2.6 | React-based framework for SSR and static generation. |
| Styling | Tailwind CSS / PostCSS | Utility-first CSS framework for responsive design. |
| QR Scanning | html5-qrcode | Library for scanning document QR codes via browser. |
| Hashing | crypto-js | Client-side cryptographic operations. |
Sources: truelens-app/package.json:10-38, truelens-app/README.md:29, truelens-app/src/app/verify/page.tsx:16
Local Development Flow
To deploy a local instance for development, the project uses standard NPM scripts to initiate the development server.
npm run dev
# or
yarn dev
Sources: truelens-app/README.md:5-10
Backend Infrastructure
The TrueLens backend is a Python-based FastAPI service designed for high-concurrency content analysis. It manages task queues, database persistence, and machine learning inference.
Component Architecture
The backend is structured to handle asynchronous analysis tasks using Celery and Redis, ensuring that long-running ML processes do not block API responses.
The backend includes specific configurations for cloud deployment, such as using CPU-only PyTorch to minimize image size on platforms like Render.
Sources: truelens-backend/requirements.txt:2-20
Backend Requirements Summary
| Category | Libraries |
|---|---|
| API Framework | FastAPI, Uvicorn, Pydantic |
| Data Persistence | SQLAlchemy, Psycopg2-binary, Alembic |
| Task Management | Celery, Redis |
| Machine Learning | Torch (CPU), Transformers, Google Generative AI |
| Document/Image | PDFPlumber, PyTesseract, Pillow, ExifRead |
Sources: truelens-backend/requirements.txt:5-46
Integration and API Deployment
TrueLens provides several tiers for integrating its capabilities into third-party applications, ranging from a public REST API to on-premise ML options.
Deployment Tiers
TrueLens provides three distinct deployment and access models:
- Free Tier: Standard cloud-hosted scans for text and URL analysis.
- Pro Tier: High-volume API access (1,000 calls/day) with support for image and document signals.
- Enterprise Tier: Includes an "On-premise ML option" and custom webhooks for integrated workflows.
Sources: truelens-app/src/app/developers/page.tsx:192-230
Analysis Data Flow
When a scan is deployed via the API, the system executes an ensemble scoring logic that aggregates multiple signals.
Cryptographic Document Verification
A key deployment feature is the cryptographic signing of documents. The system uses SHA-256 hashing and the cryptography library to generate tamper-evident signatures. These can be verified through a dedicated endpoint that checks the validity of the signature against the document hash.
Sources: truelens-app/src/lib/analysis.ts:284-300, truelens-backend/requirements.txt:53, truelens-app/src/app/verify/page.tsx:78-95
Conclusion
The TrueLens architecture is designed for scalability and portability. By decoupling the Next.js frontend from the FastAPI/Celery backend, the system can be deployed across various cloud environments while maintaining the high performance required for real-time AI content detection and document verification.