Inventory & Supply Chain Management System (with AI Procurement Agents)

Inventory & Supply Chain Management System (with AI Procurement Agents)

WebMachine LearningAI Agent2026ReactTypeScriptViteReduxTailwind CssNode.JsExpressMongoDBJSONAI AgentsGoogle Agent Development KitDocker

Client

Kiran Karki

Year

2026

Tech stack

React, TypeScript, Vite, Redux, Tailwind Css, Node.Js, Express, MongoDB, JSON, AI Agents, Google Agent Development Kit, Docker

About

MERN inventory & supply-chain platform with ROP/EOQ analytics, PO workflows and AI procurement agents.

The Problem

Small and mid-sized operations teams run inventory and procurement across spreadsheets and disconnected tools. Reorder points and order quantities are guessed or copied forward, so stock-outs and dead stock happen at the same time. Purchase orders live in email with no approval trail, no optimistic locking against double-approval, and no link back to what was actually delivered. Suppliers are chosen by habit rather than measured performance. And when the budget only covers part of what needs reordering, there's no principled way to decide what to fund first. There was also a research question underneath it: does a greedy urgency-first allocation actually beat a proportional split on realistic supply-chain data, and by how much?

What I Built

A single system that closes the whole loop. Inventory items carry demand history and recompute their own ROP/EOQ and stock status on every save, which in turn opens or clears the matching alert automatically. Procurement runs through a locked-down PO lifecycle with role-separated, optionally two-level approval and a transactional goods-receipt step that updates stock, resolves alerts, and re-scores the supplier in one atomic operation. Suppliers are ranked on four measured metrics and can be recommended per item. A budget allocator runs greedy and proportional strategies side by side on real low-stock items and saves every comparison to history - the dissertation's evidence base. On top of the REST API sit four Gemini agents that monitor, advise, analyse, and draft procurement, all going through the same RBAC every human request does. The whole thing seeds from a real 180k-row supply-chain dataset so demo data behaves like production data.

Key Features

Secure multi-role platform – JWT auth with short-lived access tokens + rotating refresh token (httpOnly cookie), bcrypt hashing, 4 server-enforced roles (Super Admin, Inventory Manager, Procurement Officer, Analyst), full audit log on every mutating request.

Live inventory core – Category/Item CRUD with automatic Reorder Point (simple + probabilistic) and Economic Order Quantity (Wilson formula) recalculation on every save; transactional stock movements; hourly recalculation cron; live dashboard.

Supplier management & scoring – Supplier catalogues (price/lead time per item), a four-metric performance score (on-time rate, delivery accuracy, lead-time reliability, price consistency), approve/suspend workflow, and greedy supplier recommendation per item.

Full purchase-order lifecycle – draft → submitted → approved/rejected → sent → shipped → partially/fully received → cancelled, with two-level approval above a configurable value threshold and optimistic locking on every transition.

Goods receipt (GRN) – under/over-delivery discrepancy detection with atomic stock update + alert resolution + supplier re-scoring in a single MongoDB transaction.

Alerts & notifications – low/critical/excess-stock alerts auto-synced on every item save, hourly overdue-PO cron, in-app notification bell.

Optimisation algorithms – Greedy (urgency-ranked) vs Proportional (water-filling) budget allocation run against real low-stock items, compared side by side and saved to history; client-side ROP/EOQ what-if calculator with a live 7×7 EOQ sensitivity heatmap.

Reporting suite – 7 analytics reports (stock turnover, stock-status breakdown, algorithm comparison, budget utilisation, supplier performance radar, PO pipeline, category spend), benchmarked to stay under 500 ms at 10k items.

AI agent layer – 4 Gemini-backed agents built on Google's Agent Development Kit (Monitoring, Advisory, Analytics, Procurement) that authenticate as service accounts and call the API over HTTP; the Procurement agent can draft/submit POs but is structurally incapable of approving them.

Real-data seeding – seeded from the DataCo Smart Supply Chain dataset (~180k order-line rows, 2015–2018): 5 categories, 50 real products, real 30-day demand histories, 8 suppliers, 14 POs across the lifecycle.

Docs & quality – Swagger/OpenAPI docs, ≥80% test coverage gate on backend services, Dockerised API + single-node MongoDB replica set + agents.

Project Details

A web-based Inventory & Supply Chain Management System built as a University of the West of Scotland MSc group project (SCQF Level 11) and used as the basis for a dissertation results chapter on allocation algorithms. It was delivered in two phases:

Phase 1 — secure platform and live inventory core (auth/RBAC, audit log, system settings, categories/items, ROP/EOQ, dashboard);

Phase 2 — the full supply-chain loop (suppliers, performance scoring, purchase orders, GRN, alerts, and greedy vs proportional budget allocation). A third layer adds autonomous AI agents that consume the same REST API a human client does.

The codebase is a monorepo: backend/ (Express/MongoDB API), frontend/ (React/Vite SPA), and agents/ (Google ADK service). The backend follows a strict layered pattern (routes → controllers → services → models) with pure, independently unit-tested algorithm modules and a shared response envelope + global error handler.

Screenshots

The Result

  • End-to-end working platform: 27 frontend routes, a fully documented REST API (Swagger), and a 4-agent AI service, all runnable with docker compose up + seed scripts.
  • Backend service layer held to ≥80% test coverage; 7 reporting endpoints benchmarked under 500 ms at 10k items.
  • Security separation proven structurally, not just by convention - e.g. the Procurement agent has no tool that can call /approve, and agent traffic is auth'd and audit-tagged like any other client.
  • Quantified greedy-vs-proportional allocation comparison on real DataCo demand data, feeding directly into the MSc dissertation results chapter.
  • Real-data seed (5 categories, 50 products, real demand windows, 8 suppliers, 14 POs across every lifecycle state) that makes the system demonstrable end-to-end in minutes.