How indraagstin025/timbangan-digital-project works
TimbangSapi is a livestock-management web app for monitoring IoT scale readings, managing cattle, and reviewing weight and growth data. The main workflow is: an operator uses the dashboard or control view; scale readings arrive in real time or are saved through the weighing flow; the app refreshes cattle, summary, history, and growth data; users then inspect individual cattle, DSS recommendations, and reports. The graph reflects the sampled app, hook, and API-client wiring plus landing-page capabilities. Several page and API implementations were not sampled, so their internal calls are not inferred.
Main entry points: App.jsx App controller · useLivestockData.js Livestock data hook · apiClient.js HTTP API client · deviceApi.js Device API
Components 27
App and access
- App controller
src/App.jsx - Landing page
src/pages/LandingPage.jsx - Login page
src/pages/LoginPage.jsx - Authentication state
src/contexts/AuthContext.jsx - Main layout
src/layouts/MainLayout.jsx - User profile
src/pages/ProfilePage.jsx
Livestock operations
- Livestock data hook
src/hooks/useLivestockData.js - Dashboard
src/pages/DashboardPage.jsx - Scale control
src/pages/ControlPage.jsx - Live scale widget
src/components/LiveScaleWidget.jsx - Cattle registry
src/pages/DssPage.jsx - Cattle detail
src/pages/CowDetailPage.jsx - Detail data hook
src/hooks/useCowDetail.js - Device management
src/pages/DevicesPage.jsx
Analysis and reporting
- Growth analysis
src/pages/GrowthPage.jsx - Weighing history
src/pages/HistoryPage.jsx - DSS filtering
src/hooks/useDssFilter.js - Data export
src/pages/ExportPage.jsx
API and devices
- HTTP API client
src/api/apiClient.js - Authentication API
src/api/authApi.js - Cattle API
src/api/cowApi.js - Dashboard API
src/api/dashboardApi.js - Weighing API
src/api/weighingApi.js - Device API
src/api/deviceApi.js
Other components
- Operator
- Backend API
- IoT scale
Connections 39
- Operator → App controller: uses
- App controller → Authentication state: checks session
- App controller → Landing page: shows
- App controller → Login page: shows
- Login page → Authentication state: authenticates
- Authentication state → Authentication API: calls
- App controller → Livestock data hook: loads data
- App controller → Main layout: renders
- App controller → Dashboard: routes
- App controller → Scale control: routes
- App controller → Cattle registry: routes
- App controller → Cattle detail: routes
- App controller → Growth analysis: routes
- App controller → Weighing history: routes
- App controller → Data export: routes
- App controller → Device management: routes
- App controller → User profile: routes
- Livestock data hook → Cattle API: fetches and creates
- Livestock data hook → Dashboard API: fetches summary and trends
- Livestock data hook → Weighing API: fetches and saves
- Livestock data hook → Backend API: receives API data
- IoT scale → Livestock data hook: streams readings
- Livestock data hook → Dashboard: provides metrics
- Livestock data hook → Scale control: provides live state
- Livestock data hook → Growth analysis: provides trends
- Livestock data hook → Weighing history: provides weighings
- Livestock data hook → Cattle registry: provides cattle
- Cattle registry → DSS filtering: filters and sorts
- Cattle detail → Detail data hook: loads detail
- Detail data hook → Cattle API: fetches prediction and weights
- Live scale widget → Weighing API: saves weighing
- Live scale widget → Device API: sends commands
- Device API → Backend API: dispatches commands
- HTTP API client → Backend API: sends HTTP requests
- Authentication API → HTTP API client: uses
- Cattle API → HTTP API client: uses
- Dashboard API → HTTP API client: uses
- Weighing API → HTTP API client: uses
- Device API → HTTP API client: uses