Case study 01 — SaaS
Bokyi (MN Salon).
One booking system for many salons and their branches, where two customers can never get the same staff member at the same time.
- Year
- 2026
- Role
- Sole developer
- Stack
- Laravel · Next.js · PostgreSQL · Redis · Docker · Flutter
- Duration
- Since Sep 2025
- Link
- bokyi.ir ↗
- Status
- Live · Live under the Bokyi brand
Problem
Media Nossa wanted one cloud product for salons: every business its own tenant, several branches each, and the web panel, API and mobile apps on a single backend.
The specification named seven kinds of user: the platform administrator, salon owners, branch managers, receptionists, staff, accountants and the salons’ own customers. Around them came online booking for customers, packages and memberships, salon finance, subscriptions for the salons themselves, referrals, and notifications.
Constraints
- C1Each salon's data stays inside its tenant: in requests, in queued jobs and in payment callbacks.
- C2A staff member can never be booked twice for the same time, even under concurrent requests.
- C3Gateways, SMS providers and calendars differ by country. Booking and finance code must not know which.
- C4One API serves the web app, the PWA and the Android app.
Three calls that shaped the rest.
- D1
A tenant scope that fails closed
WhyTenant-owned models are filtered by a global scope that refuses to run without a tenant, and queue jobs carry their tenant with them. A forgotten filter returns nothing, never another salon's data.
Trade-offCross-tenant work, like platform reports, has to ask for system access explicitly.
- D2
Double bookings stopped by the database
WhyAvailability is checked in a transaction, and a PostgreSQL exclusion constraint on each staff member's time catches the race an application check can't.
Trade-offPostgreSQL instead of MySQL, and booking times handled carefully across branch time zones.
- D3
Holds before bookings
WhyA customer first holds a slot for a short time, then confirms. Confirmation is idempotent by the hold token, so a retry on a bad connection returns the same booking instead of a second one.
Trade-offEvery availability query has to ignore expired holds on its own, without waiting for the cleanup job.