
The problem Direct-material buying in plants (kraft paper, adhesives, inks, cartons) is slow and error-prone. Buyers chase quotes over phone and email, retype line items, HSN codes, GST and freight terms from PDFs into Excel, and often decide without checking what was paid last time. Worse, when a buyer reveals a budget, suppliers quote just under it (price anchoring). What I built Procura is a full-stack ERP where a plant manager types a request such as "Need 1,000 kg 250 GSM kraft paper and 500 kg brown paper by Friday, no budget". From there: - The request is parsed into a structured multi-item Bill of Materials. - Approved, active vendors are pulled from PostgreSQL by category. - Blind RFQ emails are drafted for human review, then sent via Resend. - Supplier replies arrive by webhook; quote PDFs are read with multimodal Gemini and stored as structured quotations. - Quotes are ranked by a 4-factor score (price, payment terms, on-time delivery, quality) and benchmarked against the Last Purchase Price. - The manager approves in one click, generating a Purchase Order and a signed, zero-login confirmation link for the supplier. Beyond the PO The system tracks a 6-stage lifecycle: PO issued, supplier confirmed, in transit (parsed from dispatch emails), 4-way Goods Receipt (ordered / received / damaged / accepted), QA inspection, and automatic closure when QA passes with zero balance. What I'm most proud of The guardrails. Missing budgets and deadlines stay NULL instead of being guessed. Unstated lead times are stored as NULL instead of a fabricated "7 days". The AI layer degrades gracefully: a multi-model Gemini fallback chain with timeouts, then a deterministic regex parser, so the pipeline never freezes.



