An Industry 4.0 MES-style operations console for SMT/PCB assembly plants β real-time line status, machine health, work order tracking, and full DMC-level board traceability, styled after Bosch Nexeed, Siemens Opcenter, and Palantir Foundry-class operations consoles.
Live, ticking factory floor β line cards, machine tiles, OEE/throughput, and the alert feed all update in real time via a Zustand simulation loop.
FactoryFlow models a 3-line SMT (Surface-Mount Technology) assembly plant β Printer β SPI β Placement β Reflow β AOI β and gives plant managers, supervisors, and quality engineers a single pane of glass across plant-wide KPIs, live factory floor status, PCB traceability, warehouse management, and quality/defect tracking.
The domain model β DMC codes, SPI inspection pins (height/volume/area), and defect taxonomy β is grounded in a real Bosch SMT Solder Paste Inspection (SPI) tool, so the data shapes and workflows reflect an actual production line rather than a generic CRUD demo.
All 8 modules below are fully built and run on typed mock data (
src/lib/mock-data/) β clone and run with no database setup. The Prisma schema documents the live-data path; see Roadmap.
| Module | Route | Description |
|---|---|---|
| Executive Dashboard | / |
Plant-wide KPIs β OEE, throughput, yield, WIP, rework, X-Out β with animated tiles and trend charts |
| Factory Command Center | /command-center |
Per-line cards with machine tiles, live alert feed, and activity timeline, driven by a Zustand live-simulation loop |
| PCB Traceability | /traceability |
DMC/serial/batch search with full production history timeline and SPI/AOI inspection results |
| WIP Monitoring | /wip |
Live work-in-progress table β current station, aging time, bottleneck and hold flags |
| Rack & Bin Management | /racks |
Warehouse rack/bin occupancy with board-to-bin location lookup |
| X-Out Tracking | /xout |
X-Out board list with reason codes, defect location, and disposition (scrap/rework) breakdown |
| Production Analytics | /analytics |
OEE breakdown (availability/performance/quality), throughput, yield, and downtime trend charts |
| Alert Center | /alerts |
Unified feed of critical/warning/info alerts across the plant |
FactoryFlow is a Next.js App Router application. The current build ships as a frontend-only system running on typed mock fixtures; the Prisma schema and API design document the production architecture the UI is built to slot into without structural changes.
Browser
ββ Next.js App Router UI βββΊ Component library (dashboard / command-center / layout / ui)
β β β
β βββββββββββΊ Zustand store ββββββ (live simulation: tick() every 3s)
β β
ββββββββββββββββΊ src/lib/mock-data ββ.mirrors.β src/lib/types.ts
β
(Phase 5+, planned)
βΌ
REST API β PostgreSQL (Prisma) β MQTT/WebSocket ingestion β AI Copilot
See docs/ARCHITECTURE.md for the full system diagram (Mermaid), docs/ERD.md for the database design, and docs/API_DESIGN.md for the planned REST contract.
| Layer | Choice |
|---|---|
| Framework | Next.js 16 (App Router, TypeScript, Turbopack) |
| UI | shadcn/ui (Base UI primitives), Tailwind CSS v4 |
| Animation | Framer Motion |
| Charts | Recharts |
| State | Zustand (live simulation layer) |
| Data layer | Prisma 7 schema (PostgreSQL) β current build runs on typed mock fixtures |
| Icons | lucide-react |
A single industrial dark theme drives every surface β near-black backgrounds, sharp 4β8px radii, and a 6-color status system used consistently across lines, machines, boards, and alerts:
| Status | Color | Meaning |
|---|---|---|
| Running | π’ #22C55E |
Normal operation |
| Completed | π΅ #3B82F6 |
Finished / shipped |
| Warning | π‘ #EAB308 |
Degraded, needs attention |
| Hold | π #F97316 |
Paused, awaiting action |
| Critical | π΄ #EF4444 |
Fault, halted |
| Offline | βͺ #6B7280 |
Not reporting |
| Executive Dashboard | Factory Command Center |
|---|---|
![]() |
![]() |
| PCB Traceability | WIP Monitoring |
|---|---|
![]() |
![]() |
Capture instructions: docs/screenshots/README.md
npm install
npm run devOpen http://localhost:3070.
No environment variables or database are required β the app runs entirely on typed mock data in src/lib/mock-data/. The Prisma schema in prisma/schema.prisma documents the production data model; see prisma/seed.ts for how the mock fixtures map to seed rows once a Postgres database is connected.
| Command | Description |
|---|---|
npm run dev |
Start the dev server on port 3070 |
npm run build |
Production build |
npm run start |
Start the production server |
npm run lint |
Run ESLint |
src/
βββ app/
β βββ (dashboard)/ # Sidebar + topbar shell, all 8 module pages
β β βββ page.tsx # Executive Dashboard
β β βββ command-center/ # Factory Command Center
β β βββ traceability/ # PCB Traceability
β β βββ wip/ racks/ xout/ analytics/ alerts/
β β βββ layout.tsx # AppSidebar + TopBar shell
β βββ globals.css # Industrial dark theme tokens
β βββ layout.tsx # Root layout, fonts
βββ components/
β βββ dashboard/ # KPI tiles, charts, line status strip
β βββ command-center/ # Line cards, machine tiles, live alert feed, activity timeline
β βββ layout/ # AppSidebar, TopBar, StatusBadge
β βββ ui/ # shadcn/ui primitives
βββ lib/
β βββ types.ts # Domain types mirroring the Prisma schema
β βββ design-tokens.ts # Status color system + helper mappers
β βββ mock-data/ # Typed fixtures (factories, lines, machines, boards, alerts, events, KPIs)
β βββ format-time.ts
β βββ nav.ts # Sidebar navigation config
βββ store/
βββ command-center-store.ts # Zustand live-simulation store
prisma/
βββ schema.prisma # Full PostgreSQL schema (17 models)
βββ seed.ts # Documented seed stub (mock fixtures β seed rows)
The Factory Command Center includes a lightweight client-side simulation (Zustand tick() on a 3s interval) that nudges line throughput and machine cycle times to give a "live floor" feel. This is a stand-in for the real-time WebSocket/MQTT ingestion layer planned for Phase 5 β see docs/ARCHITECTURE.md.
| Phase | Focus | Status |
|---|---|---|
| 1 β Core Platform | Project scaffold, design system, Prisma schema, mock data layer, Executive Dashboard, Command Center | β UI complete |
| 2 β PCB Traceability | DMC/serial/batch search, board history timeline, inspection grid | β UI complete |
| 3 β WIP & Rack/Bin Management | WIP table with aging/bottlenecks, rack/bin warehouse view | β UI complete |
| 4 β X-Out & Production Analytics | X-Out/rework workflow, OEE/defect/throughput analytics | β UI complete |
| 5 β Real-Time Monitoring | REST API routes for all modules, MQTT β API β WebSocket ingestion, Prisma + live Postgres, JWT auth & RBAC, Alert Center actions | π Planned |
| 6 β AI Manufacturing Copilot | Natural-language queries over KPIs/events/alerts/board history | π Planned |
All UI modules (Phases 1β4) run on typed mock data today. The REST API layer for these modules (see docs/API_DESIGN.md) is part of the Phase 5 backend rollout. See docs/ROADMAP.md for the full breakdown.
- Architecture β system design, folder structure, real-time architecture
- Entity-Relationship Diagram β full database schema
- API Design β REST contract for all 8 modules
- Roadmap β 6-phase delivery plan
MIT Β© 2026 Dharshan Sai S




