| name | assemblyai-reference-architecture |
| description | Implement AssemblyAI reference architecture with best-practice project layout.
Use when designing new AssemblyAI transcription services, reviewing project structure,
or building production-grade speech-to-text applications.
Trigger with phrases like "assemblyai architecture", "assemblyai best practices",
"assemblyai project structure", "how to organize assemblyai", "assemblyai design".
|
| allowed-tools | Read, Grep |
| version | 1.5.0 |
| license | MIT |
| author | Jeremy Longshore <jeremy@intentsolutions.io> |
| tags | ["saas","ai","speech-to-text","assemblyai","transcription","architecture"] |
| compatibility | Designed for Claude Code |
AssemblyAI Reference Architecture
Overview
Production-ready architecture for AssemblyAI-powered transcription services with layered design, webhook-driven processing, and LeMUR analysis pipelines.
Prerequisites
- Understanding of layered architecture
assemblyai npm package
- TypeScript project setup
- Database for transcript storage
Project Structure
my-transcription-service/
├── src/
│ ├── assemblyai/
│ │ ├── client.ts # Singleton client
│ │ ├── transcription.ts # Transcription service
│ │ ├── streaming.ts # Streaming service
│ │ ├── lemur.ts # LeMUR analysis service
│ │ └── types.ts # Domain types
│ ├── api/
│ │ ├── transcribe.ts # POST /api/transcribe
│ │ ├── transcripts.ts # GET /api/transcripts/:id
│ │ ├── streaming-token.ts # GET /api/streaming-token
│ │ └── webhooks/
│ │ └── assemblyai.ts # POST /webhooks/assemblyai
│ ├── services/
│ │ ├── audio-processor.ts # Audio validation & preprocessing
│ │ └── transcript-store.ts # Database storage
│ ├── jobs/
│ │ └── batch-transcriber.ts # Background batch processing
│ └── config.ts
├── tests/
│ ├── unit/
│ │ ├── transcription.test.ts
│ │ └── lemur.test.ts
│ └── integration/
│ └── assemblyai.test.ts
└── package.json
Architecture Layers
┌──────────────────────────────────────────────────────┐
│ API Layer │
│ Transcribe endpoint, Webhook handler, Stream token │
├──────────────────────────────────────────────────────┤
│ Service Layer │
│ TranscriptionService, LeMURService, AudioProcessor │
├──────────────────────────────────────────────────────┤
│ AssemblyAI SDK Layer │
│ client.transcripts, client.streaming, client.lemur │
├──────────────────────────────────────────────────────┤
│ Infrastructure Layer │
│ Database, Redis Cache, Job Queue, Monitoring │
└──────────────────────────────────────────────────────┘
Instructions
Step 1: Client Layer
import { AssemblyAI } from 'assemblyai';
let client: AssemblyAI | null = null;
(): {
(!client) {
client = ({
: process..!,
});
}
client;
}