Agendity: multi-tenant scheduling SaaS
Multi-tenant architecture built from scratch for a scheduling platform, with a direct WhatsApp Business API integration and real-time availability sync.
- Role
- Founder & CTO
- Industry
- SaaS
- Tech stack
- Ruby on Rails, Next.js, PostgreSQL, Redis, NATS, WhatsApp Business API
Context
Agendity is a scheduling SaaS platform for salons and barbershops. The product started from a simple observation: most of these businesses coordinate appointments manually over WhatsApp, and the solutions on the market rely on intermediaries (like Twilio) to automate that communication, which adds cost and limits customization.
The challenge
Building a real multi-tenant SaaS means making decisions that are expensive to reverse later: how each business's data is isolated, how role-based permissions are modeled, and how to guarantee that the availability shown to a client is always the actual availability, even with multiple instances of the system running in parallel.
On top of that came a specific integration challenge: connecting directly to Meta's WhatsApp Business API, with no intermediary, to have full control over automated confirmations and reminders.
The architecture
I designed the complete multi-tenant architecture (JWT authentication, role-based access control with Pundit, subscriptions, and the scheduling engine) before writing a single business feature, because those are the most expensive decisions to change later.
Real-time without intermediaries. Availability is synced across instances via NATS pub/sub, so a schedule change reflects instantly across the whole platform without relying on polling or a single central process.
Direct WhatsApp integration. Instead of using an intermediary provider, the integration was built directly against Meta's API, allowing full customization of confirmations and reminders without a third party's costs or limits.
Mobile-first experience. QR ticket generation, an installable PWA, and web push notifications, designed for a usage flow that happens mostly from a phone, both for the business and the end client.
Decisions that made the difference
- Solving the multi-tenant architecture (isolation, roles, permissions) before any visible feature, avoiding a costly migration down the road.
- Integrating WhatsApp Business API directly instead of relying on an intermediary, trading that complexity for full control.
- Using pub/sub for real-time availability instead of a polling-based refresh model, prioritizing consistency as perceived by the user.