A quarterly bookkeeping assistant that turns receipt photos into a reviewable ledger, CSV export, and draft tax estimate — built for Philippine small businesses.
Upload receipt images, and the app automatically classifies each one as a Sale or Expense, extracts key fields (merchant, date, amount, VAT), and computes a quarterly tax worksheet you can print or export.
- AI-powered receipt scanning — A chain of vision LLMs (Gemini → OpenAI → Groq) analyzes uploaded receipt images server-side. If all providers are unavailable, the app falls back to client-side OCR via tesseract.js.
- Auto-classification — Each receipt is automatically labeled as Sale or Expense based on document signals (e.g., "sales invoice" vs. "cash tendered"). Users can override the classification in the ledger.
- Editable ledger — Review and correct extracted data (date, merchant, type, gross amount, VAT) before using the numbers.
- Tax estimate worksheet — Choose between percentage tax, income tax, or VAT payable, and generate a draft government-style worksheet with computed totals.
- CSV export — Download the full receipt ledger as a CSV file for use in spreadsheets or accounting software.
- Built-in chat assistant — A floating chatbot answers tax-related questions using the same LLM provider chain, with FAQ quick-replies for common topics.
- Privacy-first — Images are processed server-side via API keys you control; nothing is stored or sent to third parties beyond the configured providers.
| Layer | Technology |
|---|---|
| Framework | Next.js 14 (App Router) |
| Language | TypeScript |
| Styling | Tailwind CSS (via globals.css) |
| OCR fallback | tesseract.js 4 |
| AI providers | Google Gemini 2.5 Flash, OpenAI GPT-4o-mini, Groq Llama 4 Scout |
| Deployment | Vercel (recommended) |
app/
├── page.tsx # Main UI — upload, ledger, and tax estimate steps
├── layout.tsx # Root layout with metadata and chat bubble
├── globals.css # All application styles
└── api/
├── analyze/ # POST /api/analyze — receipt image analysis
│ ├── route.ts
│ ├── types.ts
│ └── providers/ # Gemini, OpenAI, Groq vision implementations
└── chat/
└── route.ts # POST /api/chat — tax Q&A chatbot
component/
├── chat-bubble.tsx # Floating chat toggle button
└── chat-panel.tsx # Chat conversation UI
lib/
├── ai-providers.ts # LLM provider chain for chat responses
└── chatbot-responses.ts # FAQ keyword matching and fallback answers
- Node.js 18 or newer
- npm
npm installCopy the example file and add your API keys:
cp .env.local.example .env.local| Variable | Provider | Purpose |
|---|---|---|
GEMINI_API_KEY |
Google Gemini | Vision analysis and chat (primary) |
OPENAI_API_KEY |
OpenAI | Vision analysis and chat (fallback) |
GROQ_API_KEY |
Groq | Vision analysis and chat (final fallback) |
At least one key is required for server-side receipt analysis. If none are configured, the app degrades gracefully to client-side tesseract.js OCR (slower, less accurate).
API keys are read only on the server and never reach the browser.
npm run devOpen http://localhost:3000 in your browser.
- Upload receipts — Drop or select receipt photos (JPG, PNG, WEBP). The app scans each image and extracts merchant, date, amount, and VAT.
- Review the ledger — Verify extracted data in an editable table. Correct any highlighted fields (missing amounts show a "Required" placeholder). Mark rows as Verified when satisfied.
- Tax estimate — Choose your tax basis (percentage tax at 3%, income tax, or VAT payable), review the computed totals on a government-style worksheet, and print or export.
npm run build
npm start- Push the repository to GitHub/GitLab.
- Import the project into Vercel.
- Add
GEMINI_API_KEY,OPENAI_API_KEY, and/orGROQ_API_KEYunder Settings → Environment Variables. - Deploy.
When a receipt image is uploaded:
- The image is encoded as base64 and sent to
POST /api/analyze. - The server tries each vision provider in order (Gemini → OpenAI → Groq) until one succeeds.
- The provider returns structured data:
kind(Sale/Expense),merchant,date,amount, andvat. - If all server providers fail, the client falls back to tesseract.js OCR with local text parsing.
The classification logic looks for document signals:
- Sale signals — "sales invoice", "official receipt", "sold to", "bill to"
- Expense signals — "thank you for your purchase", "cash tendered", "cashier", "POS"
- Currency is formatted in Philippine Peso (₱ PHP).
- The tax worksheet is clearly marked as a draft and is not valid for government filing.
- The chat assistant uses the same provider fallback chain as receipt analysis.
- All processing happens per-session; no data is persisted to a database.