← cd ../work

Case study · Web

CitadelyMulti-Tenant Booking SaaS

Booking platform for small businesses: calendar, services, clients, and a public booking page on each business's own subdomain, with deposits through Mercado Pago and transactional email.

SaaS / Multi-tenant / Next.js 2026
Citadely landing page with a daily booking timeline showing confirmed and pending-deposit appointments

Project Overview

Citadely is a scheduling hub for service businesses such as salons, barbershops, and clinics. Owners manage their calendar, services, and clients from one dashboard, and customers book from a public page served on the business’s own subdomain (<business>.citadely.com.ar). It runs on Next.js 16 with InsForge (Postgres with row-level security, auth, storage, and functions) and is free to use, funded by voluntary contributions.

Role & Responsibilities

  • Designed the multi-tenant data model and the row-level security policies that isolate each business’s data.
  • Integrated Mercado Pago Checkout Pro for booking deposits and contributions, with webhook handling and automatic cancellation of bookings whose deposit expires.
  • Built a queued transactional email system (outbox table + scheduled worker) on Resend with React Email templates.
  • Set up the release process: one InsForge backend branch per git branch, schema diffing, and a release checklist before migrations reach production.

Key Challenges

  • Routing tenants by subdomain in production and by path in previews, while serving a separate Astro landing under the same domain through rewrites.
  • Making payments reliable: webhook processing, deposit expiry, and alerts when emails or webhooks fail.
  • Protecting public booking pages from abuse with booking limits and rate limiting.

Outcomes

  • Live in production at citadely.com.ar, with each business’s booking page on its own subdomain.
  • End-to-end tests with Playwright against isolated backend branches and a Mercado Pago mock, so payment flows are tested without touching production data.
  • Error monitoring with Sentry and scheduled jobs for email delivery, deposit expiry, and failure alerts.

Stack

  • App: Next.js 16 (App Router), React, TypeScript, Tailwind CSS, Node 24.
  • Backend: InsForge (Postgres, RLS, auth, storage, functions, schedules).
  • Payments & email: Mercado Pago Checkout Pro, Resend, React Email.
  • Quality & ops: Vitest, Playwright, ESLint, GitHub Actions CI, Sentry, Vercel Analytics.
  • Landing: Astro (static), deployed as a second Vercel project.