How sun7485/union-steel works
UNION OS is a factory operating system for project-based steel fabrication. Office users prepare and plan work, manage production and materials, and review quality and performance; floor supervisors and QC record execution in an offline-first app. Those interactions go through the API, which is the documented single write path, to tenant-isolated Postgres/PGlite storage. The graph also preserves imports, background processing, and UNION AI/MCP capabilities. API-to-domain wiring is summarized at the documented subsystem level; sampled excerpts do not establish individual route-to-engine calls.
Main entry points: index.ts API service · src/App.tsx Office workspace · src/App.tsx Floor app · queue.ts Offline event queue
Components 23
User applications
- Office workspace
apps/office/src/App.tsx - Office API client
apps/office/src/lib/api.ts - Floor app
apps/floor/src/App.tsx - Offline event queue
apps/floor/src/lib/queue.ts - Local queue storage
apps/floor/src/lib/idb.ts - Floor API client
apps/floor/src/lib/api.ts
API and processing
- API service
services/api/src/index.ts - Domain endpoints
services/api/src/routes - Background jobs
services/worker/src/index.ts
Factory domain
- Domain logic
packages/core/src - Import processing
packages/core/src/importing.ts - Planning and readiness
packages/core/src/schedule.ts - Production tracking
packages/core/src/floor.ts - Materials and quality
packages/core/src/material.ts - Insights and performance
packages/core/src/forecast.ts
Persistence
- Database client
packages/db/src/client.ts - Tenant data
packages/db/src/schema/index.ts
AI access
- Office AI interface
apps/office/src/screens/UnionAi.tsx - AI tools and routing
packages/ai/src/service.ts - MCP server
services/api/src/mcp/server.ts
Other components
- Office staff
- Floor staff
- MCP client
Connections 22
- Office staff → Office workspace: use
- Floor staff → Floor app: use
- Office workspace → Office API client: requests
- Office API client → API service: calls API
- Floor app → Floor API client: requests
- Floor app → Offline event queue: queues events
- Offline event queue → Local queue storage: persists
- Offline event queue → Floor API client: syncs events
- Floor API client → API service: calls API
- API service → Domain endpoints: dispatches
- Domain endpoints → Domain logic: uses domain logic
- API service → Database client: queries
- Database client → Tenant data: uses schema
- Background jobs → API service: background processing
- Import processing → Domain logic: domain operations
- Office workspace → Office AI interface: opens
- Office AI interface → Office API client: requests AI
- Domain endpoints → AI tools and routing: serves AI tools
- AI tools and routing → Domain logic: uses engines
- MCP client → MCP server: asks tools
- MCP server → AI tools and routing: executes tools
- MCP server → API service: calls endpoints