| 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;
}