Shipping Up: Adding Physical Products to AdminStack
Just wrapped up a solid session enhancing AdminStack's product system to handle physical goods alongside digital products. This was Phase 1 of a larger products overhaul, and I'm pretty stoked about how it came together.
What Got Done
The big focus was expanding our products table with everything needed for physical product fulfillment. Added 9 new columns to handle SendGrid email templates, shipping details, brand colors, and Stripe configuration. The orders table got some love too with tracking URLs, carrier info, and shipping dates.
One thing I'm particularly happy with is how I handled the Stripe secrets. Instead of storing actual API keys in the database (yikes!), I'm storing environment variable names. So the product might have stripe_secret_key_env: "IMAGESTACK_STRIPE_SECRET_KEY" and then we do process.env[product.stripe_secret_key_env] at runtime. Much cleaner and safer.
The UI Updates
The product edit form got a nice expansion with collapsible sections for shipping and Stripe config. Added a proper color picker for brand colors, and now product cards show a subtle left border in the brand color. Small touches, but they make the interface feel more polished.
The dashboard now shows a "Pending Shipment" counter for physical orders that haven't been delivered yet. It's these little workflow helpers that make a SaaS actually useful in practice.
Webhook Magic
Updated our Stripe webhook handler to automatically link orders to products. For BunkerVault (our existing physical product), it does a name lookup. For new products, it matches by Stripe product ID and even backfills existing orders that weren't linked yet.
Seeded Some Real Data
Took the opportunity to seed the database with our actual product lineup: BunkerVault, ImageStack, MemStack Pro, AdminStack itself, AlgoStack, EpsteinScan, and the Vibe Coding book. Feels good to see real data in there instead of "Test Product 1".
What's Next
This was just Phase 1. Still need to build out the actual shipping email flow and add product-based order filtering. But the foundation is solid now.
Oh, and I need to actually run the migration in Supabase before any of this works in production. Classic developer move - build it all, then remember to actually deploy the schema changes.
The codebase is feeling more mature with each session. AdminStack is genuinely becoming something I'd want to use for my own business operations.