Skip to content

Frontend

rbnboe edited this page Oct 15, 2026 · 3 revisions

Frontend

The UI is a Next.js App Router application. Server-side routes proxy requests to the FastAPI backend; configure MES_BACKEND_URL and BACKEND_INTERNAL_URL for the deployment environment.

Pages

Route Function
/ Redirects to /dashboard.
/dashboard Combined production and delivery overview, worker/source status, active and waiting orders.
/production-orders Production order list, manual order entry, detail, and run review.
/delivery-orders Delivery order list, manual order entry, detail, and run review.
/inventory Live PLC stock snapshot from GET /plc-storage/.
/analytics Historical run view with date and order type filters.
/settings PLC node names and polling interval from GET/PUT /settings/.

Order entry uses the catalog and available capacity supplied by /orders/input-context. It can explicitly request catalog refresh before submission. A successful 202 means the order has been persisted, not that the PLC has started it. The run detail and dashboard show execution state and offer manual review when a run needs an operator decision.

Backend proxy routes

  • /api/mes/[...path] forwards order and shared order operations to MES_BACKEND_URL (fallback http://127.0.0.1:8000).
  • /api/[...path] and /api/analytics forward settings, storage, PLC storage, and analytics requests to BACKEND_INTERNAL_URL (fallback http://localhost:8000). Production Compose configures the internal service URL.

The /inventory route reads live PLC data via /plc-storage; the legacy database-backed /storage API is not the inventory page's data source.

Development

cd frontend
npm ci
npm run dev

Use the scripts declared in frontend/package.json for available checks and browser tests. See Development and Tests.

Clone this wiki locally