Skip to content

Repository files navigation

TrackingTHC

TrackingTHC is a cannabis retail operations prototype for exploring package cost visibility, import review, audit trails, reconciliation workflows, and compliance-adjacent data review.

It is not a full point-of-sale system, and it is not production SaaS yet. This repo is a portfolio/demo app shell for proving a practical idea:

Messy cannabis operations data can be turned into structured, reviewable artifacts that operators, finance teams, and technical teams can actually understand.

The current demo surfaces are:

  • /moby-runs — MOBY Mission Control, a static run-manifest viewer.
  • /import-review — a static MOBY import sidecar viewer.
  • Older operational prototype pages for inventory, products, sales, audit, and fake Metrc sync concepts.

MOBY Mission Control

TrackingTHC includes a static demo viewer for MOBY run manifests at:

/moby-runs

MOBY Mission Control reads committed sample moby-run-manifest.json files and displays:

  • what each module ran
  • which source files were used
  • which artifacts were produced
  • which warnings need review
  • how each run fits into the broader MOBY module ecosystem

The current demo uses a fictional Desert Bloom Retail - Las Vegas scenario across four MOBY-compatible modules:

ModuleCategoryPurpose
trackingthc-import-mapperImport / Data NormalizationNormalizes messy POS/package exports into reviewable artifacts.
invoice-cost-spreaderCosting / COGSAllocates invoice-level costs and discounts for landed-cost review.
cannabis-approval-routerApprovals / Decision RoutingRoutes operational approval requests with evidence-aware warnings.
cannabis-shift-handoffHandoffs / Operational MemoryTurns messy shift notes into structured follow-up items.

The viewer is intentionally read-only and static for this slice. It does not use uploads, background jobs, API ingestion, local folder scanning, or database persistence.

MOBY Mission Control

What /moby-runs shows

The MOBY Run History viewer loads committed sample manifests from:

public/samples/moby-run-manifests/

It also loads static module display metadata from:

public/samples/moby-module-registry.json

The page displays:

  • Run metadata: runId, runType, generatedBy, status, and generatedAt
  • Summary counts: total runs, module count, warning count, and artifact count
  • Friendly module labels, categories, descriptions, and business purpose
  • Source info: system, source file name, source path, and received timestamp
  • Artifacts: label, role, format, path, and artifact ID
  • Warnings: severity, code, field, row number, linked artifact, and message
  • Compact metadata for the selected run
  • Module and status filters for exploring the demo data

The module registry is display metadata only. It does not replace moby-run-manifest.json, and unknown modules still render using manifest data.

/import-review MOBY JSON Sidecar Viewer

The Import Review Viewer loads a sample MOBY sidecar from:

public/samples/moby-import-example.json

Local route:

/import-review

The viewer displays:

  • Schema metadata: schemaVersion, generatedBy, and generatedAt
  • Import summary: run ID, source, status, row count, warning count, package count, and source file
  • Mapping profile: source fields, canonical MOBY fields, and mapping status
  • Validation issues: severity, code, field, row number, and message
  • Packages: package label, product name, quantity, unit cost, total cost, and vendor

Viewer difference

/import-review and /moby-runs are related, but they answer different questions.

RouteReadsFocus
/import-reviewmoby-import.jsonOne import workflow: mappings, validation issues, packages, and sidecar contents.
/moby-runsmoby-run-manifest.jsonRun history across MOBY modules: run metadata, sources, artifacts, warnings, and summary counts.

Neither route stores uploaded files or writes database records in the current demo slice.

MOBY-compatible module pattern

A MOBY-compatible module does useful work, writes its normal output artifact, and emits a moby-run-manifest.json receipt describing the run.

The pattern is intentionally boring:

  1. Preserve existing behavior.
  2. Add explicit artifact output mode when needed.
  3. Write the module's normal result artifact unchanged.
  4. Write moby-run-manifest.json next to it.
  5. Keep module-specific business logic inside the module.
  6. Use moby-core as the shared contract language.
  7. Avoid surprise file output.
  8. Test both old behavior and run-output behavior.

Current aligned modules:

ModuleRoleMOBY artifact behavior
moby-coreShared TypeScript contractsDefines run manifest, artifact, warning, source, summary, audit/workflow, and domain types.
trackingthc-import-mapperData normalizationEmits normalized import outputs and moby-run-manifest.json.
invoice-cost-spreaderCost allocation / COGSEmits spread-result.json and moby-run-manifest.json.
cannabis-approval-routerApproval decision routingEmits approval-result.json and moby-run-manifest.json.
cannabis-shift-handoffOperational handoff memoryEmits handoff output and moby-run-manifest.json.

Ecosystem architecture

TrackingTHC is the viewer/app shell for the MOBY demo ecosystem.

moby-core
-> trackingthc-import-mapper
-> invoice-cost-spreader
-> cannabis-approval-router
-> cannabis-shift-handoff
-> trackingthc.com
  • moby-core defines the shared contracts and vocabulary.
  • MOBY-compatible modules emit moby-run-manifest.json files that describe module runs, sources, artifacts, warnings, and summary counts.
  • trackingthc-import-mapper also emits moby-import.json sidecars for import review.
  • trackingthc.com consumes committed sample sidecars and run manifests and displays them for review, audit prep, and future reconciliation workflows.

This repo should not need to understand each module's internals. It only needs versioned artifacts and manifest contracts.

Demo routes

RouteDescription
/dashboardMain operational dashboard.
/moby-runsStatic MOBY run manifest viewer / Mission Control.
/import-reviewStatic import sidecar review page.
/inventoryInventory-oriented demo pages.
/productsProduct-oriented demo pages.
/salesSales demo page.
/sync-statusSync status demo page.
/auditAudit trail demo page.

Current status

  • Static/client-side import review is working.
  • Static/client-side MOBY run history is available at /moby-runs.
  • /moby-runs uses a connected Desert Bloom Retail demo scenario.
  • /moby-runs loads static module registry metadata for friendly labels and categories.
  • No auth is required for /import-review or /moby-runs.
  • No database setup is required for /import-review or /moby-runs.
  • The pages currently use bundled samples rather than upload flows, local folder scanning, or persisted import history.

Static sample files

Sample MOBY run manifests live in:

public/samples/moby-run-manifests/

Module display metadata lives in:

public/samples/moby-module-registry.json

Sample MOBY import sidecar lives at:

public/samples/moby-import-example.json

These files power the demo pages without requiring database setup.

Local development

Install dependencies:

npm install

Start the dev server:

npm run dev

Open the app:

http://localhost:3000

Open MOBY Mission Control directly:

http://localhost:3000/moby-runs

Open the Import Review Viewer directly:

http://localhost:3000/import-review

Verification

Run the local checks:

npm run typecheck
npm run lint
npm run build

Tech stack

  • Next.js App Router
  • React
  • TypeScript
  • Tailwind CSS
  • Prisma/PostgreSQL for earlier operational prototype areas
  • Static JSON samples for the current MOBY demo slice

Current scope

This project is a portfolio/demo prototype. The MOBY Mission Control page currently reads committed static sample files from public/samples/. It is not yet a production ingestion system.

Intentionally not included in this slice:

  • Upload flows
  • Background jobs
  • API ingestion for run manifests
  • Database persistence for MOBY runs
  • Auth changes
  • File-system scanning of generated run folders
  • A full POS workflow
  • A production compliance integration

Roadmap

Near-term ideas:

  • Keep improving the /moby-runs demo experience.
  • Add more screenshots and demo notes for the MOBY workflow.
  • Create one generated end-to-end sample chain from real module outputs.
  • Add a sample selector for multiple generated MOBY sidecars.
  • Add a manifest selector or local-file review mode for MOBY run history.
  • Explore a database-backed MOBY run history only after the static demo proves the workflow.

Future workflow ideas:

  • Reconciliation prep workflow
  • Finance review workflow
  • Package cost review workflow
  • Approval trail review workflow
  • Shift handoff review workflow

Why this exists

Cannabis retail operations generate messy data across POS exports, invoices, approvals, shift notes, compliance systems, and human workflows.

TrackingTHC explores a small, practical path toward making those workflows more visible, auditable, and explainable.

MOBY is the guide dog for the chaos: it does not replace the operator, but it leaves clean paw-print receipts for what happened.

About

Cannabis operations app shell for reviewing versioned MOBY import sidecars, with audit and reconciliation workflow foundations.

Topics

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages