🌱 Mari's Gardens — B2B Ordering Portal

Prepared by VtKL

57h
Human Hours
All 3 phases
$3,300
AI Inference
All 3 phases
10h/mo
Maintenance
+ ~$75 inference
12-16wk
Timeline
3 phases
$0/mo
Infra Cost
Free tiers
Section 01

Executive Summary

Cost, timeline, and expected return — everything Brendon needs for a go/no-go decision.

57h
Human Expert Hours
~$3,300
AI Inference Cost
12-16 wk
Total Timeline
<2 mo
Payback Period
PhaseWhat's DeliveredHuman HoursAI InferenceTimeline
Phase 1 — MVPAdmin portal, customer ordering, guest orders w/ PDF, QuickBooks automation, packing sheets, standing orders35h~$2,0006-8 weeks
Phase 2 — Self-ServiceCustomer self-management, order analytics, delivery tracking, mobile optimization12h~$6503-4 weeks
Phase 3 — Email IntakeAI-powered email-to-order parsing for clients who prefer email10h~$6502-3 weeks
Total57h~$3,30012-16 weeks

This project uses AI-accelerated development with Claude Opus 4.7. The AI agent handles the bulk of code generation, testing, and iteration — Brendon pays only for human expert hours (architecture, code review, QuickBooks setup, UAT support) and AI inference costs. A comparable system built by a traditional agency would cost $40,000-80,000+ and take 4-6 months. Phase 1 alone eliminates ~$27-31K/year in manual processing labor — the investment pays for itself within the first two months.

💰

Pricing Model

Human expert hours billed at agreed rate. AI inference billed at cost. No markup on AI time — the AI agent's labor is included at no charge.

📉

vs. Traditional Agency

$40-80K+ and 4-6 months at a traditional agency. Our approach: ~$3,300 inference + 57h human across all 3 phases.

🎯

Phase Independence

Each phase delivers standalone value. Brendon can stop after Phase 1 and still have a fully functional system. Phases 2 & 3 are optional enhancements.

Monthly Operational Cost After Launch

ServiceTierMonthly CostNotes
Supabase (DB + Auth + Storage)Free$050K MAU, 500MB DB, 1GB storage — more than sufficient
Cloudflare Workers (Frontend)Free$0100K requests/day
QuickBooks Online APIBuilder (Free)$0500K reads/month
Resend (Transactional Email)Free$03,000 emails/month — sufficient for 70 clients
Total$0/monthAll services within free tiers for this volume
Section 02

The Problem & Our Solution

A thriving 70+ client agricultural operation bottlenecked by manual email ordering and paper processes.

Mari's Gardens is Hawaii's largest aquaponics farm — 18 acres in Mililani, run by the Lau family across 4 entities with 100+ employees. They supply 70+ B2B clients including top restaurants (MW Restaurant, Pai Honolulu, Halekulani Hotel, Roy's Ko'olina), major retailers (Safeway, Foodland), and even formerly supplied all McDonald's Hawaii. The farm itself is highly automated: Autogrow systems for nutrients, Link4 for greenhouse climate, tested IDEC Japanese oxygen technology. The bottleneck isn't production — it's the order-to-invoice pipeline.

The Problem — Six Pain Points

📧

Unstructured Email Orders

70+ clients each send orders in their own format — lists, paragraphs, replies. No validation, no standardization. "3 cases romaine" vs "the usual."

~24h/Week Manual Processing

One staff member spends ~4h/day reading, interpreting, and transcribing emails into orders. ~$27-31K/year pure labor cost for data entry.

📋

Paper Packing Sheets

Orders printed, physically handed to packing crew. Lost paper = lost order. No digital trail, no status tracking.

⚠️

Late Shortage Discovery

Stock shortages only discovered during packing in the field. Client notified after the fact — no time for proactive substitutions.

🔄

Standing Orders Re-Entered

~10 clients with identical weekly orders. Each re-entered manually every cycle. No templates, no automation.

📗

Manual QB Invoicing

Every order re-keyed into QuickBooks. Double entry = errors, missed invoices, delayed billing, revenue leakage.

Our Solution — B2B Ordering Portal

A purpose-built ordering portal (not a payment portal) with two interfaces sharing one backend. The Admin Portal is Brendon's command center — products, customers, orders, packing, QuickBooks. The Customer Portal is where restaurants and retailers place orders in under 60 seconds. We also include guest ordering so new potential clients can order without an account — a natural acquisition funnel.

Key design decision: this is ordering, not payment. Brendon's B2B clients have existing payment terms. We create the order and the QuickBooks invoice — payment flows through existing channels. This eliminates PCI compliance requirements and payment processor complexity entirely.

🔐

Admin Portal

Product catalog with multi-image + carousel, customer management with invite-based onboarding, order processing, packing sheets, standing orders, QuickBooks sync. Role-based: Owner (full) vs Staff (limited).

🛒

Customer Portal (Authenticated)

Visual catalog with real-time availability, image carousels, one-click ordering, order history, standing order management. Pre-populated account from admin invite — zero friction.

👤

Guest Ordering

New clients browse and order without login. Form checkout generates PDF for records. Admin converts guests to registered customers with one click.

Section 03 — Most Important

B2B Customer Journeys

Four distinct journeys mapped end-to-end: the current manual process, the new authenticated flow, the guest flow, and the standing order cycle.

We mapped every touchpoint from the client's perspective and Brendon's operations. The current flow has seven manual steps with five failure points. The new flow eliminates all five failure points and reduces manual touchpoints to two: the client submitting and Brendon confirming. Everything else is automated. We've defined four distinct journeys because different customer types interact with the system differently.

❌ Journey A — Current Process (Manual)

This is how every order flows today, for all 70+ clients.

1

Client Composes Email Order

Restaurant manager writes email with product names, quantities, delivery date — in whatever format they prefer. No template, no structure.

⚠️ "3 cases romaine" vs "romaine x3" vs "the usual lettuce" — zero standardization across 70+ clients
2

Staff Opens, Reads, Interprets Each Email

One team member opens each email, mentally deciphers the request, maps to products. ~4 hours/day, 5 days/week.

⚠️ Human interpretation errors. "Baby romaine" vs "romaine hearts" — same product? Ambiguity causes wrong fills
3

Order Printed & Delivered to Packing Crew

Interpreted order formatted, printed on paper, physically brought to the packing area.

⚠️ Paper trail — lost printout = lost order. No digital record of what was requested vs. packed
4

Crew Picks Products in Field

Packing crew takes paper to greenhouse/field, picks items. Only NOW do they discover if quantity is sufficient.

⚠️ CRITICAL: shortage discovered at worst moment — after promise to client, during fulfillment
5

Shortage → Manual Client Contact

Crew notifies Brendon. Brendon calls/emails client to negotiate substitution or partial fill. Reactive, not proactive.

⚠️ Client relationship damage. Could have been avoided with availability data before ordering
6

Manual QuickBooks Invoice

After order ships, staff creates invoice in QBO — re-entering all line items, quantities, prices by hand.

⚠️ Double data entry. Invoices forgotten or delayed. Revenue leakage risk estimated at 2-5%
7

Client Pays via Existing Terms

Check, ACH, or existing arrangement. No change proposed — this works.

VS

✅ Journey B — Authenticated B2B Client (New Process)

The primary ordering flow for the 70+ existing clients after onboarding to the portal.

1

Client Receives Invitation & Activates Account

Brendon creates client profile in admin (name, contact, address, delivery schedule, tier). Client receives branded email with activation link. Clicks → sees pre-populated profile → confirms/adjusts → sets password or chooses magic link. Zero data entry by client.

✅ One-time setup. All data pre-filled by Brendon's team. Client ready to order in 30 seconds
2

Client Logs In & Browses Catalog

Visual product grid with real photos (multi-image carousel), short descriptions, prices, and real-time availability. Filter by category (Leafy Greens, Herbs, Microgreens, Root Vegetables, Fish). Search by name.

✅ Client sees what's available BEFORE ordering — no surprises, no shortages
3

Client Builds Order (<60 seconds)

Selects products, sets quantities, sees running total. Can click "Repeat Last Order" to reload a previous order with one click. Low-stock items show warning. Out-of-stock items disabled — impossible to order unavailable product.

✅ Average order time: under 60 seconds for repeat clients. Zero ambiguity on product selection
4

Client Submits → Instant Confirmation

Reviews order summary (all items, quantities, prices, estimated total, preferred delivery date). Submits. Receives immediate on-screen confirmation with order number + confirmation email.

✅ Client knows immediately that order was received. No "did they get my email?" anxiety
5

Admin Confirms → Packing Sheet Auto-Generated

Brendon sees order in admin dashboard. One-click confirm. If quantity needs adjustment, admin modifies and system notifies client automatically. Upon confirmation: formatted packing sheet generated (digital + printable).

✅ Packing crew gets clean, structured pick list. No more handwritten or ambiguous sheets
6

QuickBooks Invoice Created Automatically

On confirmation, system creates Invoice in QBO via Accounting API — correct line items, quantities, prices. Zero manual entry. Invoice number cross-referenced with portal order number.

✅ Eliminates double data entry. No missed invoices. Clean accounting trail
7

Client Pays via Existing Terms

Same payment flow as today. Portal is ordering only — no payment disruption.

🆕 Journey C — Guest (New Client / Walk-In)

For new prospects or one-time buyers who discover Mari's Gardens. This is the acquisition funnel.

1

Guest Browses Catalog (No Login Required)

Full product catalog visible — images, descriptions, prices, availability. Same visual experience as authenticated clients. "Already a customer? Log in here" prompt visible.

2

Guest Builds Order

Same ordering flow — select products, set quantities, see totals. No restrictions vs. authenticated flow.

3

Guest Fills Business Form at Checkout

Required fields: business name, contact name, email, phone, delivery address, preferred delivery date. Optional: business type, delivery window, special instructions.

4

Order Submitted → PDF Generated

System generates formatted PDF with: Mari's Gardens branding, order details, line items, totals, guest business info, order number. PDF downloadable immediately + sent via email.

✅ Guest has a professional receipt for their records — critical since they have no portal account for history
5

Admin Reviews Guest Order

Appears in dashboard with "Guest Order" flag. Admin can: approve and process normally, OR reject with reason. Can also convert guest to registered customer with one click — form data pre-fills the customer creation.

✅ Natural acquisition funnel: guest → one-time buyer → registered client

🔁 Journey D — Standing Order Cycle

For the ~10 clients with recurring weekly orders. Eliminates repetitive re-entry entirely.

1

Admin Creates Standing Order Template

Sets up for a client: specific products, quantities, and recurring schedule (e.g., "Every Tuesday"). Template saved.

2

System Auto-Generates Pending Order (T-48h)

48 hours before scheduled delivery, system creates a pending order from the template. Checks current availability against requested quantities.

3

Client Receives Notification

Email: "Your standing order for Tuesday is ready. Confirm as-is or adjust by Monday 6pm." Link to portal for one-click confirm or modification.

4

Client Confirms or Adjusts

One-click confirm if unchanged. Or: modify quantities, add/remove items, then confirm. If deadline passes with no action → configurable auto-confirm or expiry.

✅ Standing orders that were manual re-entry (10+ min each) now take literally one click
5

Normal Order Flow Continues

Confirmed standing order enters the same pipeline: packing sheet generated, QuickBooks invoice created, delivery processed.

Section 04

Business Rules & Acceptance Criteria

The rules that govern how the system behaves, and the testable criteria that define "done" for every capability.

These rules come from three sources: (1) how Brendon's operation actually works today, (2) B2B wholesale industry norms, and (3) product decisions we made during our design sessions. Every rule is deliberate. Every acceptance criterion is testable.

BR-1: Access Control

Rules

  • Three access levels: Admin (Owner + Staff), Customer (Authenticated B2B), Guest (Unauthenticated)
  • Owner role: full system access — products, customers, orders, settings, QB, staff management
  • Staff role: can view/update orders, update availability, generate packing sheets. Cannot: delete products, manage staff, access settings, manage QB connection
  • Customer role: can browse catalog, place orders, view own order history, manage own standing orders. Cannot see other clients' data
  • Guest: can browse catalog, place orders via form. No history, no standing orders, no account management
  • No public self-registration. All customer accounts created by admin and activated via invite

Acceptance Criteria

  • Owner logs in → sees all sidebar menu items including Settings and QuickBooks
  • Staff logs in → sees limited menu (no Settings, no QuickBooks, no Staff Management)
  • Staff attempts to delete product → action blocked with "Insufficient permissions" message
  • Customer logs in → sees only Customer Portal navigation (Catalog, My Orders, Standing Orders, Account)
  • Customer attempts to access admin URL → redirected to customer portal
  • Guest accesses catalog → full product browsing works, no login required
  • Guest attempts to access "/my-orders" → prompted to log in
  • Deactivated customer attempts login → "Account inactive — contact Mari's Gardens" message

BR-2: Product Catalog

Rules

  • Each product has: name, short description (max 120 chars), long description (rich text), category, unit (head, bunch, lb, case, tray, each), price per unit, availability quantity, status (Active/Inactive/Seasonal), up to 10 images
  • First image = primary (shown in catalog grid). Images reorderable via drag-and-drop
  • Product with availability = 0 shows "Out of Stock" and cannot be added to orders
  • Product with status = Inactive or Seasonal does not appear in customer catalog
  • Product deletion is soft — preserves order history references, removes from catalog
  • Categories are admin-manageable (CRUD). A product belongs to exactly one category

Acceptance Criteria

  • Admin creates product with all required fields + 4 images → product appears in customer catalog within 30 seconds
  • Admin updates price → customer sees new price on next page load (no cache delay >60s)
  • Admin sets availability to 0 → customer sees "Out of Stock", cannot add to order
  • Admin reorders images → customer carousel reflects new order
  • Admin sets status to Inactive → product disappears from customer catalog, admin still sees it with "Inactive" label
  • Upload image >5MB → rejected with "Max file size: 5MB" error
  • Upload non-image file → rejected with "Only JPEG, PNG, and WebP supported"

BR-3: Customer Management & Onboarding

Rules

  • Customer profile: business name, contact name, email, phone, delivery address(es), delivery schedule, tier (Restaurant/Retail/Wholesale), internal notes
  • Admin creates profile → sends invite → customer receives email → clicks link → sees pre-filled data → confirms → account active
  • Invite link valid for 7 days (configurable). After expiry: "Link expired" with contact info
  • Guest-to-customer conversion: admin clicks "Convert" on guest order → customer creation form pre-fills from guest form data
  • Customer lifecycle: Invited → Active → Inactive. Deactivation revokes access, preserves history

Acceptance Criteria

  • Admin creates customer with all fields → sends invite → customer receives email within 60 seconds
  • Customer clicks invite → profile shows admin-entered data (business name, address, etc.) pre-filled
  • Customer modifies phone number during activation → change persisted correctly
  • Invite link clicked after 8 days → "Link expired" page with "Contact Mari's Gardens" CTA
  • Admin resends invite → new email arrives, new link works, old link invalidated
  • Admin converts guest to customer → all guest form fields pre-populate customer form
  • Admin deactivates customer → customer's next login attempt shows "Account inactive" message

BR-4: Ordering

Rules

  • Orders flow through statuses: New → Confirmed → Packed → Delivered
  • Only admin can advance order status
  • Admin can adjust quantities before confirming — triggers automatic client notification with change details
  • Client can cancel order only while status = New. After Confirmed, must contact Brendon
  • Availability decremented on order confirmation, not on submission (prevents phantom holds)
  • "Repeat Last Order" loads previous order's items; checks current availability; flags any unavailable items
  • Guest orders: same as authenticated, but status starts as "Pending Review" (requires admin approval before entering normal flow)
  • Rate limit: max 5 guest orders per email address per day

Acceptance Criteria

  • Client submits order → status = New → visible in admin within 5 seconds
  • Admin adjusts quantity from 10 to 6 → confirms → client receives email with adjustment details
  • Two clients order same product (3 available): Client A orders 2, Client B orders 2 → first confirmed gets 2, second sees updated availability (1 left)
  • Client clicks "Repeat Last Order" → 2 of 6 items now OOS → loaded with 4 items, 2 flagged "Currently Unavailable"
  • Guest submits → order shows as "Pending Review (Guest)" in admin
  • Same email submits 6th guest order in 24h → rejected with "Order limit reached" message

BR-5: Packing Sheets

Rules

  • Generated automatically on order confirmation
  • Contents: product name, quantity, unit, bin/location (if configured), check-off boxes
  • Can be generated per-order or batched by delivery date
  • Optimized for print (A4/Letter) and tablet display

BR-6: Standing Orders

Rules

  • Template: client + products + quantities + schedule (day of week + frequency)
  • System generates pending order 48h before scheduled delivery
  • Client has until configurable deadline (default: day before, 6pm) to confirm or adjust
  • After deadline: configurable auto-confirm (default) or expiry
  • If product in standing order is OOS at generation time → flagged in pending order + client notified
  • Client and admin can both edit template at any time; changes apply from next cycle

BR-7: QuickBooks Integration

Rules

  • Uses Accounting API only (not Payments API) — this is ordering, not payment processing
  • OAuth 2.0: access token (1h), refresh token (100 days rolling). Auto-refresh on expiry
  • Invoice created in QBO on order confirmation with correct line items, quantities, prices
  • Customer matching: by business name. Auto-creates QBO customer if not found
  • Product matching: admin maps portal products to QBO Items. Fallback: match by name
  • Failed sync: retry 3x with exponential backoff. If all fail: flag in admin, allow manual retry
  • Sync can be disabled per-order (for test/internal orders)

BR-8: PDF Generation (Guest Orders)

Rules

  • Generated server-side on guest order submission
  • Contents: Mari's Gardens branding, order number, date, guest business info, line items with qty/price/subtotal, estimated total, "This is not an invoice" disclaimer
  • Available for immediate download + sent via email to guest
  • Also accessible by admin from the guest order detail view

BR-9: Email Notifications

Rules

  • Provider: Resend (transactional email service) via Supabase Edge Functions
  • Client triggers: order submitted, order confirmed, order adjusted, shortage alert, standing order reminder, invitation
  • Admin triggers: new order received, new guest order, QB sync failure
  • All emails: Mari's Gardens branding, clear subject lines, unsubscribe option
Section 05

User Stories & BDD Scenarios

Formal user stories using the standard As a [role], I want [feature], so that [benefit] framework, with BDD acceptance scenarios in Given/When/Then format for test direction.

These user stories define what gets built. Each is a thin vertical slice — independently deliverable, independently testable. The BDD scenarios provide precise test specifications that can be directly translated into automated tests. We've prioritized them as MUST (Phase 1 launch blocker) and SHOULD (Phase 1 target, can descope if needed).

Epic 1 — Authentication & Access Control

US-1.1: Admin Login

Must
As an admin (owner), I want to log in with email and password, so that I can securely access the management portal.
Scenario: Successful admin login
  Given I am on the admin login page
  And I have valid owner credentials
  When I enter my email and password and click "Log In"
  Then I am redirected to the admin dashboard
  And I see the full sidebar navigation including Settings and QuickBooks

Scenario: Invalid credentials
  Given I am on the admin login page
  When I enter incorrect credentials
  Then I see "Invalid email or password" error
  And my account is not locked after 1 failed attempt

US-1.2: Customer Invite & Activation

Must
As an admin, I want to create a customer account and send an invitation email, so that B2B clients can activate their portal access with pre-filled data.
Scenario: Complete invite-to-activation flow
  Given I am logged in as admin
  And I have filled in customer details: "MW Restaurant", "Michelle W.", "mw@mwrestaurant.com"
  When I click "Create & Send Invite"
  Then the customer appears in my customer list with status "Invited"
  And Michelle receives an email with activation link within 60 seconds

Scenario: Customer activates account
  Given I am Michelle and I received the invitation email
  When I click the activation link
  Then I see a profile page with business name, address, and contact pre-filled
  And I only need to set my password to complete activation
  And my status changes to "Active" in admin

US-1.3: Guest Browsing (No Auth)

Must
As a potential new client, I want to browse the product catalog without creating an account, so that I can evaluate Mari's Gardens' offerings before committing.
Scenario: Guest accesses catalog
  Given I am not logged in
  When I navigate to the portal URL
  Then I see the full product catalog with images, descriptions, prices, and availability
  And I can add items to my order
  And I see a "Already a customer? Log in" prompt

Epic 2 — Product Catalog Management

US-2.1: Product CRUD

Must
As an admin, I want to create, edit, and deactivate products with all details (name, descriptions, price, unit, category, availability, status), so that the catalog accurately reflects what's available for sale.
Scenario: Create new product
  Given I am logged in as admin on the Products page
  When I click "Add New Product" and fill in: name "Longan", short desc "Fresh longan fruit, sweet and fragrant", price "$6.00/lb", category "Fruit", availability "25"
  Then the product appears in the admin product list
  And the product is visible in the customer catalog within 30 seconds

Scenario: Update availability
  Given product "Baby Romaine" has availability 5
  When I set availability to 0 and save
  Then the customer catalog shows "Out of Stock" for Baby Romaine
  And the "Add to Order" button is disabled

US-2.2: Multi-Image Upload & Carousel

Must
As an admin, I want to upload multiple product images and arrange their display order, so that B2B clients see professional visual presentation of products in the catalog carousel.
Scenario: Upload and reorder images
  Given I am editing product "Microgreens Mix"
  When I upload 4 images and drag the third image to the first position
  Then the third image becomes the primary image
  And the customer catalog shows this image in the grid card
  And the detail view carousel starts with this image

Scenario: Reject oversized upload
  Given I am uploading product images
  When I select a 7MB JPEG file
  Then the upload is rejected with "Max file size: 5MB"

Epic 3 — Customer Management

US-3.1: Customer CRUD & Invite

Must
As an admin, I want to create, edit, and manage B2B customer profiles with delivery details and tier classification, so that I can control who has portal access and maintain accurate client records.
Scenario: Full customer lifecycle
  Given I create customer "Aloha Bistro" with contact "James K." and email "james@alohabistro.com"
  When I send the invite and James activates within 7 days
  Then status progresses: Invited → Active
  And James can log in and place orders

Scenario: Guest-to-customer conversion
  Given a guest order exists from "Aloha Bistro" with email "james@alohabistro.com"
  When I click "Convert to Customer" on the guest order
  Then the customer creation form pre-fills with guest data
  And after saving, the guest order is linked to the new customer account

Epic 4 — Ordering

US-4.1: Place Order (Authenticated)

Must
As a B2B client, I want to browse the catalog, select products with quantities, and submit my order, so that I can place orders quickly without calling or emailing.
Scenario: Build and submit order
  Given I am logged in as "MW Restaurant"
  And I add 2 heads Baby Romaine and 4 bunches Thai Basil to my order
  When I review and click "Submit Order"
  Then I see a confirmation with order number
  And I receive a confirmation email
  And the order appears in admin dashboard as "New"

US-4.2: Guest Order with PDF

Must
As a potential new client, I want to place an order without an account and receive a PDF receipt, so that I can try ordering from Mari's Gardens with a professional record of my purchase.
Scenario: Guest order with PDF
  Given I am not logged in and have items in my cart
  When I fill in: business name "Aloha Bistro", email "james@alohabistro.com", phone, address, delivery date
  And I click "Submit Order"
  Then a PDF is generated with order details, line items, totals, and my business info
  And I can download the PDF immediately
  And the PDF is also emailed to "james@alohabistro.com"

US-4.3: Repeat Last Order

Must
As a returning B2B client, I want to repeat my last order with one click, so that I don't re-select the same 8 items every week.
Scenario: Repeat order with OOS items
  Given my last order had 6 items and 2 are now out of stock
  When I click "Repeat Last Order"
  Then 4 available items are loaded into my cart
  And 2 items show "Currently Unavailable" warnings
  And I can submit the partial order or modify it

Epic 5 — Order Management (Admin)

US-5.1: Process & Confirm Orders

Must
As an admin, I want to review incoming orders, adjust quantities if needed, and confirm them, so that I can manage order fulfillment and automatically trigger packing sheets and invoicing.
Scenario: Confirm order with adjustment
  Given order #1047 from MW Restaurant has 10 units of Baby Romaine but only 6 available
  When I adjust quantity to 6 and click "Confirm"
  Then order status changes to "Confirmed"
  And MW Restaurant receives email: "Order adjusted — Baby Romaine reduced from 10 to 6"
  And packing sheet is generated with 6 units
  And QuickBooks invoice is created with 6 units

US-5.2: Batch Packing Sheets

Must
As an admin, I want to generate packing sheets for all confirmed orders by delivery date, so that the packing crew has a single, organized document for the day's work.
Scenario: Batch packing sheet
  Given 8 orders are confirmed for Tuesday AM delivery
  When I click "Generate Batch Packing Sheet" for Tuesday AM
  Then a single document is generated with all 8 orders
  And each order lists: customer name, products, quantities, check-off boxes
  And the document renders cleanly on both screen and printer

Epic 6 — Standing Orders

US-6.1: Create & Manage Standing Orders

Must
As an admin, I want to set up recurring standing orders for clients with specific products, quantities, and schedules, so that repeat orders are automated and don't require manual re-entry.
Scenario: Standing order auto-generation
  Given Safeway Mililani has a standing order: 15 items, every Tuesday
  And today is Sunday (48h before Tuesday)
  When the system runs the standing order scheduler
  Then a pending order is created for Safeway Mililani with 15 items
  And Safeway receives email: "Your standing order for Tuesday is ready — confirm by Monday 6pm"

Scenario: Standing order with OOS item
  Given the standing order includes Microgreens Mix but availability is 0
  When the pending order is generated
  Then Microgreens Mix is flagged as "Currently Unavailable" in the pending order
  And the notification email includes the shortage warning

Epic 7 — QuickBooks Integration

US-7.1: Automatic Invoice Creation

Must
As an admin, I want confirmed orders to automatically create invoices in QuickBooks Online, so that I never have to manually re-enter order data for accounting.
Scenario: Successful QB sync
  Given order #1047 is confirmed with 3 line items totaling $385
  When the QB sync runs
  Then an Invoice is created in QBO with 3 matching line items and total $385
  And the order shows "QB: Synced ✓" in admin

Scenario: QB sync failure and recovery
  Given the QB access token has expired
  When invoice creation fails
  Then the system refreshes the token and retries
  And if successful, the invoice is created
  And if 3 retries fail, admin sees "QB Sync Failed — Retry"

Epic 8 — Notifications

US-8.1: Transactional Emails

Should
As a B2B client, I want to receive email notifications when my order is confirmed, adjusted, or when my standing order needs attention, so that I stay informed without checking the portal.
Scenario: Order confirmation email
  Given admin confirms my order #1047
  When the confirmation is saved
  Then I receive an email within 60 seconds
  And the email contains: order number, items, total, estimated delivery date
  And the email has Mari's Gardens branding
Section 06

Delivery Slices

The feature breakdown into thin vertical slices — each independently deployable, testable, and demonstrable. This is how we build incrementally with visible progress every week.

We sliced the work into 7 deliveries. Each slice is a working increment — not a layer (backend then frontend then testing). Every slice includes its own backend, frontend, and tests. After Slice 3, Brendon can start using the admin. After Slice 5, clients can start ordering. This approach lets us validate assumptions early and course-correct before investing in later features.

🟢 Slice 1 — Foundation & Auth

Week 1-2Stories: US-1.1, US-1.2, US-1.3

Database schema, Supabase project, auth system (admin + customer + guest), basic UI shell with sidebar navigation. Role-based access control enforced.

  • Supabase project creation + schema deployment (products, customers, orders, images, standing_orders)
  • Admin login with email/password (Supabase Auth)
  • Customer invite flow: admin creates → email sent → customer activates with pre-filled data
  • Guest access: catalog browsable without login
  • RBAC middleware: Owner, Staff, Customer, Guest permission matrix enforced
  • Admin shell: sidebar navigation, dashboard placeholder
Demo: Admin logs in, creates a customer, customer receives invite, activates, logs into customer portal.

🔵 Slice 2 — Product Catalog (Admin)

Week 2-3Stories: US-2.1, US-2.2

Full product CRUD with multi-image upload, carousel, drag-and-drop reordering. Supabase Storage for images with CDN delivery.

  • Product list view with search, category filter, stock status filter
  • Create/edit product: all fields (name, short desc, long desc, price, unit, category, availability, status)
  • Multi-image upload (up to 10 per product, max 5MB each, JPEG/PNG/WebP)
  • Drag-and-drop image reordering; first = primary image
  • Supabase Storage bucket with automatic thumbnail generation
  • Soft-delete with confirmation dialog
  • Category CRUD
Demo: Admin creates 5 products with images. Products appear in catalog grid with correct images and details.

🟣 Slice 3 — Customer Management

Week 3-4Stories: US-3.1

Customer CRUD, invite management, status tracking. At this point, admin portal is fully usable for daily management.

  • Customer list with search, status filter, tier filter
  • Create customer with all fields (business, contact, email, phone, address, schedule, tier, notes)
  • Send/resend invite email via Resend
  • Customer status dashboard (Invited / Active / Inactive counts)
  • Deactivate/reactivate customer
  • Customer detail view with profile, notes, and placeholder for order history
Demo: Admin creates 3 customers, sends invites, one activates. Admin deactivates another — login blocked.

🟠 Slice 4 — Customer Portal & Ordering

Week 4-5Stories: US-4.1, US-4.2, US-4.3

Customer-facing catalog with carousel, ordering flow, guest checkout with PDF generation, "repeat last order." This is the core value delivery.

  • Customer catalog: product grid with primary image, carousel in detail view
  • Add to cart, quantity selector, running total
  • Order submission with confirmation screen + email
  • "Repeat Last Order" with availability check
  • Guest checkout: form + order submission + PDF generation (server-side)
  • PDF: branded, line items, totals, guest info, order number
  • Guest order rate limiting (5/day/email)
Demo: Authenticated client places order in <60 seconds. Guest orders and downloads PDF. Admin sees both in dashboard.

🔴 Slice 5 — Order Management & Packing

Week 5-6Stories: US-5.1, US-5.2

Admin order processing: confirm, adjust, generate packing sheets. Guest-to-customer conversion.

  • Order dashboard: list with status, customer, items, total, delivery date
  • Order status flow: New → Confirmed → Packed → Delivered
  • Quantity adjustment before confirmation + client notification
  • Packing sheet generation (per-order and batch by delivery date)
  • Print-optimized CSS for packing sheets
  • Guest order review + "Convert to Customer" one-click
Demo: 5 orders processed: 3 confirmed as-is, 1 adjusted (client notified), 1 guest converted. Batch packing sheet printed.

🟡 Slice 6 — Standing Orders & QuickBooks

Week 6-7Stories: US-6.1, US-7.1

Recurring order automation and accounting integration. The two features that save the most time long-term.

  • Standing order template CRUD (admin)
  • Automated pending order generation (scheduler, 48h before delivery)
  • Client confirm/adjust flow for standing orders
  • Auto-confirm on deadline (configurable)
  • QuickBooks OAuth 2.0 setup flow in admin Settings
  • Automatic Invoice creation on order confirmation
  • QB sync status per order (Synced / Pending / Failed / Retry)
  • Token auto-refresh with retry logic
Demo: Standing order fires, client confirms with adjustment. Confirmed order auto-creates QB invoice. QB failure simulated → retry succeeds.

⚪ Slice 7 — Notifications, Polish & Launch

Week 7-8Stories: US-8.1

Email notification system, edge case fixes, mobile responsiveness, UAT with Brendon, production deployment.

  • Resend integration: branded email templates for all notification types
  • Email triggers: order confirmed, order adjusted, shortage alert, standing order reminder, invitation
  • Admin notification: new order, guest order, QB sync failure
  • Mobile responsiveness testing and fixes
  • UAT with Brendon: real product data, real client scenarios
  • Production deployment to Cloudflare Workers + Supabase production project
  • Custom domain setup (if desired)
Demo: Full end-to-end: client orders → admin confirms → packing sheet → QB invoice → client notified. All on production.
Section 07

Technical Architecture

Modern, managed infrastructure chosen for reliability, low operational overhead, and zero server maintenance for Brendon.

Every choice here optimizes for Brendon never needing to think about infrastructure. Supabase provides database, auth, storage, and edge functions in one managed service. Cloudflare serves the frontend globally. Resend handles email. QuickBooks handles accounting. There's no server to maintain, no uptime to monitor, no security patches to apply. All services have generous free tiers that cover this project's volume comfortably — $0/month operational cost at launch.

⚛️

Next.js (App Router)

React framework, server-side rendering, optimized routing

☁️

Cloudflare Workers

Frontend hosting, global CDN, zero cold-start

Supabase

PostgreSQL DB, Auth, Storage (images/PDFs), Edge Functions, RLS

📗

QuickBooks Online API

Accounting API, OAuth 2.0, Invoice automation

📧

Resend

Transactional email, branded templates, delivery tracking

🤖

Claude Opus 4.7

AI-accelerated development, code generation, testing

System Architecture Flow

┌─────────────────────────────────────────────────────────────────┐
│                        CLOUDFLARE WORKERS                       │
│                     (Next.js App Router SSR)                    │
│  ┌──────────────┐    ┌───────────────────┐    ┌──────────────┐ │
│  │  Admin Portal │    │  Customer Portal  │    │ Guest Portal │ │
│  │  (Owner/Staff)│    │  (Authenticated)  │    │  (No Auth)   │ │
│  └──────┬───────┘    └────────┬──────────┘    └──────┬───────┘ │
└─────────┼─────────────────────┼──────────────────────┼─────────┘
          │                     │                      │
          ▼                     ▼                      ▼
┌─────────────────────────────────────────────────────────────────┐
│                          SUPABASE                               │
│  ┌─────────┐  ┌──────────┐  ┌──────────┐  ┌────────────────┐  │
│  │ Auth    │  │ Database │  │ Storage  │  │ Edge Functions │  │
│  │ (RBAC)  │  │ (Postgres)│  │ (Images) │  │ (PDF, QB Sync) │  │
│  └─────────┘  └──────────┘  └──────────┘  └───────┬────────┘  │
└────────────────────────────────────────────────────┼────────────┘
                                                     │
                    ┌────────────────────────────────┼───────┐
                    │                                │       │
                    ▼                                ▼       ▼
          ┌─────────────────┐              ┌──────────┐ ┌────────┐
          │ QuickBooks API  │              │  Resend  │ │  PDF   │
          │ (Accounting)    │              │  (Email) │ │ (Gen)  │
          │ OAuth 2.0       │              └──────────┘ └────────┘
          │ Invoice creation│
          └─────────────────┘

Database Schema (Core Tables)

TableKey FieldsRelationships
profilesid, email, role (owner/staff/customer), business_name, contact_name, phone, tier, status, delivery_schedule, notes1:1 with Supabase Auth users
productsid, name, short_desc, long_desc, category_id, unit, price, availability, status, sort_order→ categories, → product_images
product_imagesid, product_id, image_url, sort_order, is_primary→ products
categoriesid, name, sort_order→ products
ordersid, customer_id (nullable for guests), status, guest_info (JSONB), total, delivery_date, delivery_window, notes, qb_invoice_id, qb_sync_status→ profiles, → order_items
order_itemsid, order_id, product_id, quantity, unit_price, subtotal→ orders, → products
standing_ordersid, customer_id, schedule (JSONB), is_active, auto_confirm→ profiles, → standing_order_items
standing_order_itemsid, standing_order_id, product_id, quantity→ standing_orders, → products
addressesid, customer_id, street, city, zip, is_default→ profiles

Auth Architecture

ComponentImplementationNotes
Auth ProviderSupabase AuthEmail/password + Magic Link
SessionJWT via HttpOnly cookies (@supabase/ssr)30-day session, auto-refresh
RBACCustom claims in JWT + RLS policies4 roles: owner, staff, customer, guest
Invite FlowSupabase Auth invite + custom metadataPre-fills profile on activation
Row-Level SecurityPostgreSQL RLS on all tablesCustomers only see own orders/data

Email Architecture (Resend)

Email TypeTriggerTemplate
InvitationAdmin creates customer + clicks "Send Invite"Branded, activation CTA, pre-fill link
Order ConfirmationAdmin confirms orderOrder #, items, total, delivery date
Order AdjustmentAdmin modifies qty before confirmingWhat changed, new total
Standing Order ReminderScheduler (T-48h)Items, confirm/adjust CTA, deadline
Guest Order ReceiptGuest submits orderOrder details + PDF attachment
Shortage AlertOOS item in standing order or admin flagsWhich items affected, alternatives
Admin: New OrderAny order submittedCustomer, items, total — review link
Admin: QB Sync Fail3 retry failuresOrder #, error, retry link

QuickBooks Integration Detail

AspectDetail
APIQuickBooks Online Accounting API (REST, JSON) — not Payments API
AuthOAuth 2.0 via Intuit Developer Portal. Access token: 1h. Refresh token: 100 days (rolling)
Scopecom.intuit.quickbooks.accounting
Entities UsedInvoice (create), Customer (read/create), Item (read)
Rate Limits500 requests/min (Builder tier). ~70 orders/day = well within limits
SandboxFull sandbox available for development — US payments sandbox (Hawaii ✓)
Cost$0 (Builder tier, free up to 500K reads/month)
Future Phase 2Optionally add com.intuit.quickbooks.payment scope for ACH payments (1% fee, $10 cap)
Section 08

Low-Fidelity Wireframes

Key screen layouts for validation. These define structure and flow — final visual design is applied during development.

Admin — Dashboard
🌱 Mari's Gardens — AdminBrendon Lau (Owner) ▾
📊 Dashboard
📦 Products
👥 Customers
🛒 Orders
📋 Packing
🔁 Standing
📗 QuickBooks
⚙️ Settings
⚠️ 3 items low stock: Baby Romaine (5), Microgreens (2), Ong Choy (8)
12
New Orders
47
Products
68
Customers
$4,280
Revenue
Recent Orders
#CustomerTotalDeliveryStatus
#1047MW Restaurant$385May 6 AMNew
#1046Pai Honolulu$220May 6 AMNew
#1045Halekulani Hotel$890May 6 PMConfirmed
#1043Guest — Aloha Bistro$145May 6 AMGuest
Admin — Product Catalog
🌱 Admin — Products (47 active)+ Add Product
🥬
📷4
Baby Romaine
$3.50/head · ⚠5 left
🌿
📷3
Thai Basil
$4.00/bunch · ✓32
🌱
📷6
Microgreens Mix
$8.00/tray · ⚠2 left
🥕
📷2
Baby Carrots
$5.50/lb · ✓40
🐟
📷3
Fresh Tilapia
$7.00/lb · ✓85
🥦
📷2
Ong Choy
$3.00/bunch · ⚠8
Customer Portal — Catalog & Ordering
🌱 Mari's Gardens — Order Portal
MW Restaurant🛒 3
🛒 Catalog📋 My Orders🔁 Standing👤 Account
🥬
Baby Romaine
Hydroponic, crispy heads
$3.50/head
🌿
Thai Basil
Aromatic, fresh-cut daily
$4.00/bunch
🌱
Microgreens Mix
Sunflower, pea, radish blend
$8.00/tray
🥕
Baby Carrots
Sweet, pesticide-free
$5.50/lb
🐟
Fresh Tilapia
Live-harvested, aquaponic
$7.00/lb
🥒
Japanese Cucumber
Thin-skinned, seedless
$4.50/lb
Guest Checkout — Form + PDF Download
🌱 Mari's Gardens — Complete Your OrderGuest
💡 Already a customer? Log in to auto-fill and track orders.

📋 Business Info

🚚 Delivery

📝 Notes

🛒 Order Summary
Baby Romaine
2 × $3.50
$7.00
Thai Basil
4 × $4.00
$16.00
Microgreens
1 × $8.00
$8.00
Tilapia
10lb × $7.00
$70.00
Total$101.00
📎 PDF generated on submission for your records.
Section 09

What We Need from Mari's Gardens

Information and access required from Brendon and his team to execute this project.

We've designed the project to require minimal involvement from Brendon's team — but there are things only they can provide. This list is organized by when we need each item. Most of the heavy lifting is in Week 1 (data collection). After that, Brendon's involvement drops to periodic reviews and final UAT.

📋 Before Development Starts (Week 0)

ItemDetailWho ProvidesFormat
Product Catalog DataComplete list of ~50 SKUs: name, description, unit type, price per unit, categoryBrendon / teamSpreadsheet (Excel/Google Sheets)
Product PhotosAt least 2-3 photos per product. Higher quality = better customer experienceBrendon / teamJPEG/PNG, phone camera OK
Customer ListList of B2B clients: business name, contact name, email, phone, delivery address, delivery schedule, tier (restaurant/retail)BrendonSpreadsheet
Standing Order DetailsWhich ~10 clients have recurring orders, what products, what quantities, what scheduleBrendonAny format
QuickBooks Online AccessAdmin access to Brendon's QBO account for OAuth app setup. We'll configure the developer app together.BrendonScreen-share session (30 min)
Brand AssetsLogo (PNG/SVG), brand colors if any. If none, we'll use a clean green/white theme inspired by the farmBrendonFiles or "use your judgment"

🔄 During Development (Weeks 1-7)

ItemDetailWhenTime Required
Point of ContactDesignated person (Brendon or staff) to answer quick questions during development via Slack/emailOngoing~15 min/week
Design ReviewReview wireframes and early UI screenshots. Feedback on layout, colors, flowWeek 2-31 hour
Product Data ValidationVerify imported product data is correct (names, prices, units, categories)Week 330 min
QB Sandbox TestingQuick verification that sandbox invoices look correct in QBOWeek 630 min

🚀 Before Launch (Week 7-8)

ItemDetailTime Required
UAT SessionBrendon walks through the system with us: creates products, invites a test client, places an order, generates packing sheet, verifies QB invoice. We fix any issues found.2-3 hours
Domain DecisionCustom domain (e.g., order.marisgardens.com) or use our provided URL? If custom: DNS access needed.5 min decision
Go-Live ApprovalBrendon confirms system is ready for real client use after UATN/A
Client CommunicationBrendon introduces portal to B2B clients (we provide email template). Phased rollout recommended: 5 clients first, then all.30 min

Total time commitment from Brendon's team across the entire project: ~6-8 hours (bulk is the spreadsheet preparation and UAT). That's it. We handle everything else.

Section 10

Investment & Timeline

Detailed cost breakdown by phase and delivery slice, with expected ROI.

We structured the investment in three independent phases so Brendon can evaluate real-world results after Phase 1 before committing further. Phase 1 alone delivers the complete ordering portal with QuickBooks automation. Phases 2 and 3 are enhancements — valuable, but optional. Each phase has its own deliverables, timeline, and cost. No lock-in, no upfront commitment beyond Phase 1.

Phase 1 — MVP (Core Portal)

Delivery SliceFeaturesHuman HoursAI InferenceWeek
Slice 1: Foundation & AuthDB schema, auth system, RBAC, UI shell5h~$3001-2
Slice 2: Product CatalogProduct CRUD, multi-image, carousel, categories5h~$3502-3
Slice 3: Customer ManagementCustomer CRUD, invite, onboarding, status4h~$2503-4
Slice 4: Customer Portal & OrderingCatalog, cart, ordering, guest checkout, PDF7h~$4004-5
Slice 5: Order ManagementOrder processing, packing sheets, conversions5h~$2505-6
Slice 6: Standing Orders & QBRecurring orders, QuickBooks integration5h~$2506-7
Slice 7: Notifications & LaunchEmail system, polish, UAT, production deploy4h~$2007-8
Phase 1 Total35h~$2,0006-8 wk

Phase 2 — Self-Service Enhancements

FeatureHuman HoursAI Inference
Customer self-registration (admin-approved)2h~$100
Order history with analytics (spend trends, popular items)3h~$150
Standing order self-management (customer edits template)3h~$150
Delivery tracking (status updates for clients)2h~$100
Advanced mobile optimization2h~$150
Phase 2 Total12h~$650

Phase 3 — Smart Email Intake

FeatureHuman HoursAI Inference
Email inbox monitoring (dedicated orders@ address)2h~$100
AI parsing: extract products, quantities, delivery from email text4h~$350
Parsed order review UI + human confirm/adjust2h~$100
Confidence scoring + fallback to manual on ambiguity2h~$100
Phase 3 Total10h~$650

ROI Analysis

💸

Annual Savings: ~$27-31K

Eliminates ~24h/week of manual email processing labor at ~$22-25/hr. Additional savings from: fewer invoicing errors, no missed invoices (revenue leakage), reduced shortage-related client friction.

📅

Payback: <2 Months

Total investment (all 3 phases): ~$3,300 inference + 57h human. At $27K/year annual savings, the system pays for itself within 6-8 weeks of operation.

📈

Growth Enabler

Guest ordering creates acquisition channel. Standing order automation makes scaling to 100+ clients feasible without additional order-processing staff.

Section 11

Ongoing Maintenance & Support

Keeping the system healthy, secure, and compatible — 10 hours/month of proactive human expert oversight plus AI inference for implementation.

Delivering a system without a maintenance plan is irresponsible. Technology stacks evolve constantly: Next.js ships major versions quarterly, Intuit updates the QuickBooks API, Supabase rolls out platform changes, and security vulnerabilities are discovered in dependencies. Without proactive maintenance, the portal risks becoming incompatible, insecure, or unreliable within months. This retainer ensures Brendon's system stays healthy, performant, and up-to-date — with zero effort from his team.

What's Included — Monthly

ActivityDescriptionEst. HoursFrequency
Dependency UpdatesUpdate Next.js, Supabase SDK, Resend SDK, node-quickbooks, and all sub-dependencies. Run full test suite after each update. Deploy to production.3-4hMonthly
Security PatchesMonitor CVE databases and npm advisories. Apply critical patches within 48h, non-critical within the monthly cycle.Included aboveAs needed
QB API CompatibilityMonitor Intuit's API changelog and deprecation notices. Adjust integration code before deprecated endpoints are removed. Verify OAuth token refresh continues working.1-2hMonthly
Supabase Platform SyncSupabase Cloud applies platform updates automatically. Verify Auth, Storage, and Edge Functions remain compatible. Review RLS policy integrity.Included in checkMonthly
Bug FixesDiagnose and fix issues reported by Brendon or his team during the month. Includes investigation, fix, testing, and deployment.2-3hAs reported
Small EnhancementsMinor UX adjustments, new fields, simple report additions, configuration changes — anything that fits within 1-2h of work.Included aboveAs requested
Monitoring & Health CheckReview application logs, error rates, email deliverability (Resend dashboard), QB sync success rate. Flag anomalies before they become issues.1-2hMonthly
Backup VerificationConfirm Supabase automatic backups are running. Periodic test restore to verify data integrity.Included in checkMonthly
Total Monthly~10h

Monthly Cost

ComponentMonthlyAnnualNotes
Human Expert Hours10h120hBilled at agreed hourly rate
AI Inference (maintenance tasks)~$50-100~$600-1,200Dependency updates, bug fixes, patches
Infrastructure (Supabase, Cloudflare, Resend, QB API)$0$0All within free tiers at current volume

What's NOT Included (Billed Separately)

🆕

New Feature Development

Features beyond small enhancements — e.g., Phase 2 or Phase 3 work, new integrations, major UI redesigns. Scoped and quoted separately.

📈

Scale-Up Infrastructure

If Brendon's volume exceeds free tiers (unlikely at current scale), infrastructure costs are passed through at cost. We'll notify before any paid tier transition.

🚨

Emergency / After-Hours Support

Critical production outages outside normal business hours. Available at 1.5x rate if needed. Standard maintenance handles prevention to minimize these.

Why This Matters

Without maintenance, a typical web application degrades within 6-12 months:

Month 3: npm audit shows 5+ vulnerabilities. Most are low-risk, but one is critical.

Month 6: QuickBooks deprecates an endpoint. Invoices stop syncing. Brendon discovers it when a client asks about a missing invoice.

Month 9: Supabase ships a major Auth update. Login flow breaks for 3 customers before anyone notices.

Month 12: Next.js version is 2 major versions behind. Security patches stop. Updating now requires rewriting components.

With 10h/month of proactive maintenance, none of this happens. Updates are applied incrementally, compatibility is verified before it breaks, and issues are caught in monitoring — not by Brendon's customers.

Monthly Maintenance Report

Brendon receives a brief monthly report including:

  • What was updated (packages, versions, patches applied)
  • Any QB or Supabase API changes monitored
  • Bugs fixed during the month
  • Small enhancements delivered
  • Health check results (uptime, error rate, email deliverability, QB sync rate)
  • Recommendations for the next month (if any)
  • Hours used vs. allocated

Prepared by VtKL · AI-Accelerated Development with Claude Opus 4.7 · May 2026