Client Intake โ OCR โ Reconcile โ Tab-to-Categorize โ QBO Export
A minimal working MVP for automated client document processing, transaction extraction, reconciliation, and categorization with keyboard-first UX.
This is a monorepo with separate backend and frontend applications:
/
โโโ backend/ # Node.js + Fastify + TypeScript + PostgreSQL
โโโ frontend/ # React + Tailwind CSS + Keyboard-first UX
โโโ shared/ # Common types and constants
โโโ instructions.md # Detailed requirements and specs
โโโ setup-backend.sh # Backend setup script
โโโ setup-frontend.sh # Frontend setup script
โโโ README.md # This file
# One-command setup for everything
npm run setup:all
# Or separately:
npm run setup:backend # Sets up backend with database
npm run setup:frontend # Sets up frontend# Start both frontend and backend together
npm run dev
# Or separately:
npm run dev:backend # Backend at http://localhost:3001
npm run dev:frontend # Frontend at http://localhost:3000URLs:
- Frontend (React): http://localhost:3000
- Backend API: http://localhost:3001
- API Docs: http://localhost:3001/health
- File Upload: POST /api/upload - Multipart file upload with metadata
- OCR Extraction: GET /api/extract/:file_id - Transaction extraction from documents
- Reconciliation: POST /api/reconcile - Match extracted transactions to ledger
- Category Suggestions: GET /api/suggest - AI-powered categorization based on history
- CSV Export: POST /api/export - Generate downloadable transaction reports
- Database Schema: Complete PostgreSQL schema with migrations and seed data
- Mock OCR: Sample transaction data for testing (easily replaceable with real OCR)
- Upload UI: Drag & drop file upload with progress feedback
- Reconciliation Studio: List of extracted transactions with match status
- Keyboard-First UX: Tab to accept, โ for alternatives, / for search, Ctrl+B for bulk apply
- Evidence Panel: OCR text, transaction details, and confidence scores
- Category Suggestions: Real-time suggestions with confidence indicators
- Export Functionality: Select and download CSV with categorized transactions
- Responsive Design: Clean, modern UI with Tailwind CSS
- Visit http://localhost:3000
- Upload any file (PDF, image, or text) via drag & drop
- View extracted transactions with OCR text and match status
- Click on a transaction to focus it and see category suggestions
- Press Tab to accept the top suggestion, โ to cycle alternatives
- Select multiple transactions using checkboxes
- Click "Export Selected" to download CSV
# 1. Upload Document
curl -X POST -F "[email protected]" -F "firm_id=550e8400-e29b-41d4-a716-446655440000" \
http://localhost:3001/api/upload
# 2. Extract Transactions
curl "http://localhost:3001/api/extract/{file_id}"
# 3. Reconcile with Ledger
curl -X POST -H "Content-Type: application/json" \
-d '{"firm_id":"550e8400-e29b-41d4-a716-446655440000","extracted_transaction_ids":[...]}' \
http://localhost:3001/api/reconcile
# 4. Get Category Suggestions
curl "http://localhost:3001/api/suggest?firm_id=550e8400-e29b-41d4-a716-446655440000&vendor=Zoom"
# 5. Export to CSV
curl -X POST -H "Content-Type: application/json" \
-d '{"firm_id":"550e8400-e29b-41d4-a716-446655440000","transaction_ids":[...],"format":"csv"}' \
http://localhost:3001/api/exportfirms- Accounting firmsfiles- Uploaded document filesextracted_transactions- OCR-extracted transaction dataledger_transactions- Existing QuickBooks/Xero ledger datacategory_history- Machine learning categorization historymatches- Reconciliation match resultsexports- Generated export files
- Demo accounting firm with sample ledger transactions
- Realistic vendor data (Zoom, Adobe, AWS, Office Depot, etc.)
- Pre-populated category history for intelligent suggestions
cd backend
npm run dev # Start with hot reload
npm test # Run tests
npm run db:migrate # Run new migrations
npm run db:seed # Load sample dataImport the following collection or test manually:
Health Check
GET http://localhost:3001/health
Upload File
POST http://localhost:3001/api/upload
Content-Type: multipart/form-data
Body: file + firm_id
Extract Transactions
GET http://localhost:3001/api/extract/{file_id}
npm run build
npm start- Production: Use managed PostgreSQL (Supabase, Railway, etc.)
- Local dev: Docker PostgreSQL
DB_HOST=your-db-host
DB_PORT=5432
DB_NAME=dunlin_prod
DB_USER=your-db-user
DB_PASSWORD=your-db-password
PORT=3001
OCR_MOCK_MODE=false # Enable real OCR in production- โ File Upload: Can upload files and see extraction results
- โ OCR Processing: Mock OCR returns realistic transaction data (easily replaceable)
- โ Reconciliation: Transactions match against seed ledger with confidence scoring
- โ Tab-to-Categorize: Tab accepts suggestions, โ cycles alternatives, keyboard-first UX
- โ CSV Export: Selected transactions export to properly formatted CSV
- โ Evidence Panel: OCR text, transaction details, and confidence indicators
- โ API Contracts: All 5 endpoints implemented and tested
- โ Database Schema: Complete with migrations and sample data
- โ Demo Ready: 90-second demo flow working end-to-end
- โ File upload and storage
- โ Mock OCR with realistic sample data
- โ Transaction reconciliation logic
- โ Category suggestion engine
- โ CSV export functionality
- โ React frontend with keyboard-first UX
- โ Complete integration and testing
- Google Vision API integration
- AWS Textract integration
- Tesseract.js fallback
- OCR confidence scoring and error handling
- QBO/Xero writeback integration
- Advanced reconciliation rules (running balance checks)
- Bulk operations and workflow management
- Multi-firm support and user authentication
- Detailed Requirements - Complete MVP specifications
- Backend API Docs - API endpoints and database schema
- Frontend Docs - React component documentation
- Backend-first development approach
- Mock data for rapid iteration
- Real OCR integration after core flows are working
- Keyboard-first UX principles
This project is part of the Dunlin MVP development sprint.