Architecture
FacilFlow system architecture overview.
Platform Context
System Components
Frontend (React 19 SPA)
| Component | Purpose |
|---|---|
| Pipeline Builder | Visual pipeline design with React Flow |
| Agent Manager | Edge agent monitoring and control |
| Data Explorer | SQL queries and time-series visualization |
| Jarvis Chat | AI assistant with SSE streaming and artifact rendering |
| Canvas Panel | Side panel for displaying generated artifacts |
| Auth System | Firebase login with RBAC |
Technology Stack:
- React 19 + TypeScript
- TailwindCSS + shadcn/ui
- React Flow (@xyflow/react)
- Zustand state management
- Socket.IO client for real-time updates
Backend (Node.js + TypeScript)
| Component | Purpose |
|---|---|
| REST API | Express.js endpoints for CRUD operations |
| Socket.IO Server | Real-time pipeline/agent status updates |
| Claude Code CLI | AI assistant via CLI spawn with OAuth |
| SSE Streaming | Server-Sent Events for real-time responses |
| Auth Middleware | Firebase JWT validation |
| RBAC Middleware | Role-based permission checks |
Services:
- PipelineService — Pipeline CRUD and execution
- AgentService — Edge agent management
- ClaudeService — AI assistant via Claude Code CLI spawn
- ChatService — Conversation history
- DataSourceService — Connector management
Data Layer
| Store | Purpose |
|---|---|
| PostgreSQL | Pipelines, agents, chat history (Drizzle ORM) |
| InfluxDB 3 | Time-series data with Arrow Flight SQL |
MCP Tools:
pipeline_tools— List, create, start, stop, delete pipelinesquery_tools— Explore catalog, query data