A production-grade Enterprise Resource Planning system built entirely from scratch in CodeIgniter & MySQL — handling orders across three sales channels, real-time FIFO inventory, automated FedEx shipping, and natural language AI querying via Google Gemini.
Built entirely custom — no off-the-shelf ERP could handle the combination of e-commerce, pharmacy Rx orders, FIFO inventory allocation, and AI-powered querying this business needed.
Orders flow in from BigCommerce, Amazon SP-API, and EPRX Pharmacy — all unified into a single order lifecycle with dual-status tracking and Stripe payment gates.
A custom allocation engine using the FIFO method tracks inventory at the lot and bin level — with five real-time metrics, auto-backorder resolution, and PO-driven receiving.
Full fulfillment from picking list generation (allocation-aware, per warehouse/bin/lot) through multi-box packing to FedEx REST API label generation with OAuth.
Each sales channel has its own sync controller, but all orders converge into a single order management interface with shared inventory, fulfillment, and reporting.
Every order triggers an allocation against real warehouse stock — tracked at the lot and bin level, with automated backorder resolution when stock arrives from a PO.
From the moment an order is confirmed, the system guides warehouse staff through picking (allocation-aware, bin/lot specific), packing into boxes, and generating FedEx shipping labels — all without leaving the ERP.
Pick lists are generated per allocation record — each list specifies the exact warehouse, bin, and lot the item must be pulled from, matching the FIFO allocation that was created when the order was confirmed. Barcode scanning validates each pick.
Orders can be packed across multiple boxes — each box is tracked in bc_packing_boxes with item-level assignments in bc_packing_box_items. Box dimensions and weights feed directly into the FedEx shipment request.
Full OAuth 2.0 token management with automatic refresh. Shipment requests include all box dimensions, weights, and service types — returning tracking numbers and label URLs. Shipping API credentials stored per channel for multi-carrier future expansion.
Shipping API credentials are stored per channel in a dedicated table — supporting FedEx, USPS, OnTrac, and UPS. The architecture is ready for multi-carrier expansion without touching fulfillment logic.
A natural language query interface powered by Google Gemini and n8n lets anyone on the team ask the ERP questions directly — without writing SQL. The AI layer is embedded into the ERP frontend via a webhook.
No off-the-shelf plugins or third-party modules — every piece of functionality was designed, architected, and coded to fit the exact business workflow.
Cron-driven spawn engine generates recurring orders on schedule. Supports manual spawn, skip-date logic, per-subscription cancellation, and frequency overrides. Each subscription tracks its next billing date.
Rx orders with per-order-line pet and medication assignment. Rx status tracked per medication line with Case A/B bifurcation logic. Fax/email automation for vet prescriptions with rate-limiting guards.
PO creation and receiving with per-line warehouse, bin, lot, and expiry capture. Received stock triggers auto-allocation engine to resolve open backorders immediately. Full PO lifecycle with status tracking.
Full customer profiles synced from BigCommerce. Tracks order history, subscription status, payment methods, and addresses. Customer-level notes and communication logs for support workflows.
Supplier catalog with per-SKU pricing and lead times. Vendor catalog supports bulk product upload via Excel (SimpleXLSX). Ties purchasing, pricing, and receiving into a unified supplier view.
Role-based access control via MY_Controller.php. Full audit/change tracking on critical records. Operations dashboard with period selectors, trend badges, and Chart.js visualizations for orders, revenue, and inventory health.
Every tool in the stack was chosen for a reason — reliability, fit, and the ability to build fast without sacrificing correctness. Nothing was added for hype.
This ERP was built entirely custom to handle a complex, multi-channel, multi-module operation. If your business has outgrown generic tools — let's talk about what a purpose-built system could do for you.