# sunset-sejong-university/field-shift architecture

> Architecture diagram of the GitHub repository sunset-sejong-university/field-shift, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-16). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/sunset-sejong-university/field-shift
- Repository: https://github.com/sunset-sejong-university/field-shift

## Overview

Field Shift is an edge agricultural monitoring console: it combines local farm telemetry with NASA POWER regional climate data, derives irrigation and frost insights, and presents live readings and forecasts on an LVGL touchscreen. The graph preserves the documented ingestion, shared telemetry, analytics, alarms, and presentation stages. README-described relationships are cited to the README; source excerpts for the Field Shift implementation were not provided, so implementation-level wiring is not independently verified.

Main entry points: [`apps/farm_dashboard/src/fs_core.c`](https://github.com/sunset-sejong-university/field-shift/blob/master/apps/farm_dashboard/src/fs_core.c) (Telemetry Slots), [`apps/farm_dashboard/src/fs_net.c`](https://github.com/sunset-sejong-university/field-shift/blob/master/apps/farm_dashboard/src/fs_net.c) (Network Fetch), [`apps/farm_dashboard/src/fs_ui.c`](https://github.com/sunset-sejong-university/field-shift/blob/master/apps/farm_dashboard/src/fs_ui.c) (Live Dashboard), [`apps/farm_dashboard/src/fs_insight.c`](https://github.com/sunset-sejong-university/field-shift/blob/master/apps/farm_dashboard/src/fs_insight.c) (Agronomic Insights)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ingestion["Telemetry Ingestion"]
  node_farm_ingest["Local Sampling<br/>[fs_profile_farm.c]"]
  node_network["Network Fetch<br/>[fs_net.c]"]
  node_clock["Time Sync<br/>[fs_time.c]"]
end

subgraph group_telemetry["Telemetry Core"]
  node_telemetry_core["Telemetry Slots<br/>[fs_core.c]"]
end

subgraph group_analytics["Edge Analytics"]
  node_insights["Agronomic Insights<br/>[fs_insight.c]"]
  node_forecast["Forecast Engine<br/>[fs_forecast.c]"]
  node_alarms["Alarm Engine<br/>[fs_alarm.c]"]
end

subgraph group_presentation["Farm Interface"]
  node_dashboard["Live Dashboard<br/>[fs_ui.c]"]
  node_insight_ui["Insight Drawer<br/>[fs_ui_insight.c]"]
  node_artwork["Visual Assets<br/>[ghibli_bg.c]"]
  node_leaf["Leaf Sprite<br/>[leaf_sprite.c]"]
end

node_sensors(("Farm Sensors"))
node_wifi(("Local Wi-Fi"))
node_nasa(("NASA POWER"))
node_display(("Touch Display"))

node_sensors -->|"supply readings"| node_farm_ingest
node_farm_ingest -->|"publish telemetry"| node_telemetry_core
node_wifi -->|"provide connectivity"| node_network
node_network -->|"request climate data"| node_nasa
node_nasa -->|"return climate data"| node_network
node_network -->|"publish regional data"| node_telemetry_core
node_network -->|"supply HTTP date"| node_clock
node_clock -->|"set time"| node_telemetry_core
node_telemetry_core -->|"provide readings"| node_insights
node_insights -->|"publish derived data"| node_telemetry_core
node_telemetry_core -->|"provide history"| node_forecast
node_telemetry_core -->|"provide readings"| node_alarms
node_telemetry_core -->|"render readings"| node_dashboard
node_forecast -->|"render projections"| node_dashboard
node_insights -->|"render decisions"| node_insight_ui
node_alarms -->|"show alerts"| node_dashboard
node_artwork -->|"render artwork"| node_display
node_leaf -->|"render sprite"| node_display
node_dashboard -->|"show dashboard"| node_display
node_insight_ui -->|"show insights"| node_display

click node_farm_ingest "https://github.com/sunset-sejong-university/field-shift/blob/master/apps/farm_dashboard/src/fs_profile_farm.c"
click node_network "https://github.com/sunset-sejong-university/field-shift/blob/master/apps/farm_dashboard/src/fs_net.c"
click node_clock "https://github.com/sunset-sejong-university/field-shift/blob/master/apps/farm_dashboard/src/fs_time.c"
click node_telemetry_core "https://github.com/sunset-sejong-university/field-shift/blob/master/apps/farm_dashboard/src/fs_core.c"
click node_insights "https://github.com/sunset-sejong-university/field-shift/blob/master/apps/farm_dashboard/src/fs_insight.c"
click node_forecast "https://github.com/sunset-sejong-university/field-shift/blob/master/apps/farm_dashboard/src/fs_forecast.c"
click node_alarms "https://github.com/sunset-sejong-university/field-shift/blob/master/apps/farm_dashboard/src/fs_alarm.c"
click node_dashboard "https://github.com/sunset-sejong-university/field-shift/blob/master/apps/farm_dashboard/src/fs_ui.c"
click node_insight_ui "https://github.com/sunset-sejong-university/field-shift/blob/master/apps/farm_dashboard/src/fs_ui_insight.c"
click node_artwork "https://github.com/sunset-sejong-university/field-shift/blob/master/apps/farm_dashboard/src/ghibli_bg.c"
click node_leaf "https://github.com/sunset-sejong-university/field-shift/blob/master/apps/farm_dashboard/src/leaf_sprite.c"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_farm_ingest,node_network,node_clock toneBlue
class node_telemetry_core toneAmber
class node_insights,node_forecast,node_alarms toneMint
class node_dashboard,node_insight_ui,node_artwork,node_leaf toneRose
class node_sensors,node_wifi,node_nasa,node_display toneIndigo
```

## Components

### Telemetry Ingestion

- [Local Sampling](https://github.com/sunset-sejong-university/field-shift/blob/master/apps/farm_dashboard/src/fs_profile_farm.c): `apps/farm_dashboard/src/fs_profile_farm.c`
- [Network Fetch](https://github.com/sunset-sejong-university/field-shift/blob/master/apps/farm_dashboard/src/fs_net.c): `apps/farm_dashboard/src/fs_net.c`
- [Time Sync](https://github.com/sunset-sejong-university/field-shift/blob/master/apps/farm_dashboard/src/fs_time.c): `apps/farm_dashboard/src/fs_time.c`

### Telemetry Core

- [Telemetry Slots](https://github.com/sunset-sejong-university/field-shift/blob/master/apps/farm_dashboard/src/fs_core.c): `apps/farm_dashboard/src/fs_core.c`

### Edge Analytics

- [Agronomic Insights](https://github.com/sunset-sejong-university/field-shift/blob/master/apps/farm_dashboard/src/fs_insight.c): `apps/farm_dashboard/src/fs_insight.c`
- [Forecast Engine](https://github.com/sunset-sejong-university/field-shift/blob/master/apps/farm_dashboard/src/fs_forecast.c): `apps/farm_dashboard/src/fs_forecast.c`
- [Alarm Engine](https://github.com/sunset-sejong-university/field-shift/blob/master/apps/farm_dashboard/src/fs_alarm.c): `apps/farm_dashboard/src/fs_alarm.c`

### Farm Interface

- [Live Dashboard](https://github.com/sunset-sejong-university/field-shift/blob/master/apps/farm_dashboard/src/fs_ui.c): `apps/farm_dashboard/src/fs_ui.c`
- [Insight Drawer](https://github.com/sunset-sejong-university/field-shift/blob/master/apps/farm_dashboard/src/fs_ui_insight.c): `apps/farm_dashboard/src/fs_ui_insight.c`
- [Visual Assets](https://github.com/sunset-sejong-university/field-shift/blob/master/apps/farm_dashboard/src/ghibli_bg.c): `apps/farm_dashboard/src/ghibli_bg.c`
- [Leaf Sprite](https://github.com/sunset-sejong-university/field-shift/blob/master/apps/farm_dashboard/src/leaf_sprite.c): `apps/farm_dashboard/src/leaf_sprite.c`

### Other components

- **Farm Sensors**
- **Local Wi-Fi**
- **NASA POWER**
- **Touch Display**

## Connections

- Farm Sensors → Local Sampling: supply readings
- Local Sampling → Telemetry Slots: publish telemetry
- Local Wi-Fi → Network Fetch: provide connectivity
- Network Fetch → NASA POWER: request climate data
- NASA POWER → Network Fetch: return climate data
- Network Fetch → Telemetry Slots: publish regional data
- Network Fetch → Time Sync: supply HTTP date
- Time Sync → Telemetry Slots: set time
- Telemetry Slots → Agronomic Insights: provide readings
- Agronomic Insights → Telemetry Slots: publish derived data
- Telemetry Slots → Forecast Engine: provide history
- Telemetry Slots → Alarm Engine: provide readings
- Telemetry Slots → Live Dashboard: render readings
- Forecast Engine → Live Dashboard: render projections
- Agronomic Insights → Insight Drawer: render decisions
- Alarm Engine → Live Dashboard: show alerts
- Visual Assets → Touch Display: render artwork
- Leaf Sprite → Touch Display: render sprite
- Live Dashboard → Touch Display: show dashboard
- Insight Drawer → Touch Display: show insights
