How hugofurther/cabane-control works
Cabane Control provides browser-based monitoring and remote operation for a maple-syrup pumping system, alongside physical controls and networked station controllers. The main workflow is an operator signing in, viewing live station and alarm state, then handing off control and changing switches; the backend coordinates commands and status over UDP and streams updates to the browser. Separate capabilities include administration, messaging and notes, weather, drainage/shutdown automation, and isolated simulation. The README documents hardware behavior and capabilities not fully represented in the sampled source; those links are shown only where the tree or excerpts support them.
Main entry points: server.js HTTP and socket server · routes.js API route registry · simulation_service.js Isolated station simulator · db.js SQLite database
Components 24
Web Interface
- Control dashboard
Code/Server/frontend/cabane-ui/src/App.jsx - Live state context
Code/Server/frontend/cabane-ui/src/contexts/SocketContext.jsx - Station controls
Code/Server/frontend/cabane-ui/src/components/StationCard.jsx - Sign-in UI
Code/Server/frontend/cabane-ui/src/components/AuthPage.jsx
Backend Services
- HTTP and socket server
Code/Server/cabane-control/server.js - API route registry
Code/Server/cabane-control/routes.js - Email delivery
Code/Server/cabane-control/services/email_service.js - SQLite database
Code/Server/cabane-control/db.js
Accounts & Collaboration
- Authentication routes
Code/Server/cabane-control/routes_split/auth.js - Token authorization
Code/Server/cabane-control/middleware/auth.js - Messaging routes
Code/Server/cabane-control/routes_split/messaging.js - Notes routes
Code/Server/cabane-control/routes_split/notes.js - Administration routes
Code/Server/cabane-control/routes_split/admin.js
Station Control
- Control and failsafe logic
Code/Server/cabane-control/services/logic_engine.js - UDP controller bridge
Code/Server/cabane-control/services/udp_service.js
Operations
- Drainage automation
Code/Server/cabane-control/services/automation_service.js - Automation routes
Code/Server/cabane-control/routes_split/automation.js - Isolated station simulator
Code/Server/cabane-control/services/simulation_service.js - Simulation routes
Code/Server/cabane-control/routes_split/simulation.js - Weather service
Code/Server/cabane-control/services/weather_service.js
Other components
- Farm operator
- Browser client
- Physical controllers
- Weather provider
Connections 36
- Farm operator → Browser client: operates
- Browser client → Control dashboard: uses
- Control dashboard → Sign-in UI: presents sign-in
- Control dashboard → Station controls: presents controls
- Control dashboard → Live state context: uses live state
- Live state context → HTTP and socket server: HTTP and Socket.IO
- HTTP and socket server → API route registry: mounts API
- HTTP and socket server → Control and failsafe logic: initializes
- HTTP and socket server → UDP controller bridge: initializes
- HTTP and socket server → Weather service: initializes
- HTTP and socket server → Isolated station simulator: initializes
- API route registry → Authentication routes: dispatches
- API route registry → Messaging routes: dispatches
- API route registry → Notes routes: dispatches
- API route registry → Administration routes: dispatches
- API route registry → Automation routes: dispatches
- API route registry → Simulation routes: dispatches
- Authentication routes → Token authorization: checks tokens
- Authentication routes → SQLite database: reads and writes
- Authentication routes → Email delivery: sends verification
- Messaging routes → SQLite database: reads and writes
- Notes routes → SQLite database: reads and writes
- Administration routes → SQLite database: reads and writes
- Control and failsafe logic → UDP controller bridge: sends commands
- UDP controller bridge → Physical controllers: UDP packets
- Physical controllers → UDP controller bridge: feedback packets
- Control and failsafe logic → HTTP and socket server: emits state
- Automation routes → Drainage automation: dispatches
- Drainage automation → Control and failsafe logic: toggles real switches
- Drainage automation → Isolated station simulator: toggles simulated switches
- Simulation routes → Isolated station simulator: dispatches
- Isolated station simulator → SQLite database: stores configuration
- Isolated station simulator → HTTP and socket server: emits simulation status
- Weather service → Weather provider: fetches weather
- Weather service → HTTP and socket server: emits weather updates
- HTTP and socket server → Browser client: streams state