A Laravel API that turns Ismail Industries' raw SQL Server sales, stock, production and forecasting data into structured analytics endpoints — consumed directly, or through a companion MCP server that exposes the same data as tools inside Claude.
Read-only views (llm.VW_PRIMARY_SALE, VW_SECONDARY_SALE, VW_PRIMARY_STOCK, VW_PRODUCTION, and more) hold the source data.
Laravel services and traits query, validate, cache and shape the data for each domain — sales, stock, production, forecasting, executive summaries.
Results are served as JSON over /api/analytics/* endpoints, keyed by an API key.
A companion Node server exposes these same endpoints as tools inside Claude, gated behind an OAuth login for approved users.
| Endpoint | Purpose |
|---|---|
/api/analytics/executive-query | Executive summary across sales, stock & production |
/api/analytics/forecast-query | Demand & sales forecasting |
/api/analytics/integrated-query | Cross-domain risk view |
/api/analytics/customer-hierarchy-query | Customer & distributor hierarchy |
/api/analytics/production-query | Production analytics |
/api/analytics/stock-query | Primary stock analytics |
/api/analytics/secondary-stock-query | Secondary (distributor) stock analytics |
/api/analytics/secondary-sale-query | Secondary sale analytics |
/api/analytics/shipment-query | Shipment analytics |
/api/analytics/query | General analytics query |
Analytics endpoints are intended to be accessed via the MCP server or another authenticated backend client — not directly from the browser.