Documentation

Draft (v1) of Seed Tracker — traceability for seed lots moving between farms.

Idea and goals

This is the first minimal version of a seed tracker for Kernza seeds. While the applications and potential build-outs are many, this first version is targeted on fullfilling the requirements for commercial sales of Kernza seeds within Sweden. The tool should enable tracing of Kernza seed lots and simplify the reporting to TLI regarding the usage of Kernza seeds.

Entities

Entity What it represents Key fields
Farm A farm that owns seed lots and takes part in transactions. name, location (region/municipality)
Seed lot A quantity of seed of one species/variety, owned by one farm. A lot can have a parent lot if it was created by splitting another lot. farm (owner), species, variety, harvest year, quantity, unit (kg or t), license, parent lot
Transaction Movement of a quantity of a lot from one farm to another: sale, transfer, gift, or self-use. lot, from farm, to farm, type, quantity, date
Split (child lot) Dividing a lot into a new child lot. The parent lot is never modified; the child gets parent lot set and inherits species, variety, harvest year, unit and license unless overridden. parent lot, quantity split off, receiving farm (optional)

Concepts

Usage

  1. Log in with the shared password. Every page requires a valid session.
  2. Overview lists all lots and farms. Create a farm first if none exists.
  3. New farm — register a farm with a name and a location.
  4. New lot — register a seed lot on a farm: harvest year, quantity and unit. Species, variety, license and unit are picked from lists served by the backend (GET /options, stored in the database): currently Kernza with the varieties TLI cycle 5, TLI cycle 8 and Minnesota Clearwater; licenses TLI and University of Minnesota; units kg and t.
  5. New transaction — record a sale/transfer/gift/self-use of part of a lot to another farm.
  6. Split (from the overview, per lot) — split off a quantity into a child lot, optionally at another farm.
  7. Lineage — enter a lot ID to see its full ancestry and descendants as a diagram. Green square = lot, blue circle = farm, solid edge = split, dashed edge = transaction. Download CSV exports the same edges.

API

The backend is a plain REST API (FastAPI) with interactive OpenAPI docs at /docs on the API host (default http://localhost:8000/docs). All data endpoints require an Authorization: Bearer token issued by POST /auth/login. In this draft the login is a single shared password, not per-user accounts. Notable endpoints: GET /lots/{id}/lineage (nested JSON for the diagram), GET /lots/{id}/lineage.csv, and GET /options (the allowed species/variety/license/unit values).