Skip to main content
Royal Glow is a monolithic modular monorepo, not microservices. Strict layer boundaries give the modularity of microservices without the ops burden — and three hard conventions hold everywhere: money is integer paise, IDs are app-generated text, and business logic never imports the database or framework.

Layered monorepo

The Bun + Turborepo workspace holds four apps/packages workspaces: The codebase enforces a strict dependency direction so business rules stay testable and framework-agnostic. Each layer may only import inward.
API routes are thin orchestrators: parse → validate with Zod → call business logic → return JSON. No database queries live in route handlers.

Hosting topology

apps/web and apps/admin are live on AWS; Render now hosts only the CMS. Pick a concern below.
The customer site (apps/web) and admin portal (apps/admin) are Next.js 16 App Router apps on AWS Lambda behind CloudFront in ap-southeast-1. sst.config.ts declares one sst.aws.Nextjs component per app; SST uses OpenNext to package the production output. Each app has an ARM64 SSR Lambda and its own CloudFront distribution.Cloudflare remains the authoritative DNS provider. SST manages only the DNS records needed for ACM validation and the public aliases; Cloudflare runs no web/admin application compute. Service catalogue endpoints read Neon directly through Drizzle. No Redis catalogue cache is implemented; a 5-minute Upstash read-through cache remains planned.

Observability

Five layers, each on a free tier. All third-party browser scripts load only after explicit cookie consent and only when their keys are configured.

Conventions

These hold across the whole monorepo and are covered in depth on the Conventions page.
  • Money is stored as integer paise; never floating point.
  • Timestamps are timestamptz (stored UTC, displayed IST).
  • Dates display as DD/MM/YYYY and currency in Indian grouping (₹1,00,000.00).
  • Every external integration is a guarded extension point: with no key configured it no-ops and logs, so the whole monorepo builds and runs locally without secrets.

Conventions

Money, dates, layering, and the API response envelope

Tech Stack

Every technology and why it was chosen

System Design

Formal HLD and LLD documents
Last modified on September 1, 2026