TaxFront is an AI-assisted tax document management platform for individual filers and accountants. Users upload tax documents, Firebase stores and tracks them, Cloud Functions extract structured tax data, and specialized AI agents produce preparation and compliance reports.
Browser
React 18 + TypeScript + Vite + TailwindCSS
Firebase SDK for Auth, Storage, Firestore, callable Functions
|
v
Firebase / Google Cloud
Firebase Auth user identity
Firebase Storage uploaded PDFs and images
Cloud Firestore profiles, document metadata, extractedData
Firebase Cloud Functions production API, extraction, agent runtime
|
v
Genkit + Gemini 2.5 Flash
document extraction
accountant and auditor agents
Self-hosting
Docker Compose builds and serves the frontend behind Nginx
All server-side work runs in the root functions/ TypeScript Cloud Functions.
- Firebase Authentication with separate user and accountant experiences.
- Direct document upload from the browser to Firebase Storage.
- Firestore-backed document status, summaries, profile data, and extracted fields.
- Gemini-powered document extraction for W-2, 1099-NEC, 1099-INT, 1099-DIV, 1098, 1040, Schedule C, and fallback
otherdocuments. - AI Accountant agent for 2024 federal tax preparation estimates, deductions, credits, AGI flow, withholding, and action items.
- AI Auditor agent for data quality checks, cross-form consistency, IRS audit triggers, and risk scoring.
- Docker setup for serving the frontend behind Nginx.
The frontend is a React 18, TypeScript, Vite, TailwindCSS application. It initializes Firebase in frontend/src/firebase.ts, routes in frontend/src/App.tsx, uploads documents from dashboard components, and calls Cloud Functions through frontend/src/services/api.ts.
Key routes and views include login, registration, dashboard, accountant dashboard, tax calculator, tax forms, jobs, profile, storage test, and static legal/info pages.
The root functions/ package is the backend. It uses Node 22, Firebase Functions v2, Firebase Admin, Genkit, and @genkit-ai/googleai.
Callable functions:
| Function | Purpose |
|---|---|
runAccountant |
Runs the Accountant agent for the authenticated user. |
runAuditor |
Runs the Auditor agent for the authenticated user. |
createUserProfile |
Upserts the current user's profile in Firestore. |
getTaxDocuments |
Returns the current user's latest tax documents. |
getTaxSummary |
Aggregates document counts and last update metadata. |
Firestore trigger:
| Trigger | Purpose |
|---|---|
processNewTaxDocument on taxDocuments/{documentId} |
Downloads the uploaded file URL, calls Gemini extraction, writes documentType, taxYear, extractedData, status, and processedAt. |
AI model standard: agent and extraction flows use googleai/gemini-2.5-flash with Genkit. Agent prompts live in functions/prompts/ and are copied into functions/lib/prompts/ during build.
taxFields.ts is the single source of truth for document classification, extracted-field aliases, and income aggregation. Both the accountant and auditor tool sets read from it so their figures cannot drift apart. Add field lookups and income totals there rather than in individual tools.
Project-authored Markdown lives across the root, .kiro/steering/, docker/, docs/, frontend/, and functions/prompts/. The large design-system docs in frontend/ define the current UI palette, component patterns, and implementation conventions.
name: string
taxId: string
businessType: string
updatedAt: ISO-8601 string
userId: string
name: string
originalName: string
type: string
size: number
url: string
uploadDate: ISO-8601 string
status: "pending" | "processed" | "error"
documentType: string
taxYear: number | null
extractedData: object
processedAt: ISO-8601 string
errorMessage: string
- A signed-in user selects a PDF or image in the React dashboard.
- The browser uploads the file directly to Firebase Storage.
- The browser creates a
taxDocumentsFirestore record withstatus: "pending"and the download URL. processNewTaxDocumentruns on Firestore creation.- The function downloads the file and sends inline PDF/image content to Gemini.
- Extracted fields are written back to Firestore as
extractedData; status becomesprocessedorerror. runAccountantandrunAuditorfetch the user's documents, invoke tools, and return structured reports.
- Node.js 22+ for frontend and root Cloud Functions.
- npm.
- Firebase CLI.
- Google Cloud / Firebase project access.
- Docker and Docker Compose for self-hosted local deployment.
cd frontend
npm install
npm run devThe Vite dev server runs on http://localhost:5173 by default.
Build and test:
cd frontend
npm run build
npm test
npm run lintFrontend environment variables use the VITE_FIREBASE_* prefix. See frontend/.env.example.
cd functions
npm install
npm run build
npm run servenpm run serve runs the build and starts the Firebase Functions emulator.
Deploy:
cd functions
npm run deployRequired runtime configuration includes Firebase project credentials and Google AI/Genkit access for Gemini.
docker-compose up --buildDefault services:
| Service | Port | Description |
|---|---|---|
| Frontend | 80 |
Built React app served by Nginx. |
Cloud Functions are deployed with the Firebase CLI rather than containerized.
See docker/README.md for environment variables, health checks, and maintenance notes.
cd frontend
npm testcd functions
npm testCloud Function tests live in functions/test/ and run offline under Vitest: taxFields.test.ts covers the semantic layer, and tools.test.ts invokes the Genkit tools directly. Frontend tests also use Vitest.
The current frontend uses Firebase callable functions for the active AI agent APIs. Some older REST-style documentation remains in root and docs/ Markdown files for historical context and API planning, but root functions/src/index.ts is the source of truth for production callable functions.
The frontend can regenerate OpenAPI types when api-docs/openapi.yml changes:
cd frontend
npm run generate:apiTaxFront handles sensitive tax documents and personally identifiable information. Keep service account JSON files, API keys, and .env files out of commits. Firebase Auth is required for callable production functions, and Firestore queries scope user document reads to the authenticated UID.
See SECURITY.md for vulnerability reporting and security policy details.
- Accountant filing status is still hardcoded to
singlein the dashboard call path. - The older REST helper methods in
frontend/src/services/api.tsmay not match the callable-only production function names. - Root and
docs/API Markdown includes historicaltaxRAGand REST endpoint content that should be treated as legacy unless reconciled withfunctions/src/index.ts.
See TASKS.md for the active backlog.
Yuan Chen - @chenyuan99
Project Link: https://github.com/chenyuan99/TaxFront