<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[StoreFlux]]></title><description><![CDATA[Engineering notes from building StoreFlux, a headless commerce backend for multi-tenant stores: product schemas, offline POS, payments, and our own bugs.]]></description><link>https://storeflux.hashnode.dev</link><image><url>https://cdn.hashnode.com/uploads/logos/6afb11452e3c9f13383a277a/4d320575-9323-4a52-b86b-9d4137adb242.png</url><title>StoreFlux</title><link>https://storeflux.hashnode.dev</link></image><generator>RSS for Node</generator><lastBuildDate>Sat, 21 Nov 2026 19:01:56 GMT</lastBuildDate><atom:link href="https://storeflux.hashnode.dev/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[Four Things Broke When We Turned On Row-Level Security]]></title><description><![CDATA[Row-level security looks like a one-line change in Postgres. We turned it on for a multi-tenant commerce backend, and four things broke before it worked…]]></description><link>https://storeflux.hashnode.dev/four-things-broke-when-we-turned-on-row-level-security</link><guid isPermaLink="true">https://storeflux.hashnode.dev/four-things-broke-when-we-turned-on-row-level-security</guid><category><![CDATA[postgres]]></category><category><![CDATA[Security]]></category><dc:creator><![CDATA[StoreFlux]]></dc:creator><pubDate>Wed, 18 Nov 2026 14:44:49 GMT</pubDate><enclosure url="https://cdn.hashnode.com/uploads/covers/6afb11452e3c9f13383a277a/5db45a86-df24-43bd-8d0d-e2e15063842a.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Row-level security looks like a one-line change in Postgres. We turned it on for a multi-tenant commerce backend, and four things broke before it worked.</p>
<p><strong>One:</strong> our interceptor reset the role and set the tenant in a single command with a parameter, which Npgsql rejects. It became two calls.</p>
<p><strong>Two:</strong> refreshing a materialized view needs ownership of the view, not just the bypass privilege. A migration moved ownership to the right role.</p>
<p><strong>Three:</strong> setting a custom variable to NULL stored an empty string. The policy cast that to uuid, so unauthenticated requests crashed instead of failing closed. Wrapping the cast in NULLIF fixed it.</p>
<p><strong>Four:</strong> a scoped database context keeps its connection open for the whole request. Switching roles midway through did nothing, so some cross-tenant reads silently returned zero rows. The interceptor now re-applies the role on demand.</p>
<p>The decision that took the longest was anonymous endpoints, like login, registration, and guest carts. They have no tenant identity for the policy to use, so for those requests only, we elevate the role for the whole request. Authenticated requests keep full RLS.</p>
<p>For an anonymous request, RLS can't fail closed to a tenant it doesn't know. The protection for those endpoints is the explicit tenant lookup in code. I'm not sure it's the right trade.</p>
<p>The full write-up with the code notes is on Dev.to: <a href="https://dev.to/storeflux/we-turned-on-row-level-security-in-postgres-four-things-broke-47id">https://dev.to/storeflux/we-turned-on-row-level-security-in-postgres-four-things-broke-47id</a></p>
]]></content:encoded></item><item><title><![CDATA[We Are Building StoreFlux in Public. Here Is What Is Live, and What Is Not]]></title><description><![CDATA[Engineering status report for StoreFlux, a headless commerce backend: what is live, what is not yet tested, and what we will write about next.]]></description><link>https://storeflux.hashnode.dev/we-are-building-storeflux-in-public-here-is-what-is-live-and-what-is-not</link><guid isPermaLink="true">https://storeflux.hashnode.dev/we-are-building-storeflux-in-public-here-is-what-is-live-and-what-is-not</guid><category><![CDATA[ecommerce]]></category><category><![CDATA[SaaS]]></category><category><![CDATA[Building in Public]]></category><dc:creator><![CDATA[StoreFlux]]></dc:creator><pubDate>Mon, 16 Nov 2026 14:33:03 GMT</pubDate><enclosure url="https://cdn.hashnode.com/uploads/covers/6afb11452e3c9f13383a277a/6c714373-384c-4403-bb9b-8b88a6f4b996.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>StoreFlux is a headless commerce backend. You build the storefront, and we handle products, carts, orders, payments, shipping, and analytics through an API. Each store is a separate tenant, so one deployment can run many shops, each with its own branding and its own data.</p>
<p>This is the first article on our Hashnode blog, so it is a status report. It was first published on our Medium page; this copy points to that original.</p>
<h2>What is live</h2>
<p><strong>Cart recovery.</strong> An abandoned cart can get up to three emails, at one hour, 24 hours, and 72 hours by default. The sequence stops the moment the shopper buys. Only the third email can carry a discount, and only when the store turns that on.</p>
<p><strong>Smart collections.</strong> A collection can be defined by rules on tag, price, category, stock, sale status, or how new a product is. Membership refreshes every ten minutes, and you can preview who matches before you save.</p>
<p><strong>Invoice PDFs.</strong> A customer can download an order's invoice from their order page, and staff can download the same PDF from the admin. Drafts stay hidden from customers.</p>
<p><strong>Admin branding.</strong> The admin dashboard takes a primary color, an accent, a sidebar color and text color, a corner style, and a favicon. The sidebar preview updates as you edit.</p>
<p><strong>Cash on delivery as a receivable.</strong> For carrier-collected COD, the money the courier still owes you is tracked as a receivable until a payout arrives. It is not just a checkbox that says paid.</p>
<h2>What is not proven yet</h2>
<p><strong>Connectors.</strong> We have connectors for WooCommerce, BigCommerce, Magento, and Amazon, tested against local mock servers. We have not connected them to real store accounts. Treat them as untested in production until someone has run them end to end.</p>
<p><strong>Carrier COD payouts.</strong> The carrier webhook is tested with a signer we wrote ourselves. We have not confirmed it with a real courier.</p>
<p><strong>Storefront theming.</strong> The storefront has color settings, but we have not found an admin screen to edit them yet. Do not count on it for your brand.</p>
<h2>Why we write it this way</h2>
<p>When something is live, we will say so. When it is not tested, we will say that too, even when it is less exciting.</p>
<p>The main site is storeflux.store.</p>
]]></content:encoded></item></channel></rss>