Projects
Seed-to-sale operations platform for cannabis organisations

CannaHub

Multi-tenant B2B ecosystem of six applications covering cultivation, IoT monitoring, medical records, commerce and compliance for 6+ organisations in Argentina.

Role
Lead — architecture across web, mobile, commerce and content
Period
2024 — Present
Type
Platforms
Status
production
373k
Lines of code
223
API routes
38
Domain modules
6
Applications
01

Showcase

3 videos
Loading showcase
34sCannaHub — The crop board, the nine-stage lifecycle, genetics and live IoT. Rendered live with Remotion, not a video file.
02

Walkthrough

Recorded in the product
The pitch cut of the whole platform — members, health, genetics, cultivation, products, inventory, dispensing and invoicing, all inside one deployment.
The farm side: seed bank, plant tracking and the crop calendar that turns a grow into scheduled stages instead of a spreadsheet.
Live sensor status across the grow rooms — connected, alerting or dropped — pulled through the Growcast integration in real time.
Inventory as an audit trail rather than a number: every stock movement typed, sourced and timestamped, with receipts alongside it.
The member roster: onboarding progress, membership tier and REPROCANN status side by side, so dispensing limits are never a guess.
The clinical record: patients, REPROCANN standing and last consultation, treated with the same rigour as the commerce data next to it.
The dashboard an operator actually opens every morning — revenue, active members, live crops and orders, in one screen.
03

Overview

Cannabis clubs in Argentina run a business that is part farm, part pharmacy, part retailer, and entirely regulated. The legal requirement is traceability: prove where any gram came from, from the seed that produced it to the member it was dispensed to. Most of them were doing this in spreadsheets.

CannaHub is the platform that replaced them. Six applications share one Medusa commerce backend and a Strapi CMS: an admin webapp carrying 38 domain modules, a React Native companion for members, a marketing site, a documentation portal, a scraper and a demo surface.

Each organisation gets its own subdomain and its own brand — high-up, familias, medicann and others each run on app.cannahub.tech under their own logo, with data isolated from every other tenant, and one of them on its own domain entirely.

The admin webapp alone is 293,000 lines and 223 API routes, all of it behind a BFF layer — no UI component ever calls Medusa, Strapi or the IoT API directly.

04

Architecture

3 diagrams
01

Six applications, one backend

never directAdmin webapp293k lines, 38 modulesMember appReact NativeMarketing siteDocs portalDemo surfaceScraperBFF layer223 routestenant header, authMedusa commerceStrapi CMSGrowcast IoT

Scroll to pan

The BFF is written into the project constitution as a law: no UI component and no feature service may reach Medusa, Strapi or Growcast directly. Auth headers, tenant context and error shaping live in exactly one place.
02

Seed to sale

CommerceCultivationtelemetrySpace telemetrytemp, humidity, CO2Crop andgrowth cycleSeed andgeneticsPlantHarvestand yieldBatchProductstrain, THCOrderDispensingMemberAudit logRes. 1780/2025Trace any gramback to its plant

Scroll to pan

The legal requirement reads backwards: given a gram, prove the plant. That single arrow is why every harvest, transfer and dispensing event is an immutable link rather than a stock adjustment.
03

Cannabis-shaped inventory

Extended for cannabisMedusa core, inheritedProductVariantPrice listOrder and checkoutStrain geneticsBatch lineageback to a plantOrganisation andtier pricingPer-memberdispensing limits

Scroll to pan

Medusa already knows how to run a checkout. Extending its product model instead of forking it is what bought years of battle-tested commerce logic in exchange for a handful of attributes.
05

Screens

10 captures
CannaHub cultivation board with crops and their growth-stage timelines
01Cultivation — every crop with its growth cycle, space and harvest
CannaHub strain library showing genetics with THC and CBD levels
02Strain library — genetics with THC, CBD and terpene profiles
CannaHub organisation settings with a tenant logo replacing the platform logo
03White-label: the organisation’s own brand replaces the platform’s
CannaHub audit log listing who accessed or modified sensitive data
04Audit log — who touched sensitive data, for Res. 1780/2025
CannaHub product catalogue table
05Product catalogue with cannabis-specific attributes
CannaHub analytics dashboard
06Analytics across cultivation, orders and inventory
CannaHub documentation portal
07The documentation portal — one of the six applications
  • CannaHub member app dispensary catalogue
    Member app — dispensary
  • CannaHub member app orders list
    Member app — orders
  • CannaHub member app appointments screen
    Member app — appointments
06

Modules

7 units
01

Cultivation

The farm half of the business, modelled as a chain rather than a stock count — this is what makes traceability possible.

  • Crops, plants and growth cycles
  • Seed and strain library with genetics
  • Harvest scheduling and yield records
  • Spaces, lights and fertiliser tracking
02

IoT & environment

Live environmental telemetry from the grow rooms, integrated through the Growcast API.

  • Temperature, humidity and CO2 streams per space
  • Out-of-range alerting
  • Historical series and visualisation
  • Sensor management and calibration state
03

Commerce

A Medusa backend extended to carry product attributes that off-the-shelf commerce does not have.

  • Products with strain genetics and batch lineage
  • Price lists per organisation and membership tier
  • Orders, dispensing and fulfilment
  • Inventory, procurement and storage locations
04

Members

Who is allowed to buy what, and the paperwork that proves it.

  • Member records and onboarding flows
  • Membership tiers and renewals
  • Document storage and verification
  • Per-member dispensing limits
05

Medical

The clinical side: these are patients as much as customers, and the records have to hold up.

  • Doctor records and prescriptions
  • Appointment scheduling
  • Member health history
  • Treatment tracking
06

Operations

Day-to-day running of the organisation, plus the reporting the regulator asks for.

  • Tasks and recurring task plans
  • Workforce and locations
  • Audit log of every access to sensitive data (Res. 1780/2025, AAIP 47/2018)
  • Seed-to-sale traceability and compliance reporting
  • Invoices, transactions and analytics
07

Applications

One backend, six surfaces, each with its own audience and its own repository conventions.

  • Admin webapp — 293k lines, the operational core
  • React Native companion for members
  • Marketing website and MDX documentation portal
  • Strapi CMS and a scraper service
07

Engineering

What was hard
01

Cannabis-shaped inventory on generic commerce

Medusa has products, variants and stock. It does not have strain genetics, THC and CBD levels, or batch lineage back to a specific plant. Extending its product model to carry those without forking the engine is what let the platform inherit years of battle-tested commerce logic instead of rewriting checkout.

02

Traceability constrains everything upstream

Proving where a gram came from is not a reporting feature you add later — it is a shape the data model has to have from the first migration. Every harvest, transfer and dispensing event is an immutable link in a chain, which dictated decisions all the way up into how the UI records a routine task.

03

Six tenants, one deployment

Organisation scoping runs through every query and every API route via a mandatory tenant header. Six businesses share one deployment while never seeing each other’s data, pricing or members, and each gets a storefront that looks like their brand rather than like CannaHub.

04

A BFF layer as an architectural law

No UI component or feature service may call Medusa, Strapi or Growcast directly — everything routes through the app’s own API layer, which owns auth headers, tenant context and error shaping. Written into the project constitution because it is the rule that quietly rots first when a deadline appears.

08

AI harness

7 pieces

CannaHub spans eight repositories, so the harness is about consistency across them: a written constitution the architecture is checked against, ecosystem-wide conventions, and bespoke skills that scaffold and document a module in the house shape.

01Context

An architecture constitution

Written as numbered, non-negotiable principles: BFF-first (the UI never touches Medusa, Strapi or Growcast directly), mandatory tenant isolation on every data endpoint, the exact shape of a feature module down to the directory tree, and TypeScript strict with no escape hatches. Architecture decisions stop being re-litigated every session.

  • cannahub-webapp/.specify/memory/constitution.md
02Context

Ecosystem-wide conventions

A root CLAUDE.md maps all six applications and the shared backend; CONVENTIONS.md pins the decisions that must not drift between them — Lucide over react-icons, Radix over Headless UI, locale codes, commit format, the shared-code candidates queued for extraction. Each app then carries its own CLAUDE.md for local detail.

  • CLAUDE.md
  • CONVENTIONS.md
03Skills

Bespoke skills for repetitive work

create-feature scaffolds a module in the constitutional shape — components, overlays, query-key factory, queries, mutations, services, types, views — and wires translation keys for all three locales. create-api-route, debug-api and review-changes cover the other paths worn into the codebase. The house pattern is executable rather than described.

  • cannahub-webapp/.claude/skills/
04Skills

Documentation generated from the source

A sync-docs skill reads the actual route handlers and feature types for a domain and regenerates that domain’s MDX page in the docs app — endpoint table, request and response types, React Query examples, error codes. Documentation drift stops being a manual chore that nobody wins.

  • .claude/skills/sync-docs/SKILL.md
05Guardrails

Rules split by concern

Separate rule files for components, API routes and testing, loaded per task rather than as one wall of context. A component task gets component rules; a route task gets the route contract.

  • cannahub-webapp/.claude/rules/
06Skills

Spec Kit with git extensions

The full spec-driven pipeline — constitution, specify, clarify, plan, tasks, analyze, implement, checklist — plus git extension skills for feature branches, validation, commits and remotes. Large changes get planned in writing before an agent starts editing.

  • cannahub-webapp/.specify/workflows/
07MCP

GitHub MCP

The GitHub MCP server is wired into the webapp so agents can read issues and pull requests as first-class context instead of having the state of the work pasted at them.

  • cannahub-webapp/.mcp.json
09

Stack

9 entries
  • 01Next.js 16
  • 02React Native
  • 03TypeScript
  • 04Medusa.js
  • 05Strapi
  • 06Tailwind CSS
  • 07Radix UI
  • 08React Query
  • 09Zustand