> ## Documentation Index
> Fetch the complete documentation index at: https://docs.appliedaifoundation.org/llms.txt
> Use this file to discover all available pages before exploring further.

# 5-minute tour

> From opening the form on the vessel to seeing a row in PostgreSQL — the whole loop, end to end.

This walkthrough touches every part of the system: the form, Submit, the local archive, the email path, the pipeline, and the database. Skim it first, then dive into the specific section that matters to you.

<Steps>
  <Step title="Open the form">
    The crew double-clicks `Metaweave-Reports.html` in Chrome or Edge. Everything is embedded — jQuery, CryptoJS, all the dropdowns, all the validation rules. No internet needed.

    The left sidebar lists the five report tabs: **Noon**, **Arrival**, **Departure**, **Bunker**, **Statement of Facts**.

    <Frame caption="Voyage section of the Noon Report. Mandatory fields have a blue left border.">
      <img src="https://mintcdn.com/metaweaveconsultant/Yh8TWLsifrpzxzbC/images/form/noon-voyage.png?fit=max&auto=format&n=Yh8TWLsifrpzxzbC&q=85&s=a427a4c29b0691338e91d513b3f03e02" alt="Noon Report voyage section" width="3004" height="950" data-path="images/form/noon-voyage.png" />
    </Frame>
  </Step>

  <Step title="Fill the report">
    The Master fills the daily fields: voyage number, position (DMS), vessel condition, weather, distance, engine hours, fuel ROBs, generators, scrubber, slops, and so on. Auto-calculated fields (Slip %, Reported Speed, Average RPM) are read-only — fix the inputs that feed them.

    See [Filling reports](/form/filling-reports) for the section-by-section walkthrough.
  </Step>

  <Step title="Submit">
    Click **Submit** at the bottom of the report. The form runs validation, then opens a `Form Submission` modal showing the encoded payload.

    <Frame caption="Submit dialog with the AES-encrypted payload between BEGIN/END markers.">
      <img src="https://mintcdn.com/metaweaveconsultant/Yh8TWLsifrpzxzbC/images/form/submit-modal.png?fit=max&auto=format&n=Yh8TWLsifrpzxzbC&q=85&s=ee8c7785c3b15f0806728f69f0465467" alt="Form submit dialog" width="1152" height="1084" data-path="images/form/submit-modal.png" />
    </Frame>

    The Master copies the entire body (`BEGIN MW FORM DATA` … `END MW FORM DATA`), pastes it into a plain-text Outlook email with the standardised subject `Metaweave Forms: VESSEL - Report Type - DD.MM.YYYY`, and sends it.

    See [Submitting](/form/submitting) for the full flow.
  </Step>

  <Step title="The submission is archived locally">
    Behind the scenes, every Submit also appends to `history.json` on the vessel's shared drive — read-write through the browser's File System Access API. A small toast confirms `Archived (insert). N rows in history.`

    <Frame caption="Toast confirming the row was archived locally.">
      <img src="https://mintcdn.com/metaweaveconsultant/Yh8TWLsifrpzxzbC/images/history/archive-toast.png?fit=max&auto=format&n=Yh8TWLsifrpzxzbC&q=85&s=aa75162ca87efedcd1efbe150ba9ff85" alt="Archive toast" width="448" height="96" data-path="images/history/archive-toast.png" />
    </Frame>

    See [Setting up history.json](/history/setup) for how this is wired up on day 1.
  </Step>

  <Step title="Browse past submissions">
    Open `Metaweave-History-Viewer.html` from the same shared folder and link the same `history.json`. The viewer lists every report ever submitted across four tabs (Voyage, SOF, Bunker, Month-End ROB) with date filters, search, and Excel/CSV export.

    <Frame caption="History viewer — Voyage Reports tab with NOON / ARRIVAL / DEPARTURE filters.">
      <img src="https://mintcdn.com/metaweaveconsultant/Yh8TWLsifrpzxzbC/images/history/viewer-voyage-tab.png?fit=max&auto=format&n=Yh8TWLsifrpzxzbC&q=85&s=715cd5fba674cabb079f287b24bd1662" alt="History viewer voyage tab" width="2832" height="952" data-path="images/history/viewer-voyage-tab.png" />
    </Frame>
  </Step>

  <Step title="Pipeline picks up the email">
    On shore, `python -m src.main` runs on a schedule. It logs into the shared Outlook mailbox via Microsoft Graph, pulls every unread message with `Metaweave Forms` in the subject, decrypts the payload (AES-128-CBC), maps the 92-field JSON to SQLAlchemy models, and upserts to PostgreSQL.

    See [Running the pipeline](/pipeline/running) and [ETL stages](/pipeline/etl-stages).
  </Step>

  <Step title="Row lands in Postgres">
    Each submission becomes one row in `metaweave_report` plus child rows in 11 satellite tables (events, bunker ROBs, upcoming ports, FOWE periods, scrubber breakdowns, BDN deliveries, biofuels, SOF activities, cargo, month-end, berthing). Re-submitting a corrected report **replaces** the previous one — `(vessel_id, report_type, report_datetime_utc)` is unique, and CASCADE deletes wipe the children.

    See [Data model](/pipeline/data-model).
  </Step>
</Steps>

## Where to go next

<CardGroup cols={2}>
  <Card title="Form overview" icon="file-pen" href="/form/overview">
    Tabs, layout, sidebar, validation philosophy.
  </Card>

  <Card title="History setup" icon="database" href="/history/setup">
    How office configures, vessel links, what archives per Submit.
  </Card>

  <Card title="Pipeline overview" icon="server" href="/pipeline/overview">
    ETL diagram and stage-by-stage walkthrough.
  </Card>

  <Card title="Guidelines PDFs" icon="book" href="/form/guidelines-pdf">
    Summary of the seven guideline documents shipped with the form bundle.
  </Card>
</CardGroup>
