How pangcodenaemail2-star/smartswine works
SmartSwine is a pig-farm monitoring dashboard backed by a local API and an optional AI camera integration. The main workflow is to view herd and farm data, manage pig profiles and records, and send observations or camera images for analysis; settings also support AI dataset validation, training, and calibration. The graph preserves the dashboard’s distinct feature areas and the API, persistence, and inference layers. Some source was only indexed or excerpted, so uncertain internal links are omitted.
Main entry points: App.jsx Page router · DashboardLayout.jsx Dashboard layout · api.js API client · routes.py AI routes
Components 19
Farm dashboard
- Page router
smartswine-dashboard/src/App.jsx - Herd dashboard
smartswine-dashboard/src/pages/Dashboard.jsx - Pig records
smartswine-dashboard/src/pages/PigRecords.jsx - Health alerts
smartswine-dashboard/src/pages/HealthAlerts.jsx - Environment
smartswine-dashboard/src/pages/Environment.jsx - Live pen
smartswine-dashboard/src/pages/LivePen.jsx - Live camera
smartswine-dashboard/src/pages/LiveCamera.jsx - Reports
smartswine-dashboard/src/pages/Reports.jsx - Feed costs
smartswine-dashboard/src/pages/FeedCosts.jsx - AI settings
smartswine-dashboard/src/pages/Settings.jsx - Dashboard layout
smartswine-dashboard/src/layouts/DashboardLayout.jsx
Farm API
- API client
smartswine-dashboard/src/api.js - Farm API
backend/app.py
AI camera
- AI routes
aitrain/PigAI_Webapp_Integration/integration/routes.py - Camera inference
aitrain/PigAI_Webapp_Integration/integration/service.py - Behavior model
aitrain/PigAI_Webapp_Integration/integration/behavior.py - AI configuration
aitrain/PigAI_Webapp_Integration/integration/config.py
Persistence
- SQLite records
backend/storage.py
Other components
- Farm user
Connections 33
- Farm user → Page router: uses
smartswine-dashboard/src/App.jsx - Page router → Herd dashboard: routes to
smartswine-dashboard/src/App.jsx - Page router → Pig records: routes to
smartswine-dashboard/src/App.jsx - Page router → Health alerts: routes to
smartswine-dashboard/src/App.jsx - Page router → Live pen: routes to
smartswine-dashboard/src/App.jsx - Page router → Live camera: routes to
smartswine-dashboard/src/App.jsx - Page router → Reports: routes to
smartswine-dashboard/src/App.jsx - Page router → Feed costs: routes to
smartswine-dashboard/src/App.jsx - Page router → AI settings: routes to
smartswine-dashboard/src/App.jsx - Farm user → Environment: views
smartswine-dashboard/src/pages/Environment.jsx - Herd dashboard → Dashboard layout: renders in
smartswine-dashboard/src/pages/Dashboard.jsx - Pig records → Dashboard layout: renders in
smartswine-dashboard/src/pages/PigRecords.jsx - Health alerts → Dashboard layout: renders in
smartswine-dashboard/src/pages/HealthAlerts.jsx - Live pen → Dashboard layout: renders in
smartswine-dashboard/src/pages/LivePen.jsx - Live camera → Dashboard layout: renders in
smartswine-dashboard/src/pages/LiveCamera.jsx - Reports → Dashboard layout: renders in
smartswine-dashboard/src/pages/Reports.jsx - Feed costs → Dashboard layout: renders in
smartswine-dashboard/src/pages/FeedCosts.jsx - AI settings → Dashboard layout: renders in
smartswine-dashboard/src/pages/Settings.jsx - Herd dashboard → API client: requests data
smartswine-dashboard/src/pages/Dashboard.jsx - Pig records → API client: requests records
smartswine-dashboard/src/pages/PigRecords.jsx - Health alerts → API client: requests data
smartswine-dashboard/src/pages/HealthAlerts.jsx - Reports → API client: requests data
smartswine-dashboard/src/pages/Reports.jsx - Feed costs → API client: requests data
smartswine-dashboard/src/pages/FeedCosts.jsx - AI settings → API client: requests data
smartswine-dashboard/src/pages/Settings.jsx - AI settings → AI routes: trains models
smartswine-dashboard/src/pages/Settings.jsx - Pig records → Farm API: sends pig requests
smartswine-dashboard/src/pages/PigRecords.jsx - Herd dashboard → Farm API: requests dashboard data
- Farm API → SQLite records: reads and writes
backend/app.py - Farm API → AI routes: includes router
backend/app.py - AI routes → Camera inference: processes images
aitrain/PigAI_Webapp_Integration/integration/routes.py - AI routes → Behavior model: uses behavior model
aitrain/PigAI_Webapp_Integration/integration/routes.py - AI routes → AI configuration: uses settings
aitrain/PigAI_Webapp_Integration/integration/routes.py - Camera inference → AI configuration: loads configuration
aitrain/PigAI_Webapp_Integration/integration/service.py