How saiteja9154/pharma-nexus works
Pharma Nexus is a pharmacy procurement ERP with an autonomous restocking and bargaining agent. Its principal workflow observes inventory, calculates demand and expiry-safe quantities, discovers and scores vendor offers, negotiates a price, validates the deal, then commits a purchase order and stock update. The graph preserves the UI’s inventory, vendor, agent, negotiation, and purchase-order views as well as the internal decision tools. The README documents the end-to-end stages; sampled source confirms selected calls and UI composition, but not every API route or internal agent transition.
Main entry points: App.jsx ERP App · store_agent.py Store Agent · main.py REST API · db.py SQLite ERP
Components 17
ERP Interface
- ERP App
frontend/src/App.jsx - Inventory View
frontend/src/pages/Inventory.jsx - Vendor Directory
frontend/src/pages/Vendors.jsx - Agent Control
frontend/src/pages/AgentControl.jsx - Negotiation View
frontend/src/pages/Negotiation.jsx - Purchase Orders
frontend/src/pages/PurchaseOrders.jsx
Backend API
- REST API
backend/main.py
Procurement Agent
- Store Agent
backend/agent/store_agent.py
Decision Tools
- Inventory Planning
backend/tools/inventory_tools.py - Vendor Catalog
backend/tools/vendor_tools.py - Deal Scoring
backend/tools/deal_scoring.py - Bargaining Engine
backend/tools/negotiation_tools.py - Deal Validator
backend/tools/validator.py - Order Execution
backend/tools/purchase_order_tools.py
ERP Data
- SQLite ERP
backend/database/db.py - Baseline Data
backend/database/seed.py
Other components
- Pharmacy Staff
Connections 20
- Pharmacy Staff → ERP App: uses
README.md - ERP App → Inventory View: renders
frontend/src/App.jsx - ERP App → Vendor Directory: renders
frontend/src/App.jsx - ERP App → Agent Control: renders
frontend/src/App.jsx - ERP App → Negotiation View: renders
frontend/src/App.jsx - ERP App → Purchase Orders: renders
frontend/src/App.jsx - ERP App → REST API: uses REST
README.md - REST API → Store Agent: starts procurement
README.md - REST API → Inventory Planning: routes inventory
backend/main.py - REST API → Vendor Catalog: routes vendors
backend/main.py - Store Agent → Inventory Planning: observes demand
backend/agent/store_agent.py - Store Agent → Vendor Catalog: finds offers
backend/agent/store_agent.py - Store Agent → Deal Scoring: ranks offers
backend/agent/store_agent.py - Store Agent → Bargaining Engine: negotiates deals
backend/agent/store_agent.py - Store Agent → Deal Validator: validates deal
backend/agent/store_agent.py - Store Agent → Order Execution: executes accepted
README.md - Inventory Planning → SQLite ERP: reads and updates
backend/tools/inventory_tools.py - Vendor Catalog → SQLite ERP: reads and updates
backend/tools/vendor_tools.py - Order Execution → SQLite ERP: commits order
README.md - Baseline Data → SQLite ERP: initializes data
backend/database/seed.py