Platform Architecture & Developer Reference
Version: 1.0
Last Updated: January 2026
Status: Internal + Developer Reference
Table of Contents
- System Overview
- Architecture Layers
- Data Model & Schema
- Connectors (Loaders)
- Routing & Permissions (Hubs)
- Automation Engine
- AI Integration
- Output Generation (Render)
- API Reference
- Webhooks
- Security & Compliance
- Infrastructure
- Deployment
1. System Overview
1.1 What IntegrateWise Does
IntegrateWise is a unified workspace platform that:
- Connects to external business tools via APIs
- Normalizes data into a consistent schema
- Routes data to appropriate teams/functions
- Provides AI-powered automation suggestions
- Generates documents and reports from unified data
1.2 Core Principles
| Principle | Implementation |
|---|
| Normalize Once | All data transformed to standard schema at ingestion |
| Render Anywhere | Same data outputs to any format (docs, slides, emails) |
| User Control | AI suggests, user approves — nothing auto-runs without consent |
| Tool Agnostic | Works with any tool that has an API |
1.3 High-Level Architecture
```
┌─────────────────────────────────────────────────────────────────────────────────┐
│ PRESENTATION │
│ React Frontend + Mobile (React Native) │
└─────────────────────────────────────────────────────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────────────────────────────┐
│ API GATEWAY │
│ Cloudflare Workers + KV Cache │
└─────────────────────────────────────────────────────────────────────────────────┘
│
┌──────────────────┼──────────────────┐
▼ ▼ ▼
┌─────────────┐ ┌─────────────┐ ┌─────────────┐
│ RENDER │ │ AUTOMATION │ │ BRAIN │
│ ENGINE │ │ ENGINE │ │ (AI MEM) │
│ (Output) │ │ (n8n/CF) │ │ (Vector) │
└─────────────┘ └─────────────┘ └─────────────┘
│ │ │
└──────────────────┼──────────────────┘
▼
┌─────────────────────────────────────────────────────────────────────────────────┐
│ ROUTING LAYER (HUBS) │
│ Permission checks, audit logging, data routing │
└─────────────────────────────────────────────────────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────────────────────────────┐
│ DATA LAYER (SPINE) │
│ Supabase PostgreSQL + Zod Schemas │
└─────────────────────────────────────────────────────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────────────────────────────┐
│ CONNECTOR LAYER │
│ OAuth handlers, API clients, sync jobs │
└─────────────────────────────────────────────────────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────────────────────────────┐
│ EXTERNAL TOOLS │
│ Slack, HubSpot, Gmail, Notion, Salesforce, etc. │
└─────────────────────────────────────────────────────────────────────────────────┘
```
2. Architecture Layers
2.1 Layer Summary
| Layer | Name | Purpose | Technology |
|---|
| 7 | Presentation | User interface, dashboards | React, React Native |
| 6 | Render Engine | Output generation | Cloudflare Workers |
| 5 | Automation | AI suggestions, workflows | n8n Cloud, Workers |
| 4 | Brain | AI memory, conversation storage | Supabase pgvector |
| 3 | Connectors | External tool integration | Node.js, OAuth 2.0 |
| 2 | Hubs | Routing, permissions, audit | PostgreSQL + RLS |
| 1 | Spine | Core data storage | Supabase PostgreSQL |
| 0 | External | Third-party tools | Various APIs |
3. Data Model & Schema
3.1 Core Entities (12 Zod Contracts)
All data is normalized to these core entities:
Account
```typescript
id: z.string().uuid(),
external_id: z.string(),
source: z.enum(['hubspot', 'salesforce', 'manual', 'import']),
name: z.string().min(1).max(255),
domain: z.string().url().optional(),
industry: z.string().optional(),
size: z.enum(['startup', 'smb', 'mid-market', 'enterprise']).optional(),
mrr: z.number().min(0).optional(),
arr: z.number().min(0).optional(),
currency: z.string().length(3).default('USD'),
status: z.enum(['prospect', 'active', 'churned', 'paused']),
health_score: z.number().min(0).max(100).optional(),
tags: z.array(z.string()).default([]),
custom_fields: z.record(z.unknown()).default({}),
created_at: z.string().datetime(),
updated_at: z.string().datetime(),
});
```
Contact
```typescript
id: z.string().uuid(),
external_id: z.string(),
source: z.enum(['hubspot', 'salesforce', 'gmail', 'manual']),
email: z.string().email(),
first_name: z.string().optional(),
last_name: z.string().optional(),
full_name: z.string().optional(),
phone: z.string().optional(),
title: z.string().optional(),
department: z.string().optional(),
role_type: z.enum(['champion', 'decision_maker', 'influencer', 'user', 'unknown']).optional(),
account_id: z.string().uuid().optional(),
owner_id: z.string().uuid().optional(),
engagement_score: z.number().min(0).max(100).optional(),
tags: z.array(z.string()).default([]),
created_at: z.string().datetime(),
updated_at: z.string().datetime(),
});
```
Deal
```typescript
id: z.string().uuid(),
external_id: z.string(),
source: z.enum(['hubspot', 'salesforce', 'manual']),
name: z.string().min(1).max(255),
amount: z.number().min(0),
currency: z.string().length(3).default('USD'),
stage: z.string(),
probability: z.number().min(0).max(100).optional(),
close_date: z.string().datetime().optional(),
account_id: z.string().uuid().optional(),
contact_ids: z.array(z.string().uuid()).default([]),
owner_id: z.string().uuid().optional(),
deal_type: z.enum(['new', 'renewal', 'upsell', 'expansion']).optional(),
created_at: z.string().datetime(),
updated_at: z.string().datetime(),
});
```
All 12 Entities
| Entity | Purpose | Key Fields |
|---|
| Account | Companies/organizations | name, domain, mrr, health_score |
| Contact | People at accounts | email, title, role_type, engagement |
| Deal | Sales opportunities | amount, stage, probability |
| Task | Action items | title, status, due_date, assignee |
| Event | Meetings, calls | start_time, end_time, attendees |
| Alert | Notifications | severity, category, status |
| Note | Comments, logs | content, note_type, visibility |
| Metric | KPIs, measurements | value, period, trend |
| ActivityLog | Audit trail | action, entity, actor |
| HealthScore | Account health | score, components, risk_factors |
| EngagementScore | Contact engagement | score, level, activity_counts |
| User | Internal users | email, role, team_ids |
4. Connectors (Loaders)
4.1 Available Connectors
Production Ready
| Connector | Data Types | Auth | Sync |
|---|
| Slack | Messages, channels, users | OAuth 2.0 | Real-time |
| HubSpot | Contacts, companies, deals | OAuth 2.0 | 15 min |
| Gmail | Emails, threads, labels | OAuth 2.0 | 5 min |
| Notion | Pages, databases | OAuth 2.0 | 15 min |
| Google Sheets | Rows, columns | OAuth 2.0 | On-demand |
Coming Soon
| Connector | Target Release |
|---|
| Salesforce | Q1 2026 |
| Zendesk | Q1 2026 |
| Intercom | Q1 2026 |
| GitHub | Q2 2026 |
| Jira | Q2 2026 |
| Stripe | Q1 2026 |
4.2 Connector Implementation
```typescript
export abstract class BaseConnector {
abstract getName(): string;
abstract getAuthUrl(): string;
abstract handleCallback(code: string): Promise<ConnectionCredentials>;
abstract refreshToken(): Promise<ConnectionCredentials>;
abstract sync(options: SyncOptions): Promise<SyncResult>;
abstract validateConnection(): Promise<boolean>;
}
```
5. Routing & Permissions (Hubs)
5.1 Hub Definitions
| Hub | Description | Data Types |
|---|
| Sales | Pipeline, leads, opportunities | accounts, contacts, deals |
| Marketing | Campaigns, content, analytics | contacts, campaigns, metrics |
| Customer Success | Health, renewals, engagement | accounts, health_scores, activities |
| Support | Tickets, issues, resolutions | tickets, contacts, accounts |
| Finance | Billing, invoices, revenue | accounts, invoices, payments |
| Product | Feature requests, bugs, feedback | feedback, tickets, accounts |
| HR | Team info, hiring, onboarding | users, teams |
| Tech | Incidents, deployments, code | incidents, deploys, repos |
| Legal | Contracts, compliance, approvals | contracts, approvals |
| Operations | Processes, workflows, efficiency | workflows, metrics |
5.2 Permission Levels
| Role | Permissions | Access |
|---|
| Admin | read, write, delete, admin | Everything |
| Manager | read, write, delete | Team + cross-team |
| Member | read, write | Own team |
| Viewer | read | Dashboards only |
5.3 Routing Rules
```typescript
// Example routing rules
const rules = [
{
name: 'HubSpot deals to Sales',
condition: { type: 'source', value: 'hubspot' },
data_types: ['deals'],
target_hub: 'sales',
},
{
name: 'Support keywords to Support hub',
condition: { type: 'keyword', value: ['refund', 'cancel', 'issue'] },
data_types: ['emails', 'messages'],
target_hub: 'support',
},
{
name: 'High-value deals to Sales + Leadership',
condition: { type: 'amount_threshold', value: 50000 },
data_types: ['deals'],
target_hub: ['sales', 'leadership'],
},
];
```
6. Automation Engine
6.1 Automation Structure
```typescript
interface Automation {
id: string;
name: string;
trigger: AutomationTrigger;
conditions: AutomationCondition[];
actions: AutomationAction[];
approval_mode: 'suggest_only' | 'auto_run_notify' | 'auto_run_silent';
enabled: boolean;
}
```
6.2 Trigger Types
| Trigger | Description | Example |
|---|
| record_created | New record added | New lead from form |
| record_updated | Record changed | Deal stage moved |
| field_changed | Specific field changed | Status → Churned |
| schedule | Cron-based | Daily at 9 AM |
| webhook | External trigger | Stripe payment |
| time_elapsed | No activity for X days | 7 days no response |
6.3 Action Types
| Action | Description |
|---|
| update_field | Change a field value |
| create_task | Create a task |
| send_notification | Send app/email notification |
| create_alert | Create an alert |
| assign_to | Assign to user |
| calculate_score | Recalculate health/engagement |
| call_webhook | POST to external URL |
6.4 Approval Modes
| Mode | Behavior |
|---|
| suggest_only | Creates suggestion, user approves |
| auto_run_notify | Runs automatically, notifies user |
| auto_run_silent | Runs automatically, no notification |
7. AI Integration
7.1 Supported AI Services
| Service | Use Case | Model |
|---|
| OpenAI | Default completions | gpt-4-turbo |
| Anthropic | Alternative completions | claude-3-opus |
| BYOM | Custom models | User-provided |
7.2 AI Features
| Feature | Description |
|---|
| Completions | Text generation |
| Embeddings | Vector search |
| Summarization | Condense text |
| Classification | Categorize content |
| Entity Extraction | Extract names, dates, etc. |
7.3 Brain (Vector Memory)
```typescript
export class BrainService {
async store(conversation: Conversation): Promise<void>;
async search(query: string, options: SearchOptions): Promise<Memory[]>;
async getRelated(memoryId: string, limit: number): Promise<Memory[]>;
}
```
7.4 BYOM (Bring Your Own Model)
```typescript
const customModel = new BYOMService({
endpoint: 'https://my-model.company.com/v1/completions',
apiKey: process.env.CUSTOM_MODEL_API_KEY,
});
aiRouter.setCustomService('custom', customModel);
```
8. Output Generation (Render)
8.1 Supported Formats
| Format | Extension | Use Case |
|---|
| Document | .docx | Reports, proposals |
| Slides | .pptx | Presentations |
| PDF | .pdf | Final documents |
| Email | HTML/Text | Outreach |
| CSV | .csv | Data export |
| JSON | .json | API responses |
8.2 Template System
```typescript
// Placeholders
{{account.name}}
{{health_score.score}}
{{formatDate(created_at, 'MMMM D, YYYY')}}
{{formatCurrency(amount, 'USD')}}
```
8.3 Built-in Templates
| Template | Format | Data Sources |
|---|
| Weekly Status Report | DOCX | accounts, deals, activities |
| Customer Health Report | DOCX | account, health_score, tickets |
| QBR Deck | PPTX | account, metrics, deals |
| Pipeline Report | PDF | deals, metrics |
| Check-in Email | Email | account, activities |
9. API Reference
9.1 Authentication
```http
Authorization: Bearer <api_key>
```
9.2 Base URL
```
Production: https://api.integratewise.com/v1
```
9.3 Endpoints Summary
| Resource | List | Get | Create | Update | Delete |
|---|
| Accounts | ✅ | ✅ | ✅ | ✅ | ✅ |
| Contacts | ✅ | ✅ | ✅ | ✅ | ✅ |
| Deals | ✅ | ✅ | ✅ | ✅ | ✅ |
| Tasks | ✅ | ✅ | ✅ | ✅ | ✅ |
| Notes | ✅ | ✅ | ✅ | ✅ | ✅ |
| Automations | ✅ | ✅ | ✅ | ✅ | ✅ |
| Suggestions | ✅ | ✅ | - | - | - |
| Health Scores | ✅ | ✅ | - | - | - |
| Webhooks | ✅ | ✅ | ✅ | ✅ | ✅ |
9.4 Response Format
```json
{
"success": true,
"data": { ... },
"meta": {
"page": 1,
"limit": 20,
"total": 150
}
}
```
9.5 Error Codes
| Code | HTTP | Description |
|---|
| UNAUTHORIZED | 401 | Invalid API key |
| FORBIDDEN | 403 | Insufficient permissions |
| NOT_FOUND | 404 | Resource not found |
| VALIDATION_ERROR | 400 | Invalid data |
| RATE_LIMITED | 429 | Too many requests |
| INTERNAL_ERROR | 500 | Server error |
10. Webhooks
10.1 Webhook Events
| Event | Description |
|---|
| account.created | New account |
| account.updated | Account changed |
| deal.stage_changed | Deal moved |
| deal.won | Deal closed won |
| deal.lost | Deal closed lost |
| health.changed | Health score changed |
| alert.created | New alert |
| automation.triggered | Automation ran |
10.2 Webhook Payload
```json
{
"id": "evt_abc123",
"type": "deal.won",
"created_at": "2026-01-07T10:30:00Z",
"data": {
"deal": { "id": "deal_xyz", "name": "Acme Corp", "amount": 50000 },
"account": { "id": "acc_123", "name": "Acme Corp" }
}
}
```
11. Security & Compliance
11.1 Data Security
| Measure | Implementation |
|---|
| Encryption at Rest | AES-256 |
| Encryption in Transit | TLS 1.3 |
| Key Management | AWS KMS |
| Data Isolation | Row-level security |
11.2 Authentication
| Feature | Implementation |
|---|
| User Auth | Supabase Auth |
| API Auth | API keys with scopes |
| Session | JWT, 24h expiry |
| MFA | TOTP-based 2FA |
11.3 Compliance
| Standard | Status |
|---|
| GDPR | Compliant |
| SOC 2 | In progress |
| HIPAA | Roadmap |
12. Infrastructure
12.1 Stack
| Component | Technology | Provider |
|---|
| Frontend | React + Vite | Cloudflare Pages |
| API | Cloudflare Workers | Cloudflare |
| Database | PostgreSQL | Supabase |
| Cache | KV Store | Cloudflare KV |
| Queue | Queues | Cloudflare Queues |
| Automation | n8n | n8n Cloud |
| AI | OpenAI + Anthropic | Direct API |
| Storage | R2 | Cloudflare R2 |
12.2 Monthly Costs
| Service | Monthly Cost |
|---|
| Cloudflare Pages | $5 |
| Cloudflare Workers | $5 |
| Cloudflare R2 | ~$5 |
| Supabase Pro | $25 |
| n8n Cloud | $20 |
| OpenAI API | ~$50 |
| Total | ~$110/month |
13. Rate Limits
| Endpoint | Limit | Window |
|---|
| Read operations | 1000 | 1 min |
| Write operations | 100 | 1 min |
| Bulk operations | 10 | 1 min |
| Search | 100 | 1 min |
| Render | 20 | 1 min |
Glossary
| Term | Definition |
|---|
| Spine | Core data layer with normalized schemas |
| Hub | Routing layer for data access |
| Loader | Connector for external tools |
| Brain | AI memory with vector search |
| Render | Output generation engine |
| Contract | Zod schema for entities |
| BYOM | Bring Your Own Model |
IntegrateWise Technical Documentation
Version 1.0 — January 2026
For questions: engineering@integratewise.com