Industrial & Home Utility
Surana Switchgear
A B2B distributor portal where price and approval are decided by the database, not the browser.
The problem
Distributor portals leak. Pricing is confidential between a vendor and a buyer, and most B2B portals enforce that in JavaScript, where the buyer can change it.
In short
An electrical switchgear distribution portal with per-vendor pricing, approval gates and proper multi-tenancy. It was rebuilt from a prototype whose backend held the service-role key and did authorization in application code — including an unauthenticated route that could delete every administrator. The frontend is still being rebuilt; the security model is already done.
- Status
- Backend complete
- Schema
- 15 tables, RLS
- Security checks
- 15, all passing
- Frontend
- In build
Figures from the repository's own verification suite: anonymous lockout across eight tables, tenant isolation, pricing confidentiality, invite-token secrecy and the order approval gate.
What is built
- Relational 15-table schema replacing a single key-value blob table
- Authorization in the database — every tenant-scoped policy derives the caller's organisations from the verified session
- Server-resolved pricing: an order posting a price of one cent stored the real catalogue price
- Invite tokens stored only as hashes, never selectable by a tenant
- Two unauthenticated administrator routes from the prototype deleted outright
How it earns
- B2B switchgear and electrical distribution
- Approved-account wholesale with per-vendor pricing
- Volume and contract programmes
Where it goes
- Rebuild the frontend on the new schema
- Complete account approval and onboarding for distributor organisations
Also in Industrial & Home Utility
Want the operating detail behind this venture?
Get in touch