diff --git a/architecture.html b/architecture.html new file mode 100644 index 000000000..336c4d6ad --- /dev/null +++ b/architecture.html @@ -0,0 +1,621 @@ + + +
+ + +Full-stack demo application with Vue 3 frontend, Python FastAPI backend, and in-memory mock data. No database — all data lives in JSON files loaded at server startup.
+useFilters.js:loadData(), which calls getCurrentFilters() to build a params object.URLSearchParams, omitting any filter set to 'all'. Sends GET /api/orders?warehouse=Tokyo&month=2025-09.apply_filters() runs sequential list comprehensions on in-memory data. Then filter_by_month() does substring match on order_date.| Filter | Ref | Maps to param | Supported by | +
|---|---|---|---|
| Time Period | selectedPeriod | month (or Q1-2025) | Orders, Dashboard |
| Location | selectedLocation | warehouse | All endpoints |
| Category | selectedCategory | category | All endpoints |
| Order Status | selectedStatus | status | Orders, Dashboard |
has_purchase_order flag
+ Promise.all.InventoryDetailModal.App.vue, affects all views simultaneously.selectedPeriod, selectedLocation, selectedCategory, selectedStatus, getCurrentFilters(), and resetFilters().localStorage. t('key.nested') traverses nested objects with dot notation, falls back to English. Auto-switches currency: USD (EN) ↔ JPY at hardcoded rate of 150.ja. logout() shows an alert only.useFilters and useI18n are declared at module scope, outside the exported function. Every component that imports the composable shares the exact same ref objects — no Vuex or Pinia needed.apply_filters() (sequential list comprehensions) and filter_by_month() (substring match on order_date).ref() and expose all derived values (totals, grouped data, chart points) as computed() properties. This keeps re-renders minimal — Vue only recalculates what the template actually uses./api/backlog always returns all items. The view first fetches filtered inventory, builds a Set of SKUs, then keeps only backlog items whose item_sku appears in that set — warehouse/category filtering happens implicitly.selectedPeriod is Q1-2025 through Q4-2025, filter_by_month() maps the quarter to its 3 month strings via QUARTER_MAP and checks any(m in order_date …), allowing filtering by full quarters./api/reports/quarterly and /api/reports/monthly-trends have no stored data — they scan the entire unfiltered orders list on every request and aggregate dynamically, so they always reflect the live data file.GET/POST/DELETE/PATCH /api/tasks — called by App.vue for the TasksModal (add, delete, toggle tasks). No handler exists in main.py. Calls return 404.POST /api/purchase-orders and GET /api/purchase-orders/{id} — called by Dashboard "Create PO" / "View PO" buttons. Not defined in main.py. purchase_orders.json exists but is empty [].Dashboard.vue template but no corresponding file exists in src/components/. Will throw a Vue runtime warning.| Order # | +Items | +Total Cost | +Budget | +Submitted | +Expected Delivery | +Status | +
|---|---|---|---|---|---|---|
| {{ order.order_number }} | +{{ order.items.length }} items | +{{ formatCurrency(order.total_cost) }} | +{{ formatCurrency(order.budget) }} | +{{ formatDate(order.submitted_date) }} | ++ {{ formatDate(order.expected_delivery) }} + 7-day lead + | ++ Submitted + | +
Set a budget and get recommendations for which items to restock based on demand growth.
+| # | +SKU | +Item Name | +Current Demand | +Forecasted Demand | +Growth % | +Qty to Restock | +Unit Cost | +Total Cost | +Status | +
|---|---|---|---|---|---|---|---|---|---|
| {{ index + 1 }} | +{{ item.sku }} | +{{ item.name }} | +{{ item.current_demand.toLocaleString() }} | +{{ item.forecasted_demand.toLocaleString() }} | ++ +{{ item.growth_pct.toFixed(1) }}% + | +{{ item.restock_qty.toLocaleString() }} | +{{ formatCurrency(item.unit_cost) }} | +{{ formatCurrency(item.item_total_cost) }} | +
+
+
+
+
+
+ Selected
+ Over budget
+
+ |
+