How nnaajjeebb12/i-pond-frontend works
Soletronix iPond is a multi-tenant aquaculture monitoring platform. ESP32 gateways submit sensor readings; authenticated pond owners and viewers inspect live status, historical charts, alerts, maintenance, utilization, and reports, while administrators manage users and ponds. The main data path is sensor ingestion into PostgreSQL/TimescaleDB, followed by role-scoped API queries and dashboard views. The graph preserves documented feature areas even where route or page implementations were not sampled; those links cite the README. Source-level edges are limited to relationships shown in excerpts or the SOURCE INDEX.
Main entry points: db.ts Database pool · auth.ts Credentials authentication · route.ts Sensor ingest · dashboard Pond dashboards
Components 30
Sensor ingestion
- Sensor ingest
src/app/api/send-sensor-data/route.ts - Pi sync receiver
src/app/api/sync/route.ts
Pond data
- Readings API
src/app/api/readings/route.ts - Pond status API
src/app/api/ponds/status/route.ts - Reading queries
src/app/api/readings - Utilization API
src/app/api/utilization/route.ts - Threshold management
src/app/api/thresholds/route.ts - TimescaleDB
- Database pool
src/lib/db.ts - Pond status logic
src/lib/pondStatus.ts
Monitoring experience
- Pond dashboards
src/app/dashboard - Sensor charts
src/components/charts/SensorChart.tsx - Polling data hooks
src/hooks/useApi.ts - Alert polling
src/hooks/useAlerts.ts - PDF and CSV reports
src/app/reports - Application shell
src/components/MainLayout.tsx - Utilization view
src/app/utilization/page.tsx - Threshold settings
src/app/settings/thresholds/page.tsx - Notifications view
src/app/notifications/page.tsx
Administration and operations
- Alerts
src/app/api/alerts - Alert logic
src/lib/alerts.ts - Maintenance workflows
src/app/api/maintenance - Admin management
src/app/api/admin
Identity and access
- Admin guard
src/lib/admin.ts - Credentials authentication
src/auth.ts - Auth configuration
src/auth.config.ts - Login and session UI
src/app/login/page.tsx - Client auth state
src/store/authStore.ts
Other components
- ESP32 gateway
- Pond users
Connections 33
- ESP32 gateway → Sensor ingest: sends readings
- Sensor ingest → Database pool: writes readings
src/app/api/send-sensor-data/route.ts - Pi sync receiver → Database pool: writes readings
src/app/api/sync/route.ts - Sensor ingest → TimescaleDB: stores readings
- Pi sync receiver → TimescaleDB: stores readings
src/app/api/sync/route.ts - Readings API → Database pool: queries readings
src/app/api/readings/route.ts - Pond status API → Database pool: queries pond data
src/app/api/ponds/status/route.ts - Reading queries → TimescaleDB: serves reading queries
- Utilization API → Database pool: queries uptime
src/app/api/utilization/route.ts - Threshold management → Database pool: reads and updates
src/app/api/thresholds/route.ts - Database pool → TimescaleDB: connects to
- Pond dashboards → Polling data hooks: loads monitoring data
- Polling data hooks → Readings API: polls readings
src/hooks/useApi.ts - Pond dashboards → Sensor charts: visualizes readings
- Pond status API → Pond status logic: uses status rules
src/app/api/ponds/status/route.ts - Pond users → Pond dashboards: views assigned ponds
- Alerts → Database pool: queries alerts
src/app/api/alerts/route.ts - Alert logic → Database pool: checks alert data
src/lib/alerts.ts - Alert polling → Alerts: polls and acknowledges
src/hooks/useAlerts.ts - Maintenance workflows → Database pool: stores requests
src/app/api/maintenance/route.ts - PDF and CSV reports → Reading queries: exports readings
- Admin management → Database pool: manages records
src/app/api/admin/ponds/route.ts - Admin management → Admin guard: checks permissions
src/app/api/admin/ponds/route.ts - Admin guard → Credentials authentication: checks admin role
src/lib/admin.ts - Credentials authentication → Database pool: loads credentials
src/auth.ts - Credentials authentication → Auth configuration: extends options
src/auth.ts - Login and session UI → Credentials authentication: signs in
- Application shell → Client auth state: uses session state
src/components/MainLayout.tsx - Application shell → Alert polling: uses alert polling
src/components/MainLayout.tsx - Utilization view → Utilization API: requests utilization
- Threshold settings → Threshold management: configures thresholds
- Notifications view → Maintenance workflows: handles maintenance
- Notifications view → Alerts: shows alerts