How sharsdylow/calit2 works
This repository is a web interface for monitoring sensors and cameras and managing devices. The main workflow is navigating to a dashboard or feature page, loading device or camera data, and presenting it as location-based charts, camera streams, or device controls. Sensor search and device registration/deletion are separate feature branches. The source index and excerpts support the frontend call paths; the camera backend’s implementation was not excerpted, so its connection to the frontend stream request is unverified.
Main entry points: App.js App router · Dashboard.jsx Dashboard · DashBoardItem.jsx Dashboard items · SensorsGroup.jsx Sensor groups
Components 27
App navigation
- App router
frontend/src/App.js - Navigation bar
frontend/src/components/Navbar.jsx - Dashboard
frontend/src/pages/Dashboard.jsx - Location tabs
frontend/src/components/VerticalTabs.jsx - Dashboard items
frontend/src/components/DashBoardItem.jsx
Device management
- Device settings
frontend/src/pages/Setting.jsx - Register device
frontend/src/features/device/RegisterDevice.jsx - Delete device
frontend/src/features/device/DeleteDevice.jsx - Device state
frontend/src/features/device/deviceSlice.js - Device API client
frontend/src/features/device/deviceService.js
Sensor monitoring
- Sensor page
frontend/src/pages/Sensor.jsx - Sensor groups
frontend/src/features/sensors/SensorsGroup.jsx - Realtime chart
frontend/src/features/sensors/RealtimeSensorChart.jsx - Sensor visibility
frontend/src/features/sensors/SensorSwitch.jsx - Sensor state
frontend/src/features/sensors/sensorsSlice.js - Sensor data search
frontend/src/features/sensors/SensorDataSearch.jsx - Search helper
frontend/src/lib/SearchData.js - Statistics chart
frontend/src/features/sensors/StatisticSensorChart.jsx
Camera viewing
- Camera page
frontend/src/pages/Camera.jsx - Camera state
frontend/src/features/camera/camerasSlice.js - Stream request client
frontend/src/features/camera/cameraService.js - Camera player view
frontend/src/features/camera/CameraItem.jsx - JSMpeg player
frontend/src/components/JsmpegPlayer.jsx - Camera backend
camera-backend/server.js
Other components
- User
- Device API
- Stream endpoint
Connections 36
- User → App router: opens
frontend/src/App.js - App router → Navigation bar: renders
frontend/src/App.js - App router → Dashboard: routes to
frontend/src/App.js - App router → Sensor page: routes to
frontend/src/App.js - App router → Camera page: routes to
frontend/src/App.js - Dashboard → Device state: dispatches fetch
frontend/src/pages/Dashboard.jsx - Dashboard → Camera state: dispatches fetch
frontend/src/pages/Dashboard.jsx - Dashboard → Location tabs: renders
frontend/src/pages/Dashboard.jsx - Location tabs → Dashboard items: uses
frontend/src/components/VerticalTabs.jsx - Dashboard items → Realtime chart: renders
frontend/src/components/DashBoardItem.jsx - Dashboard items → Sensor visibility: renders
frontend/src/components/DashBoardItem.jsx - Dashboard items → Camera player view: renders
frontend/src/components/DashBoardItem.jsx - App router → Device settings: routes to
frontend/src/App.js - Device settings → Register device: renders
frontend/src/pages/Setting.jsx - Device settings → Delete device: renders
frontend/src/pages/Setting.jsx - Register device → Device state: dispatches actions
frontend/src/features/device/RegisterDevice.jsx - Delete device → Device state: dispatches actions
frontend/src/features/device/DeleteDevice.jsx - Device state → Device API client: calls
frontend/src/features/device/deviceSlice.js - Device API client → Device API: HTTP requests
frontend/src/features/device/deviceService.js - Sensor page → Sensor groups: renders
frontend/src/pages/Sensor.jsx - Sensor page → Sensor data search: renders
frontend/src/pages/Sensor.jsx - Sensor groups → Realtime chart: renders
frontend/src/features/sensors/SensorsGroup.jsx - Sensor groups → Sensor visibility: renders
frontend/src/features/sensors/SensorsGroup.jsx - Sensor groups → Sensor state: uses state
frontend/src/features/sensors/SensorsGroup.jsx - Realtime chart → Sensor state: dispatches fetch
frontend/src/features/sensors/RealtimeSensorChart.jsx - Sensor visibility → Sensor state: dispatches visibility
frontend/src/features/sensors/SensorSwitch.jsx - Sensor state → Device API client: fetches devices
frontend/src/features/sensors/sensorsSlice.js - Sensor data search → Search helper: calls
frontend/src/features/sensors/SensorDataSearch.jsx - Sensor data search → Statistics chart: renders results
frontend/src/features/sensors/SensorDataSearch.jsx - Camera page → Camera state: dispatches fetch
frontend/src/pages/Camera.jsx - Camera page → Camera player view: renders
frontend/src/pages/Camera.jsx - Camera state → Device API client: fetches camera records
frontend/src/features/camera/camerasSlice.js - Camera state → Stream request client: requests streams
frontend/src/features/camera/camerasSlice.js - Stream request client → Stream endpoint: requests stream
frontend/src/features/camera/cameraService.js - Camera player view → JSMpeg player: renders stream
frontend/src/features/camera/CameraItem.jsx - Camera backend → Stream endpoint