PROPOSAL · VOLUME II — TECHNICAL

Technical Architecture
& Implementation Plan

Architecture, technology stack, tool implementation details, security design, infrastructure, and delivery specifications for the RealizeAI Value Micro-SaaS Platform. Delivered under a Build + Operate engagement with hosting-first pricing.

Platform: realizeaivalue.com Stack: Next.js · Cloud SQL · Stripe · Vertex AI · Puppeteer MVP Tools: 20 (Categories 1-2) Duration: 5 Days (1 Week) Date: 24 March 2026
T-01

Architecture Overview

The RealizeAI Value platform follows a modern GCP-native architecture with a Next.js frontend on Cloud Run, Cloud SQL PostgreSQL backend with Row-Level Security, Firebase Auth, Stripe for payments, and a Vertex AI (Gemini 2.0 Flash) PDF generation pipeline. The architecture prioritizes a Form-Before-Download user flow with mandatory data capture for benchmarking, personalized output via maturity archetypes, and a 6-Category Hub navigation model (MVP: Categories 1-2, with Categories 3-6 visible as "Coming Soon").

Delivery Model: All architecture and integration work is led by John Lewis (Solutions Architect), augmented by BFI's 13-agent AI fleet. Agents handle code scaffolding, design system generation, QA automation, CI/CD, and documentation — enabling a 5-day delivery timeline for 20 tools that would traditionally require 24+ weeks with a 5-person team. See Volume I for the full delivery model and Volume III for detailed BOE.

Architecture Decisions: This volume reflects the Developer Brief requirements including: (1) 6-Category Hub navigation, (2) Form-Before-Download access model, (3) Vertex AI (Gemini 2.0 Flash) + Puppeteer PDF generation, (4) 20 MVP tools in Categories 1-2, and (5) RealizeAI brand design system (#1e3a5f, Garamond/Roboto).

Technology Stack Map

Frontend

Premium SPA with enterprise-grade UX

Next.js 14 TypeScript Tailwind CSS shadcn/ui Framer Motion

Backend / Database

Managed PostgreSQL with row-level security

Cloud SQL PostgreSQL 15 Row-Level Security Cloud Run Functions Firebase Auth

Payments

PCI-compliant checkout with Stripe (singles, bundles, annual)

Stripe Checkout Stripe Billing Webhooks VAT/Sales Tax

PDF Generation

AI-personalized premium reports

Vertex AI Gemini 2.0 Flash Puppeteer 4 Archetypes

Infrastructure

Auto-scaling cloud with global CDN

Cloud Storage (GCS) Cloud CDN Cloud Armor Cloud Run

Monitoring / Email

Full observability and transactional email

PostHog SendGrid GA4 UTM Tracking

Data Flow Architecture — Form-Before-Download

User Journey: Persona → Browse → Purchase → Form → PDF → Download

1. Persona Mirror → User self-selects persona (“I Need AI” / “My Pilot is Stuck” / “I’m Asked to Opine”) → recommended category highlighted

2. Category Hub → Cat 1 & 2 active (20 tools grouped by type); Cat 3-6 visible as "Coming Soon"

3. Add to Cart → Single tool ($97-197), Bundle A ($397, 5 tools), Bundle B ($697, all 20), or Annual ($997/yr)

4. Stripe Checkout → Payment processed → user account created/linked → confirmation email via SendGrid

5. Form Required (Non-Negotiable) → Mandatory assessment form: Org Name, Title, Revenue, Industry, AI Maturity Level, Use Case, Email

6. PDF Generation → Form data + tool_id → Vertex AI generates personalized content (archetype-specific) → Puppeteer renders HTML→PDF → stored in GCS

7. Delivery → Immediate download OR email delivery via SendGrid → cached PDF available for re-download without re-form

8. Benchmarking → Form data stored anonymized in form_responses table → aggregated for Phase 2 benchmarking dashboard

T-02

6-Category Hub Implementation

The core user interface features a Persona Mirror landing page with 3 self-select personas, leading to a 6-Category Hub. Categories 1-2 are fully active in MVP; Categories 3-6 are visible but locked with "Coming Soon" badges. Within each active category, tools are grouped by type (Scoring Tools, Templates, User Guides).

Category 1
AI Readiness Profile
3 tools · Diagnostics
Category 2
First AI Deployment
14 tools · Execution
Category 3
Coming Soon
TBD · Phase 2
Category 4
Coming Soon
TBD · Phase 2
Cat 5-6
Coming Soon
TBD · Phase 2

Persona Mirror: Three self-select persona cards (“I Know I Need AI But Don't Know How” / “My Pilot is Stuck” / “I'm Asked to Opine”) guide users to a recommended category. This is non-gating — users can browse all active categories regardless of persona selection. Persona data is stored for analytics.

T-03

Tool Implementation Matrix

Each of the 20 MVP tools falls into one of three implementation categories. Category determines the technical pattern, integrations, and output format.

Category Pattern Input Output Complexity
Scoring Tool React form → Cloud SQL → Score Engine → Vertex AI → Puppeteer PDF 6–15 questions + archetype Personalized multi-page branded PDF High (3–5 days/tool)
User Guide React accordion/tabs → Styled content (read-only) None (downloadable) Interactive web reference + downloadable PDF Low (1–2 days/tool)
Template React form → Template engine → Puppeteer PDF/Word Structured form fields Formatted PDF/Word/Excel Medium (2–4 days/tool)

Category 1: Know Your AI Readiness Profile (3 Tools)

Scoring Tool

Tandem Realization Matrix (TRM)

The moment of truth. 15-min two-axis matrix diagnostic. Plot your organization into one of 4 zones: Tourist, Bureaucrat, Hazard, or Accelerator. 6 dimensions scored on 1–5 scale. Personalized PDF with zone-specific recommendations.

Scoring Tool

3P Alignment Audit (Two-Lock System)

Exposes C-Suite perception gaps. Reinterprets diagnostic scores through Purposeful leadership, Profitable operations, and Pervasive execution lenses. Radar chart + gap analysis PDF.

User Guide

Swamp Draining Reality Check (Data Debt Calculator)

Brutal honesty on legacy data cleanup: how much time and money before you can START a 90-day AI sprint. Cost estimation guide with downloadable framework.

Category 2: Launch Your First AI Deployment (14 Tools)

ToolTypeEst. DaysKey Features
Master AI Initiative Charter (The Gateway)Template330+ structured fields → boardroom-ready charter PDF
The 4 Laws TemplateTemplate2Governance framework template
Scoping — The 3-Key VaultGuide1.5Interactive scoping methodology guide
The 30 Pearls for a Pilot ProjectGuide1.5Searchable best-practices catalog
Requirement Gathering TemplateTemplate2Structured requirements capture + export
Master AI Risk RegisterTemplate3Risk identification framework + Excel/PDF output
CFO Drift Mitigation PlannerTemplate3OpEx drift tracking + mitigation PDF
Macro YoY P&L ModelTemplate3.5Multi-tab financial model Excel/PDF
90-Day Sprint RACI MatrixTemplate2.5Role-based RACI matrix + exportable PDF
90-Day Implementation RoadmapGuide1.5Interactive sprint-by-sprint roadmap guide
Build vs. Buy ChecklistGuide1.5Decision framework with scoring
Procurement Red-Flag ChecklistGuide1.5Vendor evaluation red-flag interactive grid
Pilot Purgatory Extraction AuditScoring4"Kill or Scale" diagnostic with blocker analysis PDF
The Antibody AuditScoring412 questions → organizational resistance heatmap PDF

Total MVP Implementation Effort: 20 AI-powered tools — 5 scoring tools + 15 templates & guides. With the agent-augmented model, this is delivered in 5 working days (40 hours) by one architect + 13 AI agents — see Volume III for the detailed Basis of Estimate.

T-04

Database & Data Architecture

Core Schema (Cloud SQL / PostgreSQL)

TablePurposeRLS Policy
usersProfile: email, password_hash, name, created_atauth.uid() = id
categories6 content categories (name, slug, description, order)Public read
tools20 tools mapped to categories (name, type, description, price_min, price_max)Public read
bundlesBundle definitions (name, description, price, discount_percent, tools[])Public read
ordersPurchase records (user_id, bundle_id, total_price, status)auth.uid() = user_id
order_itemsLine items per order (order_id, tool_id, price)auth.uid() = orders.user_id
form_responsesMandatory assessment data (org, title, revenue, industry, maturity, use_case, email)auth.uid() = user_id
pdfsGenerated PDFs (user_id, tool_id, form_response_id, gcs_url, regenerated_count)auth.uid() = user_id
purchasesStripe payment records, tool access grantsauth.uid() = user_id
user_responsesAssessment inputs per tool per userauth.uid() = user_id
generated_reportsPDF metadata, GCS URLs, expiration datesauth.uid() = user_id
tool_feedbackThumbs up/down + comments per toolauth.uid() = user_id
benchmarking_dataAnonymized aggregated responses (no PII)Admin-only read
organization_settingsEnterprise tier: team management, admin controlsauth.uid() = admin_id
organization_membersMulti-seat user mapping for Enterprise tierauth.uid() IN (admin, member)

Form-Before-Download Access System

Gating is form-based, not credit-based. After Stripe checkout, a Cloud Run API function handles the access workflow:

1. Verify orders.status = 'paid' for user → 2. Present mandatory 7-field assessment form → 3. Validate + insert row in form_responses → 4. Trigger Vertex AI PDF generation → 5. Store PDF in GCS → 6. Return signed download URL

Form responses power the benchmarking data pipeline (anonymized, aggregated). Users who purchased bundles can access all tools in the bundle without re-purchasing.

T-05

Security Architecture

Security is embedded at every layer — not bolted on post-development. This aligns with BFI's production security track record (2 OWASP sprints, 23 findings remediated) and the BRD's stringent data privacy requirements.

🔐 Row-Level Security (RLS)
Aggressive Cloud SQL RLS policies enforce auth.uid() = user_id on every data table. User A cannot, under any circumstances, query User B's data. Pen-tested pre-launch.
🔑 Authentication
Firebase Auth with email/password + magic-link (passwordless). Session tokens expire after 14 days of inactivity. Future: SSO/SAML for Enterprise Plus tier.
💳 Payment Security
Stripe handles all PCI DSS compliance. BFI never touches raw card data. Stripe.js renders payment fields in secure iframes.
📄 PDF Watermarking
"© RealizeAI Value | Confidential" semi-transparent watermark on every PDF page. Copyright header on every report. 30-day auto-delete from GCS.
🛡️ OWASP Top-10 Audit
Full OWASP security audit at each phase gate. XSS prevention via React's built-in escaping. CSRF protection via Firebase Auth JWT. SQL injection impossible via parameterized queries.
📋 Compliance Stack
GDPR (right to deletion, data export), CCPA compliance, Terms of Service, Privacy Policy, DPA readiness for EU customers, disclaimers on all tools and PDFs.
T-06

Third-Party Integrations

ServicePurposeIntegration MethodPhase
StripePayments, billing, subscriptionsStripe.js + Webhooks to Cloud Run API1
Cloud SQLManaged PostgreSQL databaseCloud SQL Auth Proxy + connection pooling1
Firebase AuthAuthentication (50K MAU free)Firebase Admin SDK + client JS SDK1
Vertex AIAI-personalized PDF generationGemini 2.0 Flash REST API from Cloud Run1A
Cloud Storage (GCS)PDF storage with signed URLsGCS client library; signed download URLs1A
Cloud ArmorDDoS protection, WAF, bot mitigationCloud Armor security policy on HTTPS LB1A
SendGridTransactional + nurture emailsREST API from Cloud Run1B
PostHogProduct analytics, funnels, feature flagsPostHog JS SDK2
Google Analytics 4Campaign attribution, UTM trackingGA4 tag + GTM1
T-07

Performance & Scalability

MetricTargetApproach
Page Load Time< 2 secondsCDN-served static assets; code splitting; lazy loading
PDF Generation< 5 secondsPre-compiled templates; optimized chart rendering; async generation with loading state
Lighthouse Score≥ 90Image optimization; tree-shaking; minimal JS bundle; efficient CSS
Concurrent Users1,000+ simultaneousCloud SQL connection pooling; Cloud CDN caching; stateless Cloud Run containers
Database Queries< 100ms p95Indexed columns; optimized RLS policies; connection pooling
Uptime SLA99.5%Cloud Run managed uptime + Cloud Armor failover + Cloud Monitoring alerting

Scalability Path: The Cloud Run + Cloud SQL + CDN architecture scales horizontally without code changes. Moving from 100 to 10,000 users requires only Cloud SQL plan upgrades and CDN cache tuning — zero architectural refactoring.

T-08

5-Day Sprint Delivery Map

DayFocusDeliverablesMilestone
Day 1Foundation Cloud SQL schema (7+ tables + RLS), Stripe integration (singles, bundles, annual), RealizeAI design system, Firebase Auth flow, CI/CD pipeline, staging deploy Foundation ready
Day 2Commerce + UX Persona Mirror landing page, Category Hub (6 categories, 2 active), category detail pages, Form-Before-Download flow, cart/checkout, promo codes User journey live
Day 3Scoring Tools + PDF Pipeline Vertex AI PDF pipeline (Gemini → HTML → Puppeteer → GCS); TRM (scoring + zone classification); 3P Alignment Audit (15Q + radar); Pilot Purgatory Extraction; Swamp Draining Reality Check PDF pipeline + 4 tools live
Day 4Templates, Guides & Remaining Tools Antibody Audit (scoring); 15 templates & guides (batch pipeline build); SendGrid email integration; user dashboard; legal docs (TOS, Privacy, disclaimers) All 20 tools functional
Day 5QA + Launch Security audit (RLS pen-test, OWASP); E2E testing all 20 tools + all payment paths; book hub; production deployment + DNS + SSL + monitoring; client walkthrough + handoff ⭐ Production Live