Open source · MIT licence · v1.17.0

The digital OS for
tea cooperatives

Keep field journals, trace each tea lot with its QR code, close payment periods for farming households and see the whole cooperative on one dashboard.

Cooperative dashboard: six figures with trends, a list of items needing attention, parcel status and area by crop charts. Sample data.
The Tea Work app on a phone: a staff member's task list with an overdue task and an urgent task. Sample data.
Lot QR code (illustration)Scan to see the lot's origin
Air humidity56 %Sample figure from the dashboard
Real screenshots: the cooperative dashboard and the Tea Work app. The QR and sensor cards are illustrations based on sample data.
8mini-apps in the repository
3roles: manager, technical officer, farming household
21versions recorded in CHANGELOG
One day with lot A3

From a tea plot to a QR code

The repository's sample story, with sample data.

  1. 1

    Plot TC-A3

    A Tân Cương plot with a recorded farming history.

  2. 2

    Journal and withdrawal

    Spraying is logged; the system shows 4 of 7 withdrawal days left.

  3. 3

    Disease photo, officer

    The model's result waits in the queue; an officer confirms the disease.

  4. 4

    Lot and yield

    Lot TC-CHE-A3-001: 24 kg, QR code issued.

  5. 5

    The buyer scans

    The traceability page shows locked information and the plot of origin.

Digital profile of a sample plot (P-TC-003). The A3 story uses the same data structure.
Digital profile of a sample plot (P-TC-003). The A3 story uses the same data structure.
Illustration: field journal with a withdrawal periodTwo journal entries: fertilising with no withdrawal, spraying with 4 of 7 days left. Journal · TC-A3 FertilisingToday · recorded by the household No withdrawal SprayingWithdrawal 7 days · 4 days left Withdrawal period calculated from the entry date
Illustration: tea leaf photo waiting for an officerA leaf photo is sent; the model result waits in the queue for the officer to approve and enter the disease name. Waiting for officer The model only suggests; an officer names the disease
Traceability page of the lot, cropped. Sample data.
Traceability page of the lot, cropped. Sample data.

Illustration: the lot's QR code. A buyer scans it to open the traceability page.

Architecture

Three tiers, one core

The shared core sits at the bottom. Cooperative apps are in the middle. Installed mini-apps are at the top and reach the core through the API gateway. Nothing in the core depends on any app.

Three-tier diagram of OpenTea DX-OSTier 1 is the shared core: single sign-on, API gateway, data per cooperative, storage, file scanning, audit log and sensors. Tier 2 is the cooperative apps that use the core. Tier 3 is mini-apps installed into the core with app.yaml.Tier 3 · Mini-appsInstalled with ./dxosleaf-purchaseFresh leaf purchasetea-shopTea shopfarm-supplyGroup supply orderstea-tourTea hill tourscustom-booksNo-code record bookshtx-dashboardCharts dashboardhelloSample appTier 2 · HTX appsInterfaces by roleWeb appJournal, parcels, QRTea disease checkPhoto diagnosisHub mobileAndroid, iOS, webStaff desktopPayroll, staffStaff mobileTasks, attendanceTier 1 · CoreShared servicesKeycloakSingle sign-onAPISIXAPI gatewayHasuraGraphQL, per HTXPostgreSQLPostGIS, pgvectorSeaweedFSS3 storageClamAVFile quarantineAuditHash-chained logMosquittoSensors, cold storen8nData workflowsOllamaLocal modelsweb and gateway route requests to the app (and back)apps and web read core data through the gateway and Hasura Three-tier diagram of OpenTea DX-OSTier 1 is the shared core: single sign-on, API gateway, data per cooperative, storage, file scanning, audit log and sensors. Tier 2 is the cooperative apps that use the core. Tier 3 is mini-apps installed into the core with app.yaml.Tier 3 · Mini-appsInstalled with ./dxosleaf-purchaseFresh leaf purchasetea-shopTea shopfarm-supplyGroup supply orderstea-tourTea hill tourscustom-booksNo-code record bookshtx-dashboardCharts dashboardhelloSample appTier 2 · HTX appsInterfaces by roleWeb appJournal, parcels, QRTea disease checkPhoto diagnosisHub mobileAndroid, iOS, webStaff desktopPayroll, staffStaff mobileTasks, attendanceTier 1 · CoreShared servicesKeycloakSingle sign-onAPISIXAPI gatewayHasuraGraphQL, per HTXPostgreSQLPostGIS, pgvectorSeaweedFSS3 storageClamAVFile quarantineAuditHash-chained logMosquittoSensors, cold storen8nData workflowsOllamaLocal modelsweb → gateway → appgateway → Hasura

Requests to a mini-app: browser → web → API gateway → app.

Reading core data: apps and web → gateway → Hasura.

Tier 1

Shared core

  • Single sign-on and roles per cooperative.
  • Audit log as a hash chain.

Tier 2

Cooperative apps

  • Web app: journal, plots, lots and QR.
  • Mobile and desktop apps for staff.

Tier 3

Mini-apps

  • Declared in app.yaml, installed with ./dxos.
  • Turned on per cooperative in the App Store.
What it does

What a cooperative can do

Each tile is a capability in the repository.

Dashboard

Items needing attention and trends for the manager.

407 · 14 · 30Illustrative figures

Lot traceability

A public page per lot, locked once the QR is issued.

TC-CHE-A3-001

QR code · lô đã xuất

Mini-apps

Add an app with app.yaml, without changing the core.

id: htx-dashboard
version: 0.2.0
requires: { core: ">=1.13.0" }
routes:
  protected:
    /: [manager]
# install: ./dxos install miniapps/htx-dashboard

Sensors

Readings over MQTT, from the hot store to the cold store.

322824-2 hnow

Mobile and desktop

Android for staff, Windows for the manager.

My tasks screen in Tea Work (sample data)
Payroll on the desktop app (sample data)

Access by cooperative

Data filtered by the cooperative code in the token.

Tân CươngVisibleLa BằngHiddentoken: TC
Real screens

Six screens from the apps in the repository

Choose a tab to see a screen. Every image is a screenshot of an app, with sample data. The field journal and the tea leaf disease check have no screenshots in the repository yet; the story above uses labelled illustrations for them.

Cooperative dashboard: figures, items needing attention, parcel status and area by crop. Sample data.
Cooperative dashboard: figures and items needing attention.
Payment period for fresh leaf purchase: total, households and each household's status. Sample data.
Payment period: total, households and each household's status.
Public order page of a tea shop: products and remaining stock. Sample data.
Public order page, no sign-in needed.
Picking attendance book in use: entries, filters and totals. Sample data.
A book in use: entries, filters and totals.
A cooperative's App Store: app cards with installed or not-installed status, search and filters. Sample data.
App Store: turn each app on or off for the cooperative you choose.
My tasks in Tea Work: tasks to do, overdue and done. Sample data.
Tea Work: a staff member's tasks on the phone.
Developers

Add a mini-app without changing the core

A mini-app is its own container, installed with ./dxos. The core is not rebuilt.

$ ./dxos install miniapps/htx-dashboard
# check the manifest; create the schema and role if the app declares a database;
# generate the gateway routes; start the container. If a step fails, the earlier steps are rolled back.
# to show the app in the menu, turn it on for the cooperative in the App Store (needs ./dxos worker).

Shortened from miniapps/htx-dashboard/app.yaml (store description block removed).

apiVersion: dxos/v1
id: htx-dashboard
name: Bảng điều hành HTX
description: "Bảng điều hành biểu đồ cho trưởng HTX: việc cần chú ý, xu hướng so với kỳ trước, sản xuất, cảm biến, sức khoẻ cây, lô chè và vòng đời dữ liệu."
version: 0.2.0
license: MIT
publisher: OpenTea Developers
requires: { core: ">=1.13.0" }
runtime:
  build: .
  port: 8080
  health: /healthz
routes:
  protected:
    /: [manager]
menu:
  - { label: Bảng điều hành, path: /, roles: [manager] }

A manifest can declare a feed: the app returns a list of sub-apps for each user, for example a record book the manager creates. The web app calls the feed with the user's token and caches the result for 15 seconds.

{"entries": [{"label": "Sổ thu mua", "path": "/books/1", "icon": "leaf", "description": "Ghi chép thu mua"}],
 "create": {"label": "Tạo sổ", "path": "/new"}}

After make platform-up and make web-up. The commands are listed in docs/miniapps.md and the README.

make platform-up
make web-up
./dxos install miniapps/htx-dashboard
./dxos list
./dxos remove htx-dashboard

Locked-down container

No host port, read-only files, no internet access.

Data by cooperative

Every query is filtered by the cooperative code in the token.

Trust boundary

Installed apps share one network; install only trusted apps.

Read the full guide

Open source, and the known limits

MIT licence · version v1.17.0

Known limits

  • Tea leaf disease check: 0.87 on the same-source test set, 0.12 to 0.35 across sources; Thai Nguyen photos not measured.
  • The /storage/* route does not yet verify S3 SigV4 signatures.
  • Installed mini-apps share one internal network.
  • Mosquitto saves its state to disk every 60 seconds.