Product architecture
How Glowly works
A two-sided marketplace stack with a real-time booking engine, role-based access, commission ledger and referral system — designed for the Balkans.
System overview
Consumer app
- • React Native · Expo
- • Personalised home feed
- • 5-step booking flow
- • Wallet & referrals
Business dashboard
- • Next.js (mobile web ready)
- • Multi-staff calendar
- • Services & pricing editor
- • Flash deals + analytics
Backend
- • Node.js + Supabase Postgres
- • Realtime slot locking
- • JWT auth · role-based
- • Twilio SMS + Expo Push
Booking flow
Browse / Search
→
Select service & staff
→
Pick slot
→
Pay deposit ✓
Slot lock: when a user opens a time slot, a 90-second optimistic lock is placed via Supabase realtime. If payment fails or expires, the lock is released and the slot returns to the pool.
Business rules engine
| Rule | Trigger | Action |
|---|---|---|
| Deposit required | Booking total > €30 | Charge 20% upfront |
| No-show fee | Customer absent > 15 min | Forfeit deposit · flag user |
| Loyalty stamp | Booking completed | +1 stamp · 10 = €10 credit |
| Referral credit | Friend's first completed booking | €5 to both, 90-day expiry |
| Commission | Booking settled | 15% to platform ledger |
| Reminder cadence | Confirmed booking | SMS at T-24h and T-2h |
Data model
users
businesses
services
staff
bookings
reviews
vouchers
commission_ledger
Notifications & messaging
Push (Expo)
Confirmations, reminders, flash deals.
SMS (Twilio)
T-24h and T-2h reminders, OTP.
Email
Receipts, payouts, marketing.
Security & access
- 🔐 JWT auth with refresh rotation
- 🛡️ Row-level security on all tables
- 👥 4 roles: customer · business_owner · staff · admin
- 💳 PCI-compliant payment provider