Camilo Castro
All workCase 05 / 05

Inventario Materia Prima Client system

Raw-material inventory for a bread factory

Real-time stock across the factory's warehouses: purchase entries with VAT per line, validated exits, physical counts, voiding with automatic reversal, a full audit trail and branded Excel and PDF reports.

  • Two units per product — how it's bought and how it's counted — with conversion factors, plus weight-based items deducted by the kilo.
  • Five roles from admin to read-only viewer; admin fixes to past counts apply as deltas so later movements stay intact.
  • Warehouses are data: admins create them from the UI, each with its own color palette and per-user access.
Client
Industria Bizcopan Zapatoca — bakery and pastry warehouses
Role
Sole developer
Year
2026 In production
Stack
  • Next.js 14
  • React 18
  • TypeScript
  • Drizzle ORM
  • Turso (libSQL)
  • JWT (jose)
  • CSS Modules
  • jsPDF
  • xlsx-js-style
Current-stock screen for the bakery warehouse: totals by state and a table of products with stock, minimum, difference and status.
Purchase-entry dialog in detailed mode: invoice number, supplier and product lines with quantity, unit and VAT.

The brief

Flour, butter, packaging and everything in between live in two warehouses — bakery and pastry. Entries arrive with supplier invoices; exits go to production, packaging or the point of sale.

The system had to be quick to operate on a tablet, strict about stock, and transparent about every correction.

What I built

  • Current stock with Normal / Low / Critical states and per-product history
  • Purchase entries with mandatory invoice number, VAT per line and an edit audit
  • Exits validated against available stock before they're saved
  • Adjustment batches from physical counts: system → physical → difference
  • Report catalog with quick periods and Excel/PDF exports with the company letterhead
  • Printable blank count sheets and exit forms for manual capture

Under the hood

  1. Voiding is a movement, not a delete

    Canceling an entry or an exit writes its reversal and restores stock, so history stays complete.

  2. Corrections as deltas

    Fixing a mistyped physical count applies the difference and syncs its movement instead of overwriting the stock, so later entries and exits survive.

  3. SQLite in development, Turso in production

    One Drizzle schema: a local file while building, libSQL at the edge in production.

  4. Seeded with the real catalog

    168 real raw materials were loaded at setup, so the team started from their own product list, not an empty screen.

Gallery

Where it stands

Deployed on Vercel with Turso and documented in a user manual for the warehouse team. Version 2 added warehouses created from the UI and per-user access.

Screens come from the system's user manual, captured with demo data.