← Back to projects

Case study / E-commerce · physical fulfillment

Vida Verde

A storefront that connects a paid order to the products actually ready to fulfill.

The problem

How do product availability, customer payment, and physical fulfillment stay in sync?

Where it stands. Online orders connect to stock, preorders, pickup, and shipping in one workflow.

The real Vida Verde catalog with product photographs, availability, prices, and cart controls.
Production catalog, captured October 26, 2026. Availability is a moment-in-time view.

What the project does

Customers need the right price, one order per payment, and a clear pickup or shipping date. Vida Verde connects a six-product catalog to those promises.

A cart can mix ready items and preorders, and stock can change during payment. The app tracks these quantities separately. Google Sheets helps operators manage preparation and shipments.

Why I built it

A friend at the farmers market approached me about expanding the business into online sales. We became business partners, and I built Vida Verde’s online store from the ground up.

This project matters to me because I’m helping a friend grow a business we’re building together. Next, I plan to manage ads through Meta to reach a targeted audience and support online sales.

My work. I built the storefront, checkout, and the integrations connecting payment, stock, shipping, and the business’s Google Sheets workflow from the ground up.

Edison Neto founded the food business.

How someone uses it

  1. Choose products

    Build a cart and review ready items and preorders.

  2. Validate details

    Choose pickup or shipping, enter details, and acknowledge the policies.

  3. Calculate shipping

    Request shipping rates or follow the market pickup schedule.

  4. Confirm payment

    The server checks totals before requesting payment through Stripe.

  5. Record the order

    Verified payment creates one order with ready and preorder quantities.

  6. Prepare and fulfill

    Prepare orders and approve labels once every shipping item is ready.

Tools and languages

Here’s what each part does, why it fits this project, and what a different approach would change.

  • JavaScript + React + Next.js

    JavaScript powers the storefront and server; React manages the cart and checkout. I kept the product pages and order endpoints together, using JavaScript on both sides.

    Another option
    TypeScript adds compile-time checks. A Python or Java API adds a separate service.
    Tradeoff
    Without TypeScript's static checks, tests and Zod checks of incoming requests carry more of the work of catching data mistakes.
  • PostgreSQL + Supabase

    Supabase hosts PostgreSQL, where SQL queries and updates related products, stock, orders, and preorders. I used transactions to update orders and stock together, including when requests arrive at the same time.

    Another option
    Document databases can support transactions too. SQL makes these order and stock relationships explicit; Sheets remains an operations interface.
    Tradeoff
    The app depends on a managed provider. Business rules span JavaScript and SQL, so both need checks.
  • Stripe

    Collect payments through the payment interface and send signed payment events. I wanted to build the order workflow without also building payment processing.

    Another option
    Another payment provider would still need integration and event handling.
    Tradeoff
    Fees, provider availability, repeated events, and payment-to-order failures still need handling.
  • EasyPost

    Verify addresses, compare carrier rates, and purchase shipping labels. I used one integration for several carriers instead of maintaining a separate connection to each one.

    Another option
    Direct carrier APIs would mean maintaining several request and response formats.
    Tradeoff
    Requests cost money and can fail. Saved quotes, expiration checks, and request budgets address those limits.
  • Google Sheets + Apps Script

    Give operators working views of stock, preparation, orders, and shipments. I connected spreadsheet actions to authenticated server endpoints so the business could work in Sheets while the database kept the records.

    Another option
    A custom admin dashboard could offer more control but adds another interface to maintain.
    Tradeoff
    Synchronization, stale views, quotas, and accidental edits need clear input rules and recovery.
  • Node.js tests

    Node.js runs JavaScript checks for money calculations, shipping rules, retries, and database safeguards locally. I used local checks for failures and retries without charging a customer or buying postage.

    Another option
    Manual checkout checks alone are difficult to repeat for overlapping requests and failures.
    Tradeoff
    Mocked and SQL-source checks do not replace integration tests against an isolated database.

How the parts connect

Customer browserCatalog, saved cart, fulfillment details, and Stripe's payment interface.

Validated checkout request

Next.js serverChecks input, reloads prices and stock, and prepares checkout.

Independent server integrations

  • SupabaseStores products, stock, orders, preorders, quotes, and pending work.
  • StripeProcesses payment; verified events and confirmation trigger order recording.
  • EasyPost · shipping onlyVerifies shipping addresses, rates planned parcels, and purchases approved labels.
Separate operator entry point ↔ application server
Sheets operationsApps Script connects authenticated restock, preparation, and shipment actions.
Supabase is the order database. Sheets is the working interface. EasyPost handles shipping; pickup follows a shared market schedule. Recording payment and buying postage are separate actions.

Key decisions

Decision 01

When is a payment safe to turn into an order?

Check money on the server and record each payment once.

The problem
A stale browser total or a repeated payment notification must not create an incorrect order or consume inventory twice. The customer's confirmation and Stripe's automatic payment notification, called a webhook, can arrive together. Either can retry after a network failure.
The approach
The server reloads prices and calculates totals in cents. Payment amounts, currency, and order totals must agree. A database lock lets one request record a payment at a time; later requests return the existing order.
Why this approach
The browser requests a purchase; the server decides the price. The database prevents the same payment from consuming stock twice. Overlapping carts lock product codes, also called SKUs, in a consistent order.
Another option
Use a unique payment identifier to reject duplicate inserts. That prevents duplicate rows, but stock changes still need the same transaction.
The tradeoff
Checkout pauses if server data is unavailable. Stock is allocated after payment, so an item can move to preorder during processing; confirmation explains the change.

How it was checked. Local tests reject mismatched amounts, duplicate items, malformed quantities, and stale expectations. Database checks inspect SQL locking structure; simultaneous live transactions were not exercised.

More about the evidence
  • Repository reviewServer checkout, payment-integrity validation, and the database recording transaction enforce the accounting and replay rules.
Decision 02

Who gets the next batch when some orders are waiting?

Serve waiting paid orders first and record each allocation.

The problem
A new batch must serve waiting paid demand before the remaining units become available to new customers. One order may contain both ready and unfinished items, and one restock may satisfy only part of a customer’s remaining quantity.
The approach
Order recording separates ready units from preorders. A restock serves the waiting queue by payment time, with a stable tie-breaker, and records each allocation. Only the surplus becomes available for new orders.
Why this approach
Recorded allocations tell preparation reports what is ready. A background worker groups them by order so several products becoming ready can produce one customer update.
Another option
Add the whole restock to available stock and assign waiting orders manually. New purchases could take units already owed to earlier customers.
The tradeoff
Stock, queue balances, and allocation history must stay consistent. Email runs separately and can fail after the database update, so it needs retries.

How it was checked. Source tracing checks allocation order. Tests cover bounded notification batches and exclusive worker claims. No live stock or customer email was changed during verification.

More about the evidence
  • Repository reviewThe restock transaction implements ordered allocation and durable release events; notification workers claim exact batches before sending.
Decision 03

When should an estimate become a postage purchase?

Calculate shipping first; buy postage after an operator approves it.

The problem
Taking payment does not prove that a physical order is ready, and purchasing postage spends money with an external provider. Shipping needs accurate packages, current rates, the right recipient, and every item ready.
The approach
A local planner chooses the parcels before EasyPost rates them. Saved quotes keep the provider's identifiers. An authenticated operator reviews a quote and approves purchase after payment, recipient, readiness, previous purchase, and cost checks.
Why this approach
Buying postage is a separate, visible action because it spends money. Shipped orders wait until every item is ready. Pickup can release ready items earlier under its own policy.
Another option
Buy labels immediately after payment. That could spend postage before preorder items are ready or the recipient details are confirmed.
The tradeoff
Shipping needs a manual handoff. Expired quotes need another preview; a partly completed purchase needs recovery with the original quote or operator review.

How it was checked. Policy tests cover missing approval, recipient matching, cancellation, and actions that must never buy postage. No live labels were purchased; a separate wording-check failure is noted in the evidence.

More about the evidence
  • Repository reviewThe label-release API requires a valid quote and explicit approval; domain policy blocks ineligible orders and purchase recovery preserves quote identity.
  • Repository reviewThe October 28 targeted run found one existing shipping-guidance test whose expected wording differs from the interface. That wording check remains unresolved in the product repository.
Vida Verde checkout showing customer details, fulfillment choices, and shipping calculation before payment.
The public checkout separates customer details and shipping calculation from the payment step.

Results and next steps

The storefront connects checkout to payment checks, stock allocation, and fulfillment. Local checks cover accounting, shipping policies, and database rules, without a live charge or postage purchase.

What I take from this. Payment is only one step in fulfilling an order. Each handoff needs saved state and a way to recover if the next step fails.

What still needs work. Payment can succeed before the order or later work is saved. Retries and background jobs help, but production reliability has not been measured here.

What I would do next. Replay simultaneous payment confirmations and interrupted fulfillment against an isolated database to check recovery across the full workflow.

Next projectLinket Connect