Green's Compugadgets
Inventory system and AI data migration
Inventory, purchasing and sales system for a Cebu computer store, with Gemini invoice reading and a Peachtree migration pipeline.
- Role
- Freelance full-stack developer
- When
- Nov 2025
- Stack
- Next.js
- Fastify
- Supabase
- BullMQ
- Gemini API
- TypeScript
Real interface, recorded on sample data. Names and figures shown are fictional.
The problem
A computer store in Mandaue City ran on Peachtree accounting and paper supplier invoices. Moving to a modern system meant years of records and a pile of invoices nobody wanted to retype.
How it was built
- Inventory, purchase orders, receiving, sales invoices and payments, with owner, manager and encoder roles.
- Invoice uploads go to a BullMQ queue. A worker cleans the image, Gemini reads it into structured JSON, and zod validates it before a person reviews it.
- A three-way match compares the invoice, the purchase order and what was actually received.
- Peachtree imports: the parser detects headerless exports, Gemini maps source columns to fields with a confidence score, then deterministic cleaning, conflict resolution, a dry run and one atomic database commit with an audit PDF.
- Customer and vendor contact details are encrypted in Postgres with pgcrypto triggers.
- Every Gemini call goes through rate limiting, retries and a circuit breaker, with deterministic fallbacks.
UploadBullMQ
Invoice photos join a job queue
Clean
Rotate, grayscale and normalize the scan
ReadGemini vision
Vendor, totals and line items as JSON
Validatezod
Schema check and per-field confidence
Match
Invoice against PO and what arrived
Approve
Owner or manager posts it to stock
Where it landed
Delivered to the client alongside a public storefront at greenscompugadget.net.





