Executive Summary
Royal Glow Salon & Spa is a premium beauty and wellness establishment in Bengaluru, India. This document describes the high-level design of the full-stack digital operations platform.Royal Glow uses a monolithic modular monorepo on Next.js 16 + Neon. The customer and admin apps run on AWS Lambda behind CloudFront through SST, with Cloudflare retained for authoritative DNS and R2 storage. The platform is designed for 20k–50k users, India-first (DPDP, IST, paise, GST 18%), with Lighthouse ≥95 performance and 100 accessibility/SEO.
Scale Targets
Key Constraints
Architecture Overview
Layered Monorepo
Hosting Topology
Technology Decisions Matrix
Data Architecture
Database Strategy
Neon PostgreSQL 16 with Git-like branching.Data Model Overview (38 tables)
Key Data Conventions
Current Data Paths and Planned Cache
Authentication & Authorization
Auth Architecture
- Provider & Sessions
- RBAC Model
- OAuth Flow
- Provider: Google OAuth 2.0 only (no email/password)
- Sessions: PostgreSQL
sessiontable (HttpOnly, Secure, SameSite=Lax cookies) - CSRF: Built-in via Better Auth
- Token type: Session-based (not JWT) — revocable, server-validated
API Design
Thin API Layer Pattern
Standard Response Shape
API Groups
Non-Functional Requirements
Related Pages
Low-Level Design
State machines, sequences, indexes, and security implementation
Data Model
All 38 tables, enums, and ID formats
Architecture
Condensed architecture overview
