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
| Capability | Description |
|---|---|
| Data Storage | Typed CRUD operations with JSONB resources, relationships, actions, and version history |
| Authentication | Microsoft Entra ID (CIAM) integration via Auth.js with secure token management |
| Authorization | Tenant-scoped RBAC policies evaluated by OPA/Rego |
| AI Services | RAG-powered chat with SSE streaming, document classification, and indexing |
| Multi-Tenancy | Complete tenant isolation with per-tenant configuration, branding, and data scoping |
| Deployment | Azure App Service deployment with GitHub Actions CI/CD |
How It Works
Every vertical application follows the same pattern:
- Define your data model using Object Types in
src/eai.config/object-types.ts - Seed the types to the platform's Configurator service
- Build your UI using React hooks that call the Platform SDK
- All API calls flow through a BFF proxy that injects auth tokens server-side
- 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
| Section | What You Will Learn |
|---|---|
| Architecture | How the five platform services connect and how requests flow from browser to backend |
| Services | Detailed breakdown of each platform service and its responsibilities |
| Authentication | Auth.js + Entra ID setup, token flow, BFF proxy pattern, and client credentials |
| Object Types | Defining data models with field types, actions, link types, and validation |
| Resources | CRUD operations using the Platform SDK, React hooks, and CLI commands |
| AI Integration | Chat streaming, document upload, RAG indexing, and the useChat hook |
| Tenant Management | Multi-tenancy configuration, tenant isolation, and switching |
| Deployment | Azure 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:
| Module | Purpose | Example |
|---|---|---|
resources | CRUD operations on typed resources | client.resources.create('Application', data) |
chat | Streaming and non-streaming chat | client.chat.stream({ message, conversationId, params }) |
documents | Upload, classify, and index documents | client.documents.upload(file, options) |
orchestrate | Generic proxy to any backend service | client.orchestrate({ target_backend, endpoint }) |
users | User provisioning and profile management | client.users.provisionMe({ tenant_id }) |
auth | Current user information | client.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:
- Start with Architecture to understand the overall system design
- Read Services to learn what each backend service does
- Study Authentication to understand the security model
- Learn about Object Types to define your data model
- Use Resources to build your data access layer
- Add AI Integration for chat and document processing
- Configure Tenant Management for multi-tenancy
- Set up Deployment to ship your application