All projects
SaaS case study
Inventory Management SaaS
Multi-tenant stock, purchase order and low-stock forecasting tool for small distributors.
- Reorder planning
- 1 day → 15 min
- Stockouts
- -46%
- Tenants onboarded
- 9
supabase · table editor
idskuon_handreorder_at#1000—46—#1004—58—#1008—70—#1012—82—
Interface reference — rendered from the real component structure, not a stock image.
The problem
Spreadsheets could not answer 'what do we reorder this week' without a day of manual work.
The solution
Per-tenant Postgres schema with row level security, reorder point calculation from real sales velocity, and CSV import for legacy data.
Hard parts
Getting tenant isolation right. Every table is protected by RLS policies, verified with automated tests per role.
Outcome
Reordering became a fifteen-minute weekly task backed by actual sales data.
Technology used
- Next.js
- PostgreSQL
- Supabase
- React Query
- Zod
How it was delivered
- 01Client problemPurchasing decisions were guesswork based on stale spreadsheets.
- 02ResearchReviewed twelve months of sales to model realistic velocity and lead times.
- 03PlanningChose shared-schema multi-tenancy with strict RLS over separate databases.
- 04WireframeThree core screens: stock list, reorder suggestions, purchase orders.
- 05DevelopmentTyped server functions, Zod validation on every input, React Query caching.
- 06TestingRole-based integration tests proving no tenant can read another's rows.
- 07DeploymentMigrations run in CI, rollback plan documented before each release.
- 08ResultsDistributors reorder from data instead of memory.
Lessons learned
Write the tenant isolation tests before the features. Retrofitting them is painful and unconvincing.