Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.mangrovesystems.com/llms.txt

Use this file to discover all available pages before exploring further.

What you’ll build in this exercise:
  • Design a Biochar Delivery event type with 3-5 datapoints
  • Build the event type and a simple model in Mangrove
  • Generate a batch and verify the calculated output
This exercise has two parts: a Design phase (30 min) and a Build in Mangrove phase (1 hr). By the end you will have a working end-to-end flow: Prerequisites: Complete Lesson 1.1, Lesson 1.2, and Lesson 1.3. Ensure you have duplicated the Mangrove Biochar starter project and named it “Mangrove Biochar – [Your Name] Training.” You can create or duplicate a project in the Projects section.

Part 1: Design (30 min)

Before touching the app, design your first event type and dataflow in a spreadsheet or FigJam.

1. Identify one key activity

Pick one key activity in the Mangrove Biochar process to model first. We suggest “Biochar Delivery” — the moment biochar is delivered to a field for application. Each delivery is a natural unit of production and a good candidate for an event.

2. List the datapoints

For the activity you chose, list the datapoints the event must capture:

Measurements

  • Biochar mass (tonnes)
  • Carbon content (%)
  • Delivery date

Identifiers

  • Delivery ticket ID
  • Tracking ID (optional)

Evidence

  • Delivery ticket
  • Weighbridge slip
  • Application record
You can store the Delivery ticket ID as a datapoint or as the event’s Tracking ID (optional field).

3. Sketch the flow: Event → Model → Output

1

Event

One Biochar Delivery with values for each datapoint (e.g., mass = 10 t, carbon content = 80%).
2

Model

A calculation that reads those datapoints and produces one output. Formula:carbon_delivered = mass × (carbon_content / 100) × 3.67(3.67 is the CO2-to-carbon mass ratio.)
3

Output

The model produces carbon delivered in tCO2e — e.g., 10 × 0.80 × 3.67 = 29.36 tCO2e.

Part 2: Build in Mangrove (1 hr)

Using your duplicated Mangrove Biochar project, implement the design. The starter project already has the ledger and batch type set up, so you only need to create the event type, build the model, and generate batches.

Step 1: Create one event type with 3-5 datapoints

  1. Open your project and go to Data Inputs > Input Settings.
  2. Add a new event type (e.g., name: “Biochar Delivery”, slug: biochar-delivery).
  3. Add 3-5 datapoint types:
DatapointValue Type
Delivery datedate/datetime
Biochar mass (tonnes)number
Carbon content (%)number
Delivery ticket IDtext
Define each with a clear slug so they can be referenced in the model. See configuring event types and Lesson 1.3: Events and Datapoints.

Step 2: Create a simple model

  1. Open the Models section and the Model Editor (click Edit/Test next to the model). See building accounting models .
  2. Build a minimal tree:
    • Input nodes — reference the slugs for biochar mass and carbon content
    • Constant node — value 3.67 (CO2-to-carbon mass ratio)
    • Output nodeoperator: product, data_point_type: carbon-delivered-tco2e
If carbon content is stored as a percentage (0-100), include a division by 100 in the formula or an intermediate node.
  1. Validate the model in the Console and save. Ensure the output datapoint slug matches what the batch type expects.

Step 3: Generate batches

The starter project already has the ledger and batch type configured. You only need to run the dataflow.
  1. Go to Production Accounting and use Generate Batches .
  2. Choose an accounting period that includes your test event’s date.
  3. Validate that required datapoints are present, then Submit.

Step 4: Test end-to-end

1

Create a sample event

Go to Data Inputs and add an event directly. Select Biochar Delivery, set the date range, and fill in your datapoints (e.g., mass = 10 t, carbon content = 80%). Optionally add a Tracking ID and evidence.
2

Generate batches

Trigger batch generation for a period including your test event. Resolve any validation messages. If validations show missing data, try adjusting the datetime range or using the show time option per Generate batches.
3

Verify the output

Check that the batch shows the expected result:10 × 0.80 × 3.67 ≈ 29.36 tCO2e
If results don’t match, double-check: event type slugs vs. model data_point_type slugs, units (% vs. fraction), and that the model output slug matches what the batch type expects.

Success criteria

You have completed the Module 1 exercise when:
  • One event type exists (e.g., Biochar Delivery) with 3-5 datapoints in Data Inputs > Input Settings
  • One simple model reads your event’s datapoints and computes carbon delivered (e.g. mass × carbon_content × 3.67)
  • Batches generated — you ran Generate Batches and a batch was created for your test event
  • End-to-end test — the batch shows the expected calculated output (e.g. ~29.36 tCO2e for 10 t at 80% carbon content)

What’s next

Module 2 (Calculations) is coming soon — you’ll expand this with more event types and multi-step calculations. In the meantime, you can jump ahead to Module 4: Mass Balance with Ledgers to learn about ledger structures and mass balance accounting.