How rakkiad-jo/atj-robot works
ATJ-ROBOT is a web and IoT platform for managing agricultural spraying robots. Users sign in, connect a device, and use the dashboard to monitor robot status and sensor readings, review and analyze spraying history, and manage settings; administrators also manage robots. The backend authenticates users, stores accounts and robot associations in PostgreSQL, and proxies robot data requests to the IoT server, which exposes device APIs backed by MongoDB. The README also documents theme switching and automated offline-status checks. Some page-to-endpoint wiring is not shown in the sampled source, so those links are omitted.
Main entry points: clientLayout.tsx Dashboard shell · robot-iot-api.js Device data API · users.js Accounts and auth · robot.js Robot API
Components 26
Web application
- Dashboard shell
frontend/src/components/clientLayout.tsx - Robot selection
frontend/src/app/contexts/SelectedRobotContext.tsx - Theme settings
frontend/src/app/contexts/ThemeContext.tsx - Robot dashboard
frontend/src/components/home.tsx - Spraying controls
frontend/src/components/sparying.tsx - Usage analytics
frontend/src/components/graph.tsx - Spray history
frontend/src/components/history.tsx - Robot status
frontend/src/components/robotState.tsx - Robot administration
frontend/src/components/admin.tsx - Account settings
frontend/src/components/settings.tsx - Chat assistant
frontend/src/components/chatBot.tsx
Backend API
- Accounts and auth
backend/users.js - Robot API
backend/robot/robot.js - Chat API
backend/chat.js - API server
backend/server.js
IoT services
- IoT API server
iot-server/server.js - Device data API
iot-server/robot-iot-api.js - Device authentication
iot-server/middleware/authenticateDevice.js - Status and retention jobs
iot-server/statusChecker.js
Persistent state
- PostgreSQL
backend/postgres.js - Sensor records
iot-server/models/esp32sensor.js - Device status
iot-server/models/esp32status.js - Device history
iot-server/models/esp32data.js
Other components
- User
- Robot device
- Email service
Connections 29
- User → Dashboard shell: uses
- Dashboard shell → Robot selection: provides selection
- Dashboard shell → Theme settings: provides theme
- Robot selection → Robot API: fetches robots
- Robot API → Device data API: requests device data
- IoT API server → Device data API: dispatches
- Device data API → Device authentication: authenticates device
- Robot device → IoT API server: sends telemetry
- Device data API → Sensor records: stores sensor data
- Device data API → Device status: reads device status
- Device data API → Device history: reads and writes history
- Status and retention jobs → Device status: updates status
- Status and retention jobs → Device history: retains data
- Robot API → PostgreSQL: reads robot records
- Accounts and auth → PostgreSQL: reads and writes accounts
- User → Accounts and auth: registers and signs in
- Accounts and auth → Email service: sends verification
- Accounts and auth → Email service: sends OTP
- Robot dashboard → Dashboard shell: renders in
- Spraying controls → Dashboard shell: renders in
- Usage analytics → Dashboard shell: renders in
- Spray history → Dashboard shell: renders in
- Robot status → Dashboard shell: renders in
- Robot administration → Dashboard shell: renders in
- Account settings → Dashboard shell: renders in
- Chat assistant → Dashboard shell: renders in
- API server → Accounts and auth: mounts routes
- API server → Robot API: mounts routes
- API server → Chat API: mounts routes