6.4 KiB
6.4 KiB
Technology Stack
Analysis Date: 2026-02-24
Languages
Primary:
- TypeScript 5.2.2 - Both backend and frontend, strict mode enabled
- JavaScript (CommonJS) - Build outputs and configuration
Supporting:
- SQL - Supabase PostgreSQL database via migrations in
backend/src/models/migrations/
Runtime
Environment:
- Node.js 20 (specified in
backend/firebase.json) - Browser (ES2020 target for both client and server)
Package Manager:
- npm - Primary package manager for both backend and frontend
- Lockfile:
package-lock.jsonpresent in bothbackend/andfrontend/
Frameworks
Backend - Core:
- Express.js 4.18.2 - HTTP server and REST API framework at
backend/src/index.ts - Firebase Admin SDK 13.4.0 - Authentication and service account management at
backend/src/config/firebase.ts - Firebase Functions 6.4.0 - Cloud Functions deployment runtime at port 5001
Frontend - Core:
- React 18.2.0 - UI framework with TypeScript support
- Vite 4.5.0 - Build tool and dev server (port 5173 for dev, port 3000 production)
Backend - Testing:
- Vitest 2.1.0 - Test runner with v8 coverage provider at
backend/vitest.config.ts - Configuration: Global test environment set to 'node', 30-second test timeout
Backend - Build/Dev:
- ts-node 10.9.2 - TypeScript execution for scripts
- ts-node-dev 2.0.0 - Live reload development server with
--transpile-onlyflag - TypeScript Compiler (tsc) 5.2.2 - Strict type checking, ES2020 target
Frontend - Build/Dev:
- Vite React plugin 4.1.1 - React JSX transformation
- TailwindCSS 3.3.5 - Utility-first CSS framework with PostCSS 8.4.31
Key Dependencies
Critical Infrastructure:
@google-cloud/documentai9.3.0 - Google Document AI OCR/text extraction atbackend/src/services/documentAiProcessor.ts@google-cloud/storage7.16.0 - Google Cloud Storage (GCS) for file uploads and processing@supabase/supabase-js2.53.0 - PostgreSQL database client with vector support atbackend/src/config/supabase.tspg8.11.3 - Direct PostgreSQL connection pool for critical operations bypassing PostgREST
LLM & AI:
@anthropic-ai/sdk0.57.0 - Claude API integration with support for Anthropic provideropenai5.10.2 - OpenAI API and embeddings (text-embedding-3-small)- Both providers abstracted via
backend/src/services/llmService.ts
PDF Processing:
pdf-lib1.17.1 - PDF generation and manipulation atbackend/src/services/pdfGenerationService.tspdf-parse1.1.1 - PDF text extractionpdfkit0.17.1 - PDF document creation
Document Processing:
puppeteer21.11.0 - Headless Chrome for HTML/PDF conversion
Security & Authentication:
firebase12.0.0 (frontend) - Firebase client SDK for authentication atfrontend/src/config/firebase.tsfirebase-admin13.4.0 (backend) - Admin SDK for token verification atbackend/src/middleware/firebaseAuth.tsjsonwebtoken9.0.2 - JWT token creation and verificationbcryptjs2.4.3 - Password hashing with 12 rounds default
API & HTTP:
axios1.11.0 - HTTP client for both frontend and backendcors2.8.5 - Cross-Origin Resource Sharing middleware for Expresshelmet7.1.0 - Security headers middlewaremorgan1.10.0 - HTTP request logging middlewareexpress-rate-limit7.1.5 - Rate limiting middleware (1000 requests per 15 minutes)
Data Validation & Schema:
zod3.25.76 - TypeScript-first schema validation atbackend/src/services/llmSchemas.tszod-to-json-schema3.24.6 - Convert Zod schemas to JSON Schema for LLM structured outputjoi17.11.0 - Environment variable validation inbackend/src/config/env.ts
Logging & Monitoring:
winston3.11.0 - Structured logging framework with multiple transports atbackend/src/utils/logger.ts
Frontend - UI Components:
lucide-react0.294.0 - Icon libraryreact-dom18.2.0 - React rendering for webreact-router-dom6.20.1 - Client-side routingreact-dropzone14.3.8 - File upload handlingclsx2.0.0 - Conditional className utilitytailwind-merge2.0.0 - Merge Tailwind classes with conflict resolution
Utilities:
uuid11.1.0 - Unique identifier generationdotenv16.3.1 - Environment variable loading from.envfiles
Configuration
Environment:
- .env file support - Dotenv loads from
.envfor local development inbackend/src/config/env.ts - Environment validation - Joi schema at
backend/src/config/env.tsvalidates all required/optional env vars - Firebase Functions v2 - Uses
defineString()anddefineSecret()for secure configuration (migration from v1 functions.config())
Key Configuration Variables (Backend):
NODE_ENV- 'development' | 'production' | 'test'LLM_PROVIDER- 'openai' | 'anthropic' | 'openrouter' (default: 'openai')GCLOUD_PROJECT_ID- Google Cloud project ID (required)DOCUMENT_AI_PROCESSOR_ID- Document AI processor ID (required)GCS_BUCKET_NAME- Google Cloud Storage bucket (required)SUPABASE_URL,SUPABASE_ANON_KEY,SUPABASE_SERVICE_KEY- Supabase PostgreSQL connectionDATABASE_URL- Direct PostgreSQL connection string for bypass operationsOPENAI_API_KEY- OpenAI API key for embeddings and modelsANTHROPIC_API_KEY- Anthropic Claude API keyOPENROUTER_API_KEY- OpenRouter API key (optional, uses BYOK with Anthropic key)
Key Configuration Variables (Frontend):
VITE_API_BASE_URL- Backend API endpointVITE_FIREBASE_*- Firebase configuration (API key, auth domain, project ID, etc.)
Build Configuration:
- Backend:
backend/tsconfig.json- Strict TypeScript, CommonJS module output, ES2020 target - Frontend:
frontend/tsconfig.json- ES2020 target, JSX React support, path alias@/* - Firebase:
backend/firebase.json- Node.js 20 runtime, Firebase Functions emulator on port 5001
Platform Requirements
Development:
- Node.js 20.x
- npm 9+
- Google Cloud credentials (for Document AI and GCS)
- Firebase project credentials (service account key)
- Supabase project URL and keys
Production:
- Backend: Firebase Cloud Functions (Node.js 20 runtime) or Google Cloud Run
- Frontend: Firebase Hosting (CDN-backed static hosting)
- Database: Supabase PostgreSQL with pgvector extension for vector search
- Storage: Google Cloud Storage for documents and generated PDFs
- Memory Limits: Backend configured with
--max-old-space-size=8192for large document processing
Stack analysis: 2026-02-24