How zion999-cmd/forge-pulse works
This is a simulated industrial-equipment acquisition and operations dashboard, presented as a complete Modbus-to-UI demo. Its principal flow is simulated Modbus devices → collector polling and HTTP ingest → idempotent event storage and rule-based derivation → business/operations APIs → live provider and shared dashboard state → overview, equipment detail, history, and diagnostics. The repository also contains configuration workbench, business facts, integrations, and replay capabilities. Edges are limited to README-documented flow or relationships visible in provided excerpts and the source index; unsampled internals are not inferred.
Main entry points: engine.ts Replay engine · server.ts REST and SSE API · service.ts Ingest service · store.ts Shared state store
Components 31
Acquisition
- Modbus simulator
server/src/modbus/sim/index.ts - Modbus collector
server/src/modbus/collector/collector.ts
Backend data
- Ingest endpoint
server/src/api/ingest.ts - Ingest service
server/src/ingest/service.ts - Event repository
server/src/db/repository.ts - Database adapter
server/src/db/database.ts - REST and SSE API
server/src/api/server.ts - Structured logging
server/src/observability/logger.ts - Runtime metrics
server/src/observability/metrics.ts
Business and replay
- Business API
server/src/api/business.ts - Fact services
server/src/integrations/service.ts - Fact repository
server/src/business/factRepository.ts - Replay engine
server/src/replay/engine.ts - Replay repository
server/src/replay/repository.ts
Dashboard
- Live API client
src/services/liveApi.ts - Live provider
src/providers/LiveEquipmentProvider.ts - Provider factory
src/providers/index.ts - Shared state store
src/app/store.ts - Dashboard pages
src/pages/Overview/index.tsx - History analysis
src/pages/History/index.tsx - Diagnostics
src/pages/Diagnostics/index.tsx - Config workbench
src/pages/ConfigWorkbench/index.tsx - Business panels
src/components/business/BusinessPanels.tsx
Domain logic
- Rule engine
server/src/domain/engine.ts - Event derivation
src/models/derive.ts - UI event derivation
src/models/derive.ts - History queries
src/models/query.ts - Process compiler
src/models/process/compiler.ts - Operations context
src/models/operations/context.ts - Event contract
src/models/contract.ts
Other components
- Operator
Connections 34
- Operator → Dashboard pages: views
README.md - Modbus simulator → Modbus collector: serves Modbus
README.md - Modbus collector → Ingest endpoint: posts events
README.md - Ingest endpoint → Ingest service: hands off
server/src/api/ingest.ts - Ingest service → Event repository: writes events
server/src/ingest/service.ts - Ingest service → Rule engine: requests derivation
server/src/ingest/service.ts - Rule engine → Event derivation: computes runtime
server/src/domain/engine.ts - Event repository → Database adapter: executes queries
server/src/db/repository.ts - REST and SSE API → Ingest endpoint: registers route
server/src/api/server.ts - REST and SSE API → Event repository: reads data
server/src/api/server.ts - REST and SSE API → Rule engine: recomputes runtime
server/src/api/server.ts - REST and SSE API → Replay engine: dispatches replay
server/src/api/server.ts - Business API → Fact services: serves business actions
- Fact services → Fact repository: persists facts
server/src/integrations/service.ts - Replay engine → Event repository: loads events
server/src/replay/engine.ts - Replay engine → Rule engine: recomputes rules
server/src/replay/engine.ts - Replay engine → Replay repository: records reports
server/src/replay/engine.ts - Provider factory → Live provider: selects provider
src/providers/index.ts - Live provider → Live API client: requests live data
src/providers/LiveEquipmentProvider.ts - Shared state store → Provider factory: creates provider
src/app/store.ts - Shared state store → UI event derivation: derives state
- Dashboard pages → Shared state store: reads state
src/pages/Overview/index.tsx - History analysis → Shared state store: reads state
src/pages/History/index.tsx - History analysis → History queries: filters records
src/models/query.ts - Diagnostics → Shared state store: reads state
src/pages/Diagnostics/index.tsx - Config workbench → Live API client: requests configuration
src/pages/ConfigWorkbench/index.tsx - Business panels → Live API client: requests business data
src/components/business/BusinessPanels.tsx - Process compiler → Operations context: compiles process model
- Operations context → Fact repository: uses canonical facts
src/models/operations/context.ts - Ingest service → Runtime metrics: records metrics
server/src/ingest/service.ts - Ingest service → Event contract: normalizes events
server/src/ingest/service.ts - REST and SSE API → Structured logging: logs requests
server/src/api/server.ts - Replay engine → Runtime metrics: records metrics
server/src/replay/engine.ts - Replay engine → Structured logging: logs replay
server/src/replay/engine.ts