Skip to main content

Platform Guide

The EnterpriseAI platform is a managed backend that provides data storage, authentication, authorization, AI services, and multi-tenancy for vertical applications built with the Vertical Template.

Instead of building backend infrastructure from scratch, vertical applications connect to the platform through a typed SDK and a secure BFF proxy. The platform handles the hard parts -- data persistence, user authentication, tenant isolation, document processing, and AI-powered chat -- so that delivery teams can focus entirely on domain-specific UI and business logic.

What the Platform Provides

CapabilityDescription
Data StorageTyped CRUD operations with JSONB resources, relationships, actions, and version history
AuthenticationMicrosoft Entra ID (CIAM) integration via Auth.js with secure token management
AuthorizationTenant-scoped RBAC policies evaluated by OPA/Rego
AI ServicesRAG-powered chat with SSE streaming, document classification, and indexing
Multi-TenancyComplete tenant isolation with per-tenant configuration, branding, and data scoping
DeploymentAzure App Service deployment with GitHub Actions CI/CD

How It Works

Every vertical application follows the same pattern:

  1. Define your data model using Object Types in src/eai.config/object-types.ts
  2. Seed the types to the platform's Configurator service
  3. Build your UI using React hooks that call the Platform SDK
  4. All API calls flow through a BFF proxy that injects auth tokens server-side
  5. Deploy to Azure App Service via GitHub Actions

The platform's five backend services (PublicAPI, Configurator, ResourceAPI, AICore, and Authz) handle everything behind the scenes.

Guide Contents

SectionWhat You Will Learn
ArchitectureHow the five platform services connect and how requests flow from browser to backend
ServicesDetailed breakdown of each platform service and its responsibilities
AuthenticationAuth.js + Entra ID setup, token flow, BFF proxy pattern, and client credentials
Object TypesDefining data models with field types, actions, link types, and validation
ResourcesCRUD operations using the Platform SDK, React hooks, and CLI commands
AI IntegrationChat streaming, document upload, RAG indexing, and the useChat hook
Tenant ManagementMulti-tenancy configuration, tenant isolation, and switching
DeploymentAzure App Service deployment, CI/CD pipeline, and environment configuration

Key Technologies

  • Next.js 15+ with App Router for the frontend framework
  • TypeScript in strict mode across all code
  • Platform SDK (@enterpriseaigroup/platform-sdk) for typed API calls
  • Auth.js (NextAuth v5) for authentication
  • Microsoft Entra ID (CIAM) as the identity provider
  • FastAPI powering the backend gateway and services
  • PostgreSQL for resource data storage (JSONB)
  • MongoDB/Cosmos DB for configuration metadata
  • OPA Rego for policy-based authorization

Platform SDK

The Platform SDK (@enterpriseaigroup/platform-sdk) is the primary way your application interacts with the platform. It provides typed TypeScript wrappers for every platform endpoint, organized into modules:

ModulePurposeExample
resourcesCRUD operations on typed resourcesclient.resources.create('Application', data)
chatStreaming and non-streaming chatclient.chat.stream({ message, conversationId, params })
documentsUpload, classify, and index documentsclient.documents.upload(file, options)
orchestrateGeneric proxy to any backend serviceclient.orchestrate({ target_backend, endpoint })
usersUser provisioning and profile managementclient.users.provisionMe({ tenant_id })
authCurrent user informationclient.auth.me()
import { EAIPlatformClient } from '@enterpriseaigroup/platform-sdk';

const client = new EAIPlatformClient({ tenantId: 'my-tenant' });

// All calls go through the BFF proxy automatically
const apps = await client.resources.list('Application', { page: 1, limit: 20 });

Project Structure

Vertical applications follow a standard project structure. Understanding where key files live will help you navigate the codebase:

src/
├── app/
│ ├── api/
│ │ ├── auth/[...nextauth]/ # Auth.js endpoints
│ │ ├── eai/[[...rest]]/ # BFF proxy -> PublicAPI
│ │ └── eai/stream/[[...rest]]/ # SSE stream proxy -> PublicAPI chat
│ └── (presentation)/ # UI pages (your domain screens)

├── eai.config/ # Config-driven architecture
│ ├── index.ts # Config registry
│ ├── types.ts # TypeScript types for config
│ ├── object-types.ts # Domain object type definitions
│ └── tenants/ # Per-tenant configuration files

├── hooks/ # React hooks
│ ├── useResources.ts # Generic CRUD hook
│ ├── useChat.ts # Chat streaming hook
│ └── useDocuments.ts # Document upload hook

├── auth.ts # Auth.js configuration
└── middleware.ts # Route protection

Getting Started

If you are new to the platform, we recommend reading the guides in order:

  1. Start with Architecture to understand the overall system design
  2. Read Services to learn what each backend service does
  3. Study Authentication to understand the security model
  4. Learn about Object Types to define your data model
  5. Use Resources to build your data access layer
  6. Add AI Integration for chat and document processing
  7. Configure Tenant Management for multi-tenancy
  8. Set up Deployment to ship your application