The Core Stack

Frontend: WeWeb — pixel-perfect UI, connects to any backend, deploys to your own domain on Cloudflare CDN.

Database + Auth: Supabase — PostgreSQL, Row-Level Security, realtime subscriptions, file storage.

Business Logic + API: Xano — REST API builder, custom business logic, third-party integrations, webhooks.

Payments: Stripe — subscriptions, invoices, webhooks back to Xano.

Email: Resend or SendGrid — transactional emails triggered by Xano.

This stack handles 10,000 MAU without breaking a sweat. We've run it at 50K MAU without infrastructure changes.

Multi-Tenancy with Supabase RLS

Every table has a workspace_id column. All Row-Level Security policies filter on workspace_id = auth.jwt() ->> 'workspace_id'.

Users belong to workspaces via a workspace_members table with a role column (owner, admin, member). When a user signs in, the JWT includes their workspace_id and role — Supabase enforces this automatically at the database level.

This is the most important architectural decision in a B2B SaaS. Get it right from day 1.

Billing Architecture with Stripe

In Xano, create a webhooks endpoint that receives Stripe events. Handle: checkout.session.completed (create subscription record), customer.subscription.updated (update plan), invoice.payment_failed (restrict access).

Store subscription status in a workspace_settings table. In WeWeb, check subscription status before rendering premium features — and in Supabase RLS policies for data-level restrictions.

Never trust the frontend for billing gates. Always verify in the database.

Performance Optimization

Index strategy: index every foreign key, every status/type column used in filters, and any column you sort by. In Supabase, this takes 2 minutes in the SQL editor.

Pagination: all list endpoints must paginate. Never return unbounded queries. Use cursor-based pagination for real-time data (infinite scroll) and offset for admin tables.

Caching: Xano supports response caching for endpoints that return the same data across users (public content, lookup tables). Use it aggressively.

Monitoring & Error Handling

Add Sentry to your WeWeb custom code for frontend errors. Xano logs all API requests — export them to Datadog or use Xano's built-in error monitoring.

For critical background jobs (billing webhooks, email triggers), add error notifications to Slack via Make. You should know about failures before your users do.

Database monitoring: Supabase provides query performance insights. Review slow queries weekly.