Inspiration

As a freelancer and developer, I've always found invoicing to be the most annoying part of getting paid. You know what you did, who you did it for, and how much it costs why should you have to fill out a form to capture that?

I wanted to build something where you just describe the work and the invoice writes itself.

What It Does

InvoiceAI lets you type a plain English description like:

"50 hours of mobile app development at $80/hr for TechLagos Ltd, 7.5% VAT, payment due in 30 days"

And instantly get:

  • A fully formatted invoice with correct line items, tax, and totals
  • A professional PDF download
  • A real Paystack payment link to send to your client
  • The invoice automatically saved to AWS DynamoDB

How I Built It

UI — Vercel v0** I scaffolded the entire UI with a single v0 prompt. It generated a production-ready Next.js split panel layout AI input and form on the left, live invoice preview on the right. This saved hours of UI work.

AI — Groq (Llama 3.3 70B)** The natural language parsing runs on Groq's inference API. I send the user's description to Llama 3.3 70B with a structured prompt that extracts client name, email, line items, quantities, rates, tax rate, and notes as JSON.

Database — AWS DynamoDB Invoices are independent records, accessed by ID, with no complex joins or relational queries. That access pattern is exactly what DynamoDB is built for: single digit millisecond reads at scale, no schema migrations as the invoice shape evolves, and zero database servers to manage. A relational DB would have been overkill for what’s fundamentally a key-value lookup. Every generated invoice is saved on PDF download using the AWS SDK v3 from Next.js server actions.

Payments — Paystack** One click generates a real Paystack checkout URL. The invoice amount is passed directly to the Paystack API and the user gets a shareable payment link.

Deployment — Vercel** The entire app is deployed on Vercel with automatic deployments on every git push.

Blockchain Anchoring — Casper Network Invoices can be fraudulent, edited after the fact, or disputed between client and freelancer. To give each invoice a tamper-proof record, I hash the core invoice data (client, line items, tax, due date) with SHA-256, then anchor that hash on the Casper testnet as a self-transfer deploy with the hash embedded as a memo. Once anchored, anyone can verify the invoice hasn’t been altered by re hashing the data and comparing it to the on chain record no third party required. This was deliberately built as a verification layer, not a payment rail: Paystack handles the actual money movement, Casper just proves the invoice existed in this exact form at this exact time.

Challenges

  • Tailwind v4 uses oklch() colors which html2canvas couldn't parse for PDF generation. I solved this by switching to pure jsPDF text/drawing commands instead of DOM capture.
  • Groq returns inconsistent JSON key formats (snake_case vs camelCase). I added a normalization layer that handles all variants before Zod validation.
  • Network connectivity issues on my local machine blocked SSL to some API endpoints. I worked around this by moving API calls to the appropriate client/server boundaries.

**Casper’s testnet RPC was occasionally unreachable from my network, so I built a fallback that still returns the signed deploy hash locally even if broadcast fails, rather than silently dropping the anchoring feature.

What I Learned

  • Vercel v0 is genuinely powerful for scaffolding one prompt saved hours of UI work
  • AWS DynamoDB + Vercel server actions is a clean, zero-config full-stack pattern
  • jsPDF programmatic generation is more reliable than DOM-to-image for modern CSS

What's Next

  • Invoice history dashboard (retrieve past invoices from DynamoDB)
  • Multi-currency support
  • Email invoice directly to client
  • Custom sender branding

Built With

nextjs vercel aws-dynamodb groq llama paystack jspdf typescript tailwindcss casper blockchain

Built With

Share this project:

Updates