Outreach supply ordering portal
A funding-gated Laravel ordering portal for a public-health nonprofit that replaced scattered WordPress stores and once-a-year bulk shipments with one stock count, order-as-needed fulfillment and vouchers instead of cards. It had to absorb two legacy platforms, Craft Commerce and WooCommerce, into one data model.
- Year
- 2026
- Role
- Solo developer
- Stack
- LaravelInertiaVueTypeScriptTailwindMySQLPestS3Resend
A storefront for a public-health nonprofit that distributes outreach supplies to partner organizations across two state programs. Partners order what they need, when they need it, against funding the nonprofit has assigned rather than credit cards. One codebase, one deployment per program, each with its own database and branding.
Problem
The program started with a handful of separate WordPress stores and no shared picture of stock. Each store had its own count, so nobody could say how much of an item was really on hand, and the practical answer was to ship every partner its whole year of supplies at once in January. Some of it sat unused; some of it, like test kits and other dated supplies, expired before it was needed. The waste was the budget.
The fix had to be one catalog with one stock count that partners draw from through the year, so inventory goes where it is actually being used. That brought a second problem: each partner is allocated a voucher in dollars or in internal credits and may only order the product categories that funding permits. Off-the-shelf commerce assumes a public catalog and a card at checkout. This needed the opposite: a logged-in catalog shaped by who you are and what you were funded for, settlement by drawing down a balance, live stock everyone can see, and reporting the funder can stand behind.
By 2026 the two programs had drifted onto two platforms. One ran on a Craft Commerce storefront I had built with forked plugins and post-install patches; the other was still on WordPress, with WooCommerce memberships standing in for funding and two different wallet plugins standing in for balances. Both carried years of accounts, orders and balances that could not be lost, and both were expensive to keep patched. The rebuild had to replace both with one application and migrate everything.
What I built
- Funding as the gate. A request-scoped
FundingContextservice is the single source of truth for what the current user can see and buy: active voucher, currency, balance, allowed products. One query scope on variants applies the rule everywhere (category allowed by the funding source, currency matching the voucher), where the Craft version had the same check copied into six places. - Balance is a ledger. Every voucher balance change is an append-only transaction; the stored balance is only a cached mirror. Placing an order writes a debit and an adjustment in one transaction, so the order, the balance history and the funder's report always agree. Nothing is hand-edited; corrections are new rows.
- Settlement, not payment. There is no gateway. An order is complete when the voucher has covered it. Two currencies, real dollars and internal credits, as an enum rather than a plugin.
- Admin in one place. Catalog, categories, funding sources, vouchers, users, orders and shipments, with per-user purchase limits by period, an activity trail on every record, and the ability to impersonate a customer to see exactly what they see.
- Reports in the background. Orders, items ordered by funding code, inventory and voucher balances are generated as queued jobs with filters and downloaded when ready, instead of a page that times out.
- Fulfillment. A thin controller speaks to the shipping provider's API, replacing a plugin; downloadable products are served through short-lived S3 links.
- Locked-down access. Admin-issued accounts with no public registration, email verification, rate-limited login, optional two-factor and passkeys. Managers are a flag; the super-admin is defined by environment, not a database row, so it cannot be escalated from inside the app.
- Per-deployment branding. Homepage slides, about page, notification recipients and brand settings live in the database, so the second program is configuration rather than a fork.
Migrating from two platforms at once
The hard part was not writing the new model, it was proving two very different legacy schemas could fold into it. Each program got its own importer, reading the old database over a read-only connection and writing into the same tables.
- From Craft Commerce: a funding-sources category group became funding sources; gift-voucher codes became vouchers, with the currency inferred from the code's parent voucher type and holders taken from the assign-to-user relations. Order attribution came from a custom funding-code field on each order.
- From WooCommerce: each membership plan became a funding source, with its granted categories parsed from the memberships plugin's restriction rules. Credit-priced products were seeded from a download-credits wallet; dollar balances came from each customer's store-credit coupon and became a single dollar wallet spanning every dollar source they held, which is how the old store actually behaved.
- Shared rules. Balances are seeded as one opening-balance ledger transaction equal to the legacy amount, because years of plugin redemption rows did not reconcile and replaying them would have invented history. Orders import as history only, with no funding drawdown. Line items whose product was later deleted keep a SKU and description snapshot. Images are fetched and rehosted on S3 with retries. Passwords cannot cross hashing schemes, so launch sends a forced reset.
- Safe to repeat. Both importers have an inspect mode that counts live legacy rows before touching anything, and a fresh flag that wipes imported data while keeping the admin account, so a run could be repeated against a production snapshot until the numbers matched. Each legacy quirk that bit during those runs became a Pest test: variant prices, order totals, manager roles, order addresses, credit wallets.
Stack and decisions
Laravel with Inertia, Vue and TypeScript, Tailwind, Pest, MySQL, S3 for assets, Resend for mail, Forge for deploys and Nightwatch for monitoring. Business logic lives in services and actions with thin controllers; statuses, currencies and limit periods are enums. Subscriptions, donations and card payments were deliberately left out: the legacy sites never used them, and every unused feature is one more thing to keep patched.
Outcome
The WordPress program is live on the new platform, its members, balances and order history carried over. The Craft program is imported and staged, waiting on the funder's sign-off. The January bulk shipment is gone: partners order as they go from a single stock count, so supplies land where they are used instead of expiring on a shelf. The Craft version taught me that when the heart of a product is something the platform was never built for, it is better to build it from scratch than to bend a CMS and a stack of plugins to it. I spent more time working around Craft 5 and its commerce and voucher plugins than I would have spent writing the funding model directly, and the upgrade path kept breaking the parts I had forked. The rebuild is where that lesson became the architecture, and the migration is where it was tested against a decade of real data.
The footprint shows it. The Craft site pulled in 31 direct Composer dependencies, 17 of them Craft and plugin packages, for 213 installed packages, and its database ran to 155 tables and about 275 MB. The WordPress stores each carried 21 active plugins. The Laravel app has 11 direct Composer dependencies and 110 installed packages, every one of them a library I chose rather than a plugin standing in for a feature, and the live database for the first program is 37 tables and 5.5 MB. Fewer packages means fewer security advisories to chase and fewer upgrades that can break the parts that matter, and there is no CMS or commerce plugin in the stack whose release cycle the funding model depends on.