Skip to content

AI Integration

Product Engineering

ParseHQ

ParseHQ is an independent AI-powered invoice processing application designed to reduce the manual work involved in extracting and verifying supplier invoice data. I started developing the application in April 2026, building a full-stack system with Next.js, TypeScript, PostgreSQL, Drizzle ORM, Better Auth, and Cloudflare R2. The application integrates Gemini and OpenAI through a provider-independent model layer to extract structured invoice information, including individual line items. Extracted values are validated with Zod, checked for arithmetic inconsistencies, and presented alongside the source document for human review. The engineering work also includes OCR-backed source references, tenant-level data isolation, transaction-safe trial usage limits, background processing, and automated testing of core workflows. ParseHQ is an independent project, not a commissioned client application. Development is currently on hold, and the product has not been publicly launched.

Project details

Project type
AI-Powered Invoice Processing SaaS
Role
Independent Full-Stack Engineer
Engagement
Independent · Personal Project
Period
April 2026 – Present
Status
Pre-launch · Development on hold
Technologies
  • Next.js
  • React
  • TypeScript
  • PostgreSQL
  • Drizzle ORM
  • Better Auth
  • Cloudflare R2
  • Gemini API
  • OpenAI API
  • Zod
  • OCR

Context

Project context.

ParseHQ is an AI-powered application for extracting structured information from supplier invoices and making that information easier to review and verify. Businesses that regularly receive supplier invoices often need to transfer information from PDF documents into spreadsheets, accounting systems, or internal records. This process can involve manually identifying suppliers, invoice details, individual line items, quantities, prices, and totals. The challenge extends beyond extracting text. Invoice layouts differ between suppliers, financial values must be interpreted correctly, and extracted results need to be checked before they can be trusted. ParseHQ approaches this problem by combining document processing, large language models, structured data validation, and a human-review interface. Users can review extracted invoice information alongside the original PDF, while the application identifies inconsistencies that require attention. I developed ParseHQ independently to explore the engineering challenges of building reliable AI-powered business software, particularly the interaction between probabilistic AI outputs and deterministic application requirements. The application is currently in private development and testing, with development paused. It has not been launched as a production service.

Project setting

ParseHQ was conceived as a B2B application for people handling recurring supplier invoice workloads, including small teams processing approximately 20–100 invoices per week. That workload represents the intended audience and problem space, not measured production usage. The application combines conventional full-stack engineering with AI integration. Its central technical challenge is not simply obtaining an LLM response, but ensuring the response is structured, traceable, mathematically checked, and handled safely within a multi-user application. The project also explores how different AI providers can be supported behind a shared interface without tightly coupling the application to one model.

Problem space

  • Manually transferring supplier invoice information into structured records is repetitive and time-consuming.
  • Supplier invoices use different layouts, making consistent extraction difficult.
  • Line items, quantities, unit prices, and totals need to be represented accurately.
  • LLM-generated values may be incomplete, incorrectly structured, or mathematically inconsistent.
  • Users need a way to verify extracted information against the original document.
  • AI-generated results should be validated before being accepted into persistent application data.
  • Multi-tenant applications must prevent users from accessing documents and records belonging to other accounts.
  • Usage limits need to remain consistent when multiple document-processing requests occur concurrently.
  • Document processing must account for failures, retries, and uncertain extraction results.

Target users

  • Independent bookkeepers processing supplier invoices.
  • Small business owners handling purchasing and financial records.
  • Operations teams managing recurring invoice documentation.
  • Businesses that need structured, reviewable data from supplier PDF invoices.

Contribution

My contribution.

I am the independent full-stack engineer behind ParseHQ, responsible for its application architecture, frontend interfaces, backend integration, AI extraction pipeline, data models, authentication, and reliability safeguards. My work spans document ingestion, model-provider integration, structured output validation, financial reconciliation, multi-tenant access control, and the user experience for reviewing extracted information.

ParseHQ combines several engineering concerns that become important when AI-generated information is used in business applications. The extraction system must handle varying invoice formats while producing data that conforms to a predictable structure. Financial values must be checked independently of the AI model, and users need enough information to review questionable results. The application also needs conventional SaaS safeguards around authentication, data isolation, file storage, usage limits, and failure handling. I designed the implementation around these concerns, treating AI output as information that requires verification rather than automatically trusted application data.

  1. Full-Stack Application Architecture

    Designed and developed the application using Next.js, React, TypeScript, PostgreSQL, and Drizzle ORM. Structured the system around invoice documents, extraction results, user accounts, and related processing workflows, connecting the application interface with persistent data and AI services.

  2. Provider-Independent AI Integration

    Implemented an abstraction for Gemini and OpenAI so invoice extraction can use different model providers through a consistent application interface. Separated provider-specific interactions from the structured extraction contract, allowing the application to validate results independently of the model generating them.

  3. Structured Extraction and Validation

    Developed an AI processing flow for extracting invoice information and individual line items from supplier PDFs. Used Zod to validate structured model responses and implemented checks for financial inconsistencies, including arithmetic mismatches that require further review.

  4. Document Review and Source References

    Built functionality for presenting extracted invoice information alongside its source document. Implemented OCR-backed source references and highlighting to help associate extracted values with their locations in the original invoice. This provides a way to inspect AI-generated results rather than relying exclusively on the extracted data.

  5. Multi-Tenant Authentication and Data Isolation

    Integrated Better Auth and implemented tenant-level access checks around application data and document operations. Focused on ensuring that invoice records and associated resources are accessed within the appropriate account context.

  6. Transaction-Safe Usage Enforcement

    Implemented server-side trial usage limits with transaction-safe enforcement. Designed the quota checks to account for concurrent document uploads, preventing separate requests from independently consuming the same remaining allowance.

  7. Processing Reliability and Testing

    Worked on background invoice-processing functionality with retry handling for recoverable failures. Implemented automated end-to-end coverage across document upload, extraction, and review workflows to exercise the application's core functionality during private testing.

Scope of ownership

ParseHQ is an independent engineering project rather than a paid client engagement. It demonstrates the combination of AI integration and conventional software engineering required to build applications that process business-critical information. The emphasis has been on controlling and verifying AI-generated data, maintaining tenant boundaries, enforcing usage rules, and providing an interface through which users can inspect extraction results. Development began in April 2026 and is currently on hold. The application remains a private, pre-launch project.

Implementation

Technical breakdown.

ParseHQ is built with Next.js and TypeScript, using PostgreSQL and Drizzle ORM for persistent application data, Better Auth for authentication, and Cloudflare R2 for document storage. The AI processing layer integrates Gemini and OpenAI through provider-independent adapters, with Zod validation applied at the boundary between model-generated responses and application data. The implementation includes document extraction, OCR-backed source references, arithmetic verification, tenant-level access controls, usage-limit enforcement, and automated testing.

  1. Document Upload and Storage

    • Next.js
    • TypeScript
    • Cloudflare R2
    • PostgreSQL
    • Drizzle ORM

    Developed the document-handling flow around supplier invoice PDFs, connecting file upload functionality with application records and subsequent extraction processing.

    Cloudflare R2 provides object storage for invoice documents, while the application uses signed URLs for controlled document access during processing.

    The extraction workflow connects stored documents to their corresponding processing results, allowing invoice information to be retrieved and reviewed within the application.

    • Supplier PDF document handling.
    • Cloudflare R2 object storage.
    • Signed URL document access.
    • Invoice records and processing state.
    • Integration between uploaded documents and extraction workflows.
  2. Multi-Provider AI Extraction

    • TypeScript
    • Gemini API
    • OpenAI API
    • Zod

    Implemented AI extraction using Gemini and OpenAI through a provider-independent integration layer.

    The architecture separates model-specific API communication from the rest of the invoice-processing application.

    Both providers operate behind a consistent extraction contract, reducing the need for downstream application logic to depend on one model's response format.

    The extraction process focuses on converting supplier invoice information, including line items, into structured data that can be validated and presented for review.

    • Gemini API integration.
    • OpenAI API integration.
    • Provider-independent model adapters.
    • Shared structured extraction contract.
    • Supplier invoice information extraction.
    • Invoice line-item processing.
  3. Structured Output Validation and Financial Reconciliation

    • TypeScript
    • Zod
    • Gemini API
    • OpenAI API

    AI models can produce results that appear plausible while containing missing fields, unexpected data types, or incorrect calculations.

    Implemented Zod validation to check extracted responses against expected application structures before accepting them as valid data.

    Added financial reconciliation checks to identify inconsistencies between invoice values, including arithmetic mismatches involving line items and totals.

    The extraction process also accounts for potential problems such as duplicated information and incorrectly aligned values.

    These checks help distinguish a successfully generated model response from an extraction result that is sufficiently consistent for further processing.

    • Zod schema validation.
    • Validation of AI-generated structured responses.
    • Invoice line-item checks.
    • Arithmetic reconciliation.
    • Detection of inconsistent totals.
    • Checks for duplicate or misaligned extraction results.
    • Identification of values requiring human review.
  4. OCR-Backed Source Verification

    • Next.js
    • React
    • TypeScript
    • OCR

    Developed functionality for connecting extracted invoice information back to the original PDF.

    The review experience presents structured extraction results alongside the source document, giving users the context needed to compare values.

    OCR-backed source references support highlighting relevant areas of the document, helping users locate the information associated with extracted fields.

    This approach acknowledges that even structurally valid AI output can contain incorrect values and therefore benefits from independent human verification.

    • Source PDF review.
    • Extracted data presented alongside the document.
    • OCR-backed source references.
    • Source highlighting.
    • Human verification of extracted fields.
    • Review of flagged financial inconsistencies.
  5. Database Architecture and Tenant Isolation

    • PostgreSQL
    • Drizzle ORM
    • Better Auth
    • TypeScript

    Used PostgreSQL and Drizzle ORM to model and manage the application's persistent data.

    The data layer supports invoice documents, extraction information, and account-related records.

    Integrated Better Auth for authentication and implemented tenant-level access checks to control access to application resources.

    These controls are important because invoice documents may contain sensitive business information, and one account must not be able to retrieve another account's records through an improperly scoped request.

    • PostgreSQL data persistence.
    • Drizzle ORM schemas and queries.
    • Better Auth integration.
    • Tenant-level access checks.
    • Account-scoped invoice operations.
    • Separation of user and organization data contexts.
  6. Concurrent Usage Limits

    • TypeScript
    • PostgreSQL
    • Drizzle ORM

    Implemented server-side trial quota enforcement for invoice-processing operations.

    A particular challenge involves concurrent uploads, where multiple requests may attempt to consume the same remaining trial allowance.

    Used transaction-safe database operations to enforce usage limits consistently rather than relying on frontend checks or independently evaluated requests.

    This helps prevent concurrent operations from bypassing the intended allowance.

    • Server-side usage enforcement.
    • Trial quota tracking.
    • Transaction-safe database operations.
    • Concurrent upload protection.
    • Validation of remaining processing allowances.
  7. Background Processing and Failure Handling

    • TypeScript
    • Cloudflare R2
    • Gemini API
    • OpenAI API
    • PostgreSQL

    Worked on background processing for document extraction so the workflow could handle operations beyond a single immediate interface interaction.

    The processing pipeline connects document retrieval, AI extraction, structured validation, and result persistence.

    Implemented retry handling with exponential backoff for recoverable processing failures.

    The objective is to make document processing more resilient while keeping failures visible rather than treating every unsuccessful operation as a valid extraction result.

    • Background document processing.
    • Document retrieval from storage.
    • AI extraction workflow coordination.
    • Structured result validation.
    • Retry handling with exponential backoff.
    • Processing failure handling.
  8. Automated Workflow Testing

    • TypeScript
    • Next.js

    Implemented automated end-to-end tests covering the application's core invoice-processing journey.

    The coverage includes document upload, extraction, and review workflows.

    Testing focuses on the interaction between application features rather than evaluating the model integration only as an isolated API request.

    These checks support development and private testing of the application but do not establish production readiness or reliability under real-world usage.

    • End-to-end workflow testing.
    • Document upload coverage.
    • Extraction workflow coverage.
    • Review workflow coverage.
    • Verification of core application interactions.

Outcomes

What the work delivered.

ParseHQ remains a private, pre-launch application with development currently on hold. Its outcomes are engineering deliverables rather than measured business results or production adoption. The project demonstrates a full-stack approach to integrating language models into a document-processing product, with particular attention to structured validation, financial verification, data isolation, and reliable application behavior.

  1. Deliverable

    Multi-Provider AI Extraction Architecture

    Implemented a provider-independent AI integration layer supporting Gemini and OpenAI for structured supplier invoice extraction.

    Measured impact

    AI providers integrated
    2

    Gemini and OpenAI, accessed through a shared extraction interface.

    The architecture separates provider-specific API calls from the extraction contract used by the application.

  2. Deliverable

    Structured Invoice Extraction and Validation

    Developed a processing flow that extracts invoice information and line items, validates model-generated results with Zod, and checks financial values for inconsistencies.

    The validation process includes arithmetic reconciliation and checks for results that may require manual correction or review.

  3. Deliverable

    Source-Linked Document Review

    Implemented a review experience that presents extracted invoice data alongside the source PDF, supported by OCR-backed references and highlighting.

    The feature helps users compare extracted information with original documents rather than relying on AI-generated values without inspection.

  4. Deliverable

    Multi-Tenant Data Protection

    Implemented authentication and tenant-level access checks for invoice-related application data and operations.

    Better Auth, PostgreSQL, and Drizzle ORM support the application's account and data-access architecture.

  5. Deliverable

    Concurrency-Safe Trial Enforcement

    Built server-side usage-limit enforcement designed to prevent concurrent uploads from bypassing trial processing allowances.

    Transaction-safe database operations provide consistency when multiple processing requests attempt to consume a limited allowance.

  6. Deliverable

    Background Processing and Retry Handling

    Implemented background document-processing functionality with retry handling for recoverable extraction failures.

    The processing workflow connects document retrieval, AI extraction, structured validation, and persistence, with exponential-backoff retry behavior.

  7. Deliverable

    Automated Core Workflow Coverage

    Implemented automated end-to-end testing for document upload, extraction, and review functionality.

    The testing supports private development and verification of core application interactions. It is not presented as evidence of production deployment.

  8. Deliverable

    Independent Full-Stack AI Application

    Developed the foundations of an AI-powered invoice processing SaaS application, combining a Next.js frontend, PostgreSQL persistence, document storage, authentication, and multiple LLM integrations.

    The application has not been publicly launched or deployed for a paying client. No customer adoption, time savings, extraction accuracy, or revenue metrics are claimed.