Unclassified

IntegrateWise - Complete Integration Manifest

Tier C — Historical. This document is a point-in-time snapshot preserved for reference. For current architecture, see CANONICAL_PLATFORM_ARCHITECTURE.md.

Status: ✅ FULLY BOUND AND INTEGRATED
Date: February 27, 2026
Architecture: L3 → L2 → L1


Integration Overview

┌─────────────────────────────────────────────────────────────────────────┐
│                           L1: UI LAYER                                  │
│  ┌──────────┐ ┌──────────┐ ┌──────────┐ ┌──────────┐ ┌──────────┐      │
│  │ Dashboard│ │ Accounts │ │  Tasks   │ │ Calendar │ │ Settings │      │
│  │  (12)    │ │          │ │          │ │          │ │          │      │
│  └────┬─────┘ └────┬─────┘ └────┬─────┘ └────┬─────┘ └────┬─────┘      │
│       │            │            │            │            │            │
│       └────────────┴────────────┴────────────┴────────────┘            │
│                              │                                          │
│                    ┌─────────┴──────────┐                               │
│                    │   React Hooks (8)  │                               │
│                    └─────────┬──────────┘                               │
└──────────────────────────────┼──────────────────────────────────────────┘
                               │
┌──────────────────────────────┼──────────────────────────────────────────┐
│                           L2: API LAYER                                 │
│  ┌──────────┐ ┌──────────┐ ┌──────────┐ ┌──────────┐ ┌──────────┐      │
│  │   Auth   │ │ Entities │ │ Insights │ │ Actions  │ │  Tasks   │      │
│  │          │ │   API    │ │   API    │ │   API    │ │   API    │      │
│  └────┬─────┘ └────┬─────┘ └────┬─────┘ └────┬─────┘ └────┬─────┘      │
│       │            │            │            │            │            │
│  ┌────┴─────┐ ┌────┴─────┐ ┌──────────┐ ┌──────────┐                   │
│  │ Calendar │ │Dashboard │ │ Settings │ │ Supabase │                    │
│  │   API    │ │   API    │ │   API    │ │  Client  │                    │
│  └────┬─────┘ └────┬─────┘ └────┬─────┘ └────┬─────┘                   │
│       └────────────┴────────────┴────────────┘                          │
└─────────────────────────────────────────────────────────────────────────┘
                               │
┌──────────────────────────────┼──────────────────────────────────────────┐
│                           L3: BACKEND                                   │
│  ┌─────────────────────────────────────────────────────────────────┐   │
│  │                     Supabase PostgreSQL                          │   │
│  │  ┌────────────┐ ┌────────────┐ ┌────────────┐ ┌────────────┐   │   │
│  │  │   spine_   │ │ knowledge_ │ │   actions  │ │  profiles  │   │   │
│  │  │ entities   │ │  insights  │ │            │ │            │   │   │
│  │  └────────────┘ └────────────┘ └────────────┘ └────────────┘   │   │
│  │  ┌────────────┐ ┌────────────┐ ┌────────────┐ ┌────────────┐   │   │
│  │  │ spine_tasks│ │spine_events│ │  settings  │ │   RLS      │   │   │
│  │  │            │ │            │ │            │ │ policies   │   │   │
│  │  └────────────┘ └────────────┘ └────────────┘ └────────────┘   │   │
│  └─────────────────────────────────────────────────────────────────┘   │
└─────────────────────────────────────────────────────────────────────────┘

Complete Binding Matrix

L3 → L2 Binding (API Layer)

Backend TableAPI ModuleStatus
profilesauth.ts✅ Full CRUD + OAuth
spine_entitiesentities.ts✅ Full CRUD + 360 view
knowledge_insightsinsights.ts✅ Query + Filter
actionsactions.ts✅ HITL Workflow
spine_taskstasks.ts✅ Full CRUD
spine_eventscalendar.ts✅ Full CRUD
user_settingssettings.ts✅ CRUD
workspace_settingssettings.ts✅ CRUD
integrationssettings.ts✅ Read + Disconnect
audit_logssettings.ts✅ Read-only

L2 → L1 Binding (Hook Layer)

API ModuleReact HookUI Components Using It
auth.tsuseAuthAll protected pages, AppHeader, AppSidebar
entities.tsuseEntities, useEntityStatsAccountsPage, DashboardPage
insights.tsuseInsights, useInsightStatsIntelligencePage
actions.tsuseActionsIntelligencePage, DashboardPage
tasks.tsuseTasksTasksPage
calendar.tsuseCalendarCalendarPage
dashboard.tsuseDashboardStats, useDomainEntities, useDomainSignals, useConnectorsDashboardPage, AppHeader, AppSidebar
settings.tsuseSettings, useUserSettings, useWorkspaceSettings, useIntegrations, useAuditLogSettingsPage

Domain View Integration (12 Domains)

DomainEntity TypesHookTable Columns
Customer Successaccount, contact, subscriptionuseDomainEntities('customer-success')Account, Health, Stage, ARR, Risk
Salesopportunity, deal, lead, quoteuseDomainEntities('sales')Deal, Value, Stage, Close Date, Confidence
RevOpsmetric, forecast, territoryuseDomainEntities('revops')Metric, Current, Target, Variance, Trend
Marketingcampaign, lead, contentuseDomainEntities('marketing')Campaign, Status, Leads, MQLs, ROI
Product & Engfeature, bug, story, epicuseDomainEntities('product-eng')Item, Type, Priority, Status, Owner
Financeinvoice, transaction, expenseuseDomainEntities('finance')Item, Amount, Status, Due Date, Category
Serviceticket, case, articleuseDomainEntities('service')Ticket, Priority, Status, Assignee, SLA
Procurementvendor, purchase_order, contractuseDomainEntities('procurement')PO, Vendor, Amount, Status, Delivery
IT Adminasset, user, licenseuseDomainEntities('it-admin')Asset, Type, User, Status, Expiry
Educationstudent, course, enrollmentuseDomainEntities('education')Student, Course, Progress, Attendance, Grade
Personaltask, goal, habituseDomainEntities('personal')Item, Type, Due, Priority, Status
BizOpsproject, process, kpiuseDomainEntities('bizops')Initiative, Owner, Status, Progress, Impact

Route Integration

Marketing Routes (Public)

/                    → HomePage
/platform           → PlatformPage
/who-its-for        → WhoItsForPage
/pricing            → PricingPage
/security           → SecurityPage
/story              → StoryPage
/integrations       → IntegrationsPage
/login              → LoginPage (with useAuth)
*                   → NotFound

App Routes (Protected)

/app                → DashboardPage (12 domain views)
/app/dashboard      → DashboardPage
/app/accounts       → AccountsPage (useEntities)
/app/tasks          → TasksPage (useTasks)
/app/calendar       → CalendarPage (useCalendar)
/app/intelligence   → IntelligencePage (useInsights, useActions)
/app/settings       → SettingsPage (useSettings)

All app routes wrapped in:

  • ProtectedRoute (auth check)
  • AppLayout (sidebar + header)
  • AppHeader (useAuth + useDomainSignals)
  • AppSidebar (useAuth + useDashboardStats + useConnectors)

Authentication Flow Integration

LoginPage
    ↓ (email/password or OAuth)
useAuth.login() / useAuth.loginWithOAuth()
    ↓
api/auth.ts → supabase.auth.signInWithPassword()
    ↓
getCurrentUser() → profiles table
    ↓
AuthContext.user = user
    ↓
ProtectedRoute allows access
    ↓
AppLayout renders with user data
    ↓
All child pages have access to auth

Data Flow Examples

Example 1: Loading Accounts

AccountsPage mounts
    ↓
useEntities() hook called
    ↓
getEntities() API call
    ↓
supabase.from('entity_360').select('*')
    ↓
RLS policy checks tenant_id
    ↓
Data returns → hook sets state
    ↓
AccountsPage renders entity table

Example 2: Creating a Task

TasksPage → handleAddTask()
    ↓
useTasks.addTask() with tenant_id from useAuth
    ↓
api/tasks.ts createTask()
    ↓
supabase.from('spine_tasks').insert()
    ↓
RLS checks tenant_id matches workspace
    ↓
Real-time subscription updates list
    ↓
TasksPage shows new task

Example 3: Switching Domain View

DashboardPage → setActiveDomain('sales')
    ↓
useDomainEntities('sales') re-fetches
    ↓
getDomainEntities() with entityTypes=['opportunity', 'deal', 'lead']
    ↓
spine_entities filtered by type
    ↓
Data transforms to sales columns
    ↓
Table re-renders with sales data

File Integration Tree

apps/web/src/
├── main.tsx                          → Entry, ErrorBoundary, AuthProvider
├── App.tsx                           → RouterProvider
├── routes.tsx                        → All routes with ProtectedRoute
│
├── components/
│   ├── app/
│   │   ├── AppLayout.tsx             → AppHeader + AppSidebar + Outlet
│   │   ├── AppHeader.tsx             → useAuth, useDomainSignals
│   │   ├── AppSidebar.tsx            → useAuth, useDashboardStats, useConnectors
│   │   ├── ProtectedRoute.tsx        → useAuth guard
│   │   │
│   │   ├── DashboardPage.tsx         → useDashboardStats, useDomainEntities
│   │   │                             (12 domain views)
│   │   ├── AccountsPage.tsx          → useEntities, useEntityStats
│   │   ├── TasksPage.tsx             → useTasks, useAuth
│   │   ├── CalendarPage.tsx          → useCalendar
│   │   ├── IntelligencePage.tsx      → useInsights, useActions
│   │   └── SettingsPage.tsx          → useSettings
│   │
│   ├── pages/                        → Marketing pages (no hooks)
│   │   ├── HomePage.tsx
│   │   ├── LoginPage.tsx             → useAuth
│   │   ├── PlatformPage.tsx
│   │   ├── PricingPage.tsx
│   │   ├── SecurityPage.tsx
│   │   ├── StoryPage.tsx
│   │   ├── IntegrationsPage.tsx
│   │   └── NotFound.tsx
│   │
│   ├── ui/                           → 45 shadcn components (presentational)
│   └── workspace/
│       └── WorkspaceScreen.tsx       → Visual component (not used)
│
├── hooks/
│   ├── useAuth.tsx                   → AuthProvider + useAuth
│   ├── useEntities.ts                → getEntities, getEntityStats
│   ├── useInsights.ts                → getInsights, getInsightStats
│   ├── useActions.ts                 → getPendingActions, approveAction, etc.
│   ├── useTasks.ts                   → getTasks, createTask, completeTask
│   ├── useCalendar.ts                → getEvents, createEvent
│   ├── useDashboard.ts               → getDashboardStats, getDomainEntities, etc.
│   ├── useSettings.ts                → getUserSettings, getWorkspaceSettings, etc.
│   └── index.ts                      → Barrel export
│
├── lib/
│   └── api/
│       ├── supabase.ts               → Supabase client
│       ├── auth.ts                   → Auth API
│       ├── entities.ts               → Entities API
│       ├── insights.ts               → Insights API
│       ├── actions.ts                → Actions API
│       ├── tasks.ts                  → Tasks API
│       ├── calendar.ts               → Calendar API
│       ├── dashboard.ts              → Dashboard API (12 domains)
│       ├── settings.ts               → Settings API
│       └── index.ts                  → Barrel export
│
└── test/
    ├── setup.ts                      → Test mocks
    ├── smoke.test.tsx                → Basic smoke tests
    └── integration.test.tsx          → Full integration tests

Import Resolution

Short Imports (via index.ts)

// All work:

Direct Imports

// Also work:

Build Verification

cd integratewise-complete/apps/web
npm run build

✓ Build succeeds
✓ 3,016 modules transformed
✓ JS: 1,040 KB (305 KB gzipped)
✓ CSS: 68 KB (10 KB gzipped)
✓ All imports resolved
✓ No TypeScript errors
✓ No missing exports

Testing Integration

npm test

✓ Smoke tests pass
✓ API layer imports work
✓ Hook layer imports work
✓ Component imports work
✓ Data flow integration verified

What's Bound

LayerComponentBound ToStatus
L1DashboardPageuseDashboardStats, useDomainEntities, useDomainSignals✅
L1AccountsPageuseEntities, useEntityStats✅
L1TasksPageuseTasks, useAuth✅
L1CalendarPageuseCalendar✅
L1IntelligencePageuseInsights, useActions✅
L1SettingsPageuseSettings (user, workspace, integrations)✅
L1LoginPageuseAuth✅
L1AppHeaderuseAuth, useDomainSignals✅
L1AppSidebaruseAuth, useDashboardStats, useConnectors✅
L1ProtectedRouteuseAuth✅
L2All hooksCorresponding API modules✅
L2All APIsSupabase client✅
L3SupabasePostgreSQL database✅
L3Database49 migrations + RLS policies✅

Conclusion

All layers are fully bound and integrated:

  • ✅ L3 Backend (Supabase) - Complete
  • ✅ L2 API Layer (8 modules) - Complete
  • ✅ L2 Hook Layer (8 hooks) - Complete
  • ✅ L1 UI Layer (all pages) - Complete
  • ✅ Auth Flow - Complete
  • ✅ 12 Domain Views - Complete
  • ✅ Build System - Complete
  • ✅ Test System - Complete

Ready for production deployment.