Overview
+Vue 3 Frontend
+7 page views with Composition API, reactive global filters, custom SVG charts, and English/Japanese i18n. Runs on port 3000.
+FastAPI Backend
+REST API with 13 endpoints, server-side filtering, Pydantic validation, and auto-generated OpenAPI docs. Runs on port 8001.
+In-Memory Data
+7 JSON files loaded at startup — 40+ inventory SKUs, 100+ orders, forecasts, backlog, and spending data. No database.
+Tech Stack
+Frontend
+Backend
+System Architecture
+Data Flow
+User selects a filter in FilterBar.vue
+The global useFilters() composable holds singleton refs. Any view or component that calls it shares the same reactive state.
selectedLocation.value = "San Francisco"
+selectedCategory.value = "Sensors"
+selectedPeriod.value = "2025-09"
+selectedStatus.value = "Delivered"
+ Views watch filter changes and reload data
+Each view (Dashboard, Inventory, Orders, etc.) has a watcher that fires loadData() whenever any filter ref changes.
watch(
+ [selectedLocation, selectedCategory, selectedPeriod, selectedStatus],
+ () => loadData()
+)
+ api.js builds the HTTP request
+Filter values are mapped to API param names and appended to the URL. Values of 'all' are omitted from params so the backend skips that filter.
// GET /api/orders?warehouse=San+Francisco&category=Sensors&status=Delivered&month=2025-09
+const params = new URLSearchParams()
+if (filters.warehouse !== 'all') params.append('warehouse', filters.warehouse)
+if (filters.category !== 'all') params.append('category', filters.category)
+if (filters.status !== 'all') params.append('status', filters.status)
+if (filters.month !== 'all') params.append('month', filters.month)
+ FastAPI applies filters server-side
+apply_filters() handles warehouse/category/status. filter_by_month() handles the date dimension. Quarter strings like Q1-2025 are expanded to the three month strings.
filtered = apply_filters(orders, warehouse, category, status)
+filtered = filter_by_month(filtered, month) # "Q1-2025" → ["2025-01","2025-02","2025-03"]
+return filtered # Pydantic serialises to JSON
+ Filtered JSON is returned and rendered
+The Vue view receives the array, assigns it to a ref, and computed properties (totals, chart data, KPIs) auto-recalculate from the new data.
+orders.value = await api.getOrders(filters)
+// → computed totals, chart slices, status counts all update automatically
+ API Endpoints
+Data Models
+InventoryItem
+Order
+BacklogItem
+DemandForecast
+PurchaseOrder
+SpendingSummary
+Filter Matrix
+| Filter | +API Param | +Values | +Inventory | +Orders | +Dashboard | +Demand | +Backlog | +Spending | +
|---|---|---|---|---|---|---|---|---|
| Warehouse / Location | +warehouse |
+ all · San Francisco · London · Tokyo |
+ ✓ | +✓ | +✓ | +— | +— | +— | +
| Category | +category |
+ all · Circuit Boards · Sensors · Actuators · Controllers · Power Supplies |
+ ✓ | +✓ | +✓ | +— | +— | +— | +
| Order Status | +status |
+ all · Delivered · Shipped · Processing · Backordered |
+ — | +✓ | +✓ | +— | +— | +— | +
| Time Period | +month |
+ all · 2025-01…2025-12 · Q1-2025…Q4-2025 |
+ — | +✓ | +✓ | +— | +— | +— | +
Frontend Views
+Dashboard.vue
+Executive KPIs — inventory turnover, order fulfillment rate, fill rate, revenue. Order health donut chart, inventory value by category, monthly trend charts.
+Inventory.vue
+Full SKU table with search, warehouse filter, category filter, and stock status badges (Low Stock / Adequate / In Stock). Click-to-open detail modal.
+Orders.vue
+Order list with status summary cards, collapsible item rows, delivery dates, and total values. Supports all 4 filters including status and time period.
+Demand.vue
+Demand forecast table showing current vs forecasted demand per SKU, trend direction (increasing / stable / decreasing), and percentage change.
+Spending.vue
+Financial analytics with revenue/cost/profit metrics, monthly Revenue vs Cost bar chart, and cost breakdown by category (Procurement, Labor, Operational, Overhead).
+Reports.vue
+Quarterly performance reports (revenue, fulfillment rate) and monthly trend tables (order count, revenue, on-time delivery rate).
+Backlog.vue
+Unmet demand tracking by priority (High / Medium / Low), shortage quantities, days delayed, and purchase order creation for backlog items.
+