Get in touchContact

All work

Work · Public project

PromptToInvoice

An invoicing app where a sentence about the work becomes an editable draft invoice, and every total is calculated in code rather than by the model.

Status
Open source · Nov 2026
Stack
  • Next.js 16 · React 19
  • Claude (Anthropic API)
  • PostgreSQL · Drizzle ORM
  • Better Auth
  • React-PDF · Resend
  • Vercel
Disclosure
Public project
Demo
Video
Play on YouTube1:09
PromptToInvoice: describe the work, send the invoice
Explainer: a sentence becomes a draft with the client, line items, currency and due date; totals are calculated in code; the invoice goes out with a PDF and a link the client can open; a logo and brand colour appear on every invoice; and the dashboard shows what is outstanding, overdue and paid.

Project videos load from YouTube only when you press play.

  • PromptToInvoice editor: a one-sentence description of the work above the draft Claude made from it, with the client, currency, dates, line items with tax, and the totals.
  • PromptToInvoice business profile settings: an uploaded logo, a brand colour picker and a live preview of the invoice.
  • PromptToInvoice dashboard: outstanding, overdue and paid-this-month totals, paid per month, unpaid invoices by age, recent invoices and top clients.
A draft written by Claude from one sentence, a business profile’s logo and colour with a live preview, and the dashboard.

What it is

PromptToInvoice is an invoicing web app for freelancers and small businesses. A user describes the work in a sentence and gets an editable draft invoice: the client matched or created, line items, currency, tax and due date.

Around the draft sits the rest of an invoicing tool. The editor shows live totals, tax per line, a tax subtotal for each percentage and reverse-charge notes. Invoices move from draft to sent, then to paid or void, with overdue derived from the due date. Each business profile numbers its own invoices, and every invoice has a server-rendered PDF, a secure page for the client that records views, and email delivery with the PDF attached.

A dashboard shows outstanding, overdue and paid-this-month totals per currency, in dollars, euros or pounds and never mixed, with paid revenue by month, unpaid invoices by age, top clients and a CSV export.

Process: what we built

Claude, through the Anthropic API with structured outputs and Claude Opus by default, extracts the fields from the sentence. Subtotals, discounts and tax are always calculated in code, in whole cents, never by the model. When no AI key is set or the API is unavailable, a built-in offline parser drafts the invoice instead.

On the Business plan an account can hold several business profiles, each with a logo resized in the browser, a brand colour, legal name, company number, website, tax ID, payment instructions, default notes and terms, and its own time zone. The servers run on UTC, so “today” is computed in the profile’s zone.

Plan limits for Starter, Professional, Business and Enterprise are enforced in code. It is built with Next.js 16 (App Router, React 19, Server Actions), TypeScript, Tailwind CSS 4, PostgreSQL through Drizzle ORM (Supabase in production, embedded PGlite locally), Better Auth, Zod, React-PDF and Resend, tested with Vitest and deployed on Vercel.

  1. 01Describe
    • A sentence about the work
  2. 02Extract
    • Claude: structured outputs
    • Offline parser as a fallback
  3. 03Calculate
    • Totals in code, in whole cents (where the system decides)
  4. 04Edit
    • Editable draft, live totals
  5. 05Send
    • PDF, client link and email
System schematic, drawn from the project’s facts. The outlined item is where the system decides.

Results and limits

Results

  • 24 unit tests cover the invoice arithmetic, the offline parser and the invite gate.
  • Deployed on Vercel with Supabase as an invite-only private preview.

Limits

  • Stripe billing is not built: plan changes are a demo switch for now.
  • Team seats, GDPR export and delete tools, and an audit log are not built.
  • Email delivery needs a Resend key and a verified domain; without them, emails are written to the server log.
  • There is one invoice template.

Building something like this for a client?

We can build it under your agency’s brand, for a fixed project fee.

Get in touch contact@neurosmith.co