Thomas Cayne
Back to selected work

Founder · Product architecture, implementation, testing, and delivery · Active proprietary product

Gravity English

A live, multi-tenant English-learning product with server-defined courses, queued curriculum generation, and white-label delivery.

I am designing and implementing Gravity English as a paid product: a SvelteKit application that combines tenant-specific delivery, structured curriculum, identity, billing boundaries, and a separate autonomous-generation service.

Gravity English platform landing page introducing its English fluency infrastructure
Representative product artwork for the active Gravity English platform; the live product is available through the project link.

Private product · Public-safe system view

Tenant request to asynchronous curriculum generation

The interactive request path resolves tenant authority first, then commits generation work to a durable organization-scoped boundary so AI processing cannot hold the learner experience open.

  1. Tenant entry

    Host-resolved request

    A root domain, tenant subdomain, or verified custom domain supplies the host used to begin organization resolution.

  2. Application boundary

    Tenant-aware orchestration

    Request-time SvelteKit logic resolves organization, branding, localization, membership, role, and subscription context.

  3. Authority and context

    Application-owned data

    Clerk supplies authentication; PostgreSQL and Drizzle retain application authority and job state; S3 holds larger blueprint and media payloads.

  4. Durable handoff

    Persisted generation job

    The application hydrates authentic source context and commits an organization-scoped PENDING job instead of waiting on generation inside the browser request.

  5. Worker boundary

    Autonomous generation service

    Gravity Swarm Architect consumes queued curriculum work beyond the interactive web boundary, isolating long-running AI processing from active learners.

Constraint and context

Schools, teachers, and enterprise customers need distinct branding, membership, curriculum, and domains without a separate application build for every tenant. Curriculum generation also cannot block the interactive application or weaken tenant isolation.

Implemented approach
  • I implemented request-time host resolution that maps a subdomain to an organization, branding profile, localized dictionary, membership context, and subscription state
  • I separated Clerk authentication from application-owned users, organization memberships, and per-organization role authority stored in PostgreSQL
  • I designed generation handoffs that hydrate source context from PostgreSQL and S3, then persist blueprint and thumbnail work as organization-scoped queue records
Engineering decisions and tradeoffs
  • I replaced the legacy Angular/AnalogJS application with SvelteKit 5 because the active product needed server-driven behavior without the former SSR and build constraints
  • I kept curriculum in typed server-defined content so course structure can change independently from page deployments while the application still validates tenancy and rendering
  • I retained relational authority in PostgreSQL and Drizzle while placing larger blueprint and media payloads in S3, with a database fallback when object storage is unavailable
  • I separated long-running curriculum generation into Gravity Swarm Architect and accepted queue latency and additional operational complexity to keep AI work outside learner requests
Resulting capability
  • I made one application resolve tenant-specific brand, localization, organization, role, and subscription context for every request
  • I moved blueprint and thumbnail generation into persisted PENDING jobs instead of holding the browser request open
  • I kept curriculum and tenant configuration independently evolvable from the compiled interface

Technology used

  • SvelteKit
  • Svelte 5
  • TypeScript
  • Node.js
  • PostgreSQL
  • Drizzle ORM
  • Clerk
  • AWS S3