System Architecture
Overview
Frontier AI is a real-time AI-powered sales coaching platform built as a Turborepo monorepo optimized for fast AI processing during live sales calls. The system integrates with major video conferencing platforms and leverages Cloudflare's edge network for real-time AI coaching.
Key Architectural Principles
- Full TypeScript Stack - Type-safe development across frontend and backend
- React Everywhere - Unified React codebase for web and desktop applications
- Cloudflare Edge Network - Distributed infrastructure with Durable Objects for real-time processing
- AI-First Architecture - Integrated AI workflows for real-time coaching and post-call analysis
- Serverless & Scalable - Pay-per-use infrastructure that scales automatically
System Overview
The platform consists of multiple client applications connecting to a unified API backend, with specialized services for real-time AI processing and post-call analysis.
Core Applications & Data Flow
This simplified view shows how the main applications interact through the API backend:
Key Architectural Decisions
Real-Time vs Post-Processing AI
The system uses two distinct AI processing paths:
-
Real-Time Processing (OpenAI Queue)
- Direct OpenAI API calls during live calls
- Fast response times for live coaching
- Rate limiting and connection pooling
- Used by Durable Objects for immediate AI responses
-
Post-Call Processing (Humanloop)
- Transcript analysis after calls end
- Complex multi-step AI workflows
- Prompt versioning and A/B testing
- Managed by Inngest for reliable processing
Monorepo Architecture
- apps/dash - Next.js dashboard with API routes
- apps/web - Desktop app with Neutralino.js
- apps/server - Cloudflare Worker API backend
- packages/ - Shared libraries for types, UI components, database client
Technology Stack Summary
| Layer | Technology | Purpose |
|---|---|---|
| Frontend | React 18, TypeScript, Vite | Type-safe UI development |
| Desktop | Neutralino.js | Cross-platform desktop wrapper |
| Backend | Cloudflare Workers, Hono | Serverless API with edge computing |
| Real-time | PartyServer, Durable Objects | WebSocket connections and state |
| Database | Neon PostgreSQL, Drizzle ORM | Serverless SQL with type safety |
| AI Processing | OpenAI GPT-4, Humanloop | Real-time and post-call AI |
| Orchestration | Inngest | Background job processing |
| Authentication | Clerk | User management and OAuth |
| Operations | GitHub Actions, Doppler | CI/CD and secrets management |