Platform Architecture
Engineered as Infrastructure, Not a Template.
Every Rival Practice engagement is a purpose-built deployment of a single, opinionated stack: edge-rendered React, isolated relational partitions, event-driven intake, and compliance-locked AI — all wired together for regulated professional firms.
System Topology
The Five-Layer Stack
A vertically integrated platform where every layer is owned, observable, and individually hardened — no third-party page builders, no shared CMS, no leaky surfaces.
Edge Presentation Layer
React 19 · TanStack Start · Cloudflare Workers
Server-rendered React shipped from 300+ global edge nodes. Sub-100ms TTFB worldwide.
Application Runtime
TanStack Server Functions · Typed RPC · Zod
End-to-end typed contracts between client and server. No untyped REST surfaces.
Compliance-Locked AI Orchestration
Lovable AI Gateway · Provider-agnostic routing
Model calls are sandboxed, audit-logged, and gated by per-tenant policy.
Data Plane
Isolated PostgreSQL partitions · Row-Level Security
One database partition per firm. RLS policies enforced before any query reaches disk.
Trust & Identity Substrate
JWT + Refresh Rotation · MFA · Audit Ledger
Cryptographic identity verification on every request. Immutable event logs.
Pillar 01 · Tenancy
Single-Tenant by Default
Most agencies host every client on one shared WordPress instance and one shared MySQL box. Rival Practice does the opposite. Every firm receives an isolated Git repository, an isolated database partition, and an isolated deployment pipeline. A neighboring tenant's outage, breach, or migration cannot reach yours.
- Dedicated Git repository per engagement
- Isolated serverless PostgreSQL partition
- Per-tenant CI/CD pipeline with independent rollback
- No shared connection pools, table prefixes, or session stores
Deployment Isolation Model
Firm Alpha
Firm Beta
Firm Gamma
Zero inter-tenant data paths · enforced at network edge
Request Path · Global Edge
Median total: 85ms TTFB · 99th percentile under 180ms
Pillar 02 · Edge Rendering
Server-Rendered React at the Edge
We do not ship single-page-app shells that crawl-bots cannot read. Every page is server-rendered through TanStack Start on Cloudflare's edge network, producing fully hydrated HTML in sub-100ms windows worldwide. The result: superior Core Web Vitals, native search indexability, and zero blank-screen flashes.
- 300+ global edge points of presence
- Sub-100ms median TTFB across continents
- First-paint HTML — no JS-only blank states
- Streaming SSR with progressive hydration
Pillar 03 · Intake Pipeline
Event-Driven Client Intake
Every inbound lead is an event — validated at the edge, normalized through a typed schema, persisted into the tenant partition, and fanned out to notification, conflict-check, and CRM-sync workers. No lost leads. No silent email-bin black holes. Every step is observable and replayable.
- Zod-validated form submissions at the edge boundary
- Idempotent writes with deduplication keys
- Asynchronous fan-out to notification & CRM workers
- Replayable dead-letter queue for failed events
Intake Event Fan-Out
intake.submitted · event v1
Notify
email · sms
Persist
db · ledger
CRM Sync
webhook
AI Request Gate
PROVIDER
routed · pinned
TEMP CAP
0.3 max
Pillar 04 · AI Orchestration
Compliance-Locked AI, Not Wild-West Prompts
AI inside a regulated firm is a liability unless it is fenced. Every model call inside Rival Practice passes through a policy gate: tenant configuration is loaded, inputs are scrubbed of PII, outputs are classified for unauthorized-practice-of-law or defamation risk, and the entire transaction is written to the immutable audit ledger before a single token reaches the client.
- Provider-agnostic routing (no vendor lock-in)
- Per-tenant model allowlist & temperature ceilings
- Automatic PII detection and redaction
- Full prompt / completion audit trail per request
Pillar 05 · Observability
Operational Telemetry, Not Hope
Every deployment ships with structured logs, distributed traces, real-user metrics, and a defined service-level objective. We do not learn about an outage from your client.
Uptime SLO
99.95%
rolling 30d
Median TTFB
85ms
edge p50
Deploy Frequency
On-Demand
per-tenant
MTTR
< 12min
auto-rollback
Live Health Surfaces
streamingOwned, Not Rented
No page builders, no shared CMS surfaces, no third-party plugins in the critical path.
Composable, Not Monolithic
Each capability is an independently deployable module wired through typed contracts.
Compliant by Construction
Audit, isolation, and policy checks are architectural primitives — not bolted-on plugins.
Want to see the architecture applied to your firm?
We walk you through the per-tenant deployment, isolation boundaries, and AI policy configuration on a live strategy call.
