gamma-reference-architecture
Reference architecture for enterprise Gamma integrations. Use when designing systems, planning integrations, or implementing best-practice Gamma architectures. Trigger with phrases like "gamma architecture", "gamma design", "gamma system design", "gamma integration pattern", "gamma enterprise". allowed-tools: Read, Write, Edit version: 1.0.0 license: MIT author: Jeremy Longshore <jeremy@intentsolutions.io>
Allowed Tools
No tools specified
Provided by Plugin
gamma-pack
Claude Code skill pack for Gamma (24 skills)
Installation
This skill is included in the gamma-pack plugin:
/plugin install gamma-pack@claude-code-plugins-plus
Click to copy
Instructions
# Gamma Reference Architecture
## Overview
Reference architecture patterns for building scalable, maintainable Gamma integrations.
## Prerequisites
- Understanding of microservices
- Familiarity with cloud architecture
- Knowledge of event-driven systems
## Architecture Patterns
### Pattern 1: Basic Integration
```
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Your Application β
β βββββββββββ βββββββββββ βββββββββββ β
β β UI βββββΆβ API βββββΆβ Gamma β β
β β β β Server β β Client β β
β βββββββββββ βββββββββββ ββββββ¬βββββ β
β β β
ββββββββββββββββββββββββββββββββββββββββΌβββββββββββββββββββ
β
βΌ
βββββββββββββββββββ
β Gamma API β
βββββββββββββββββββ
```
**Use Case:** Simple applications, prototypes, small teams.
### Pattern 2: Service Layer Architecture
```
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Your Platform β
β β
β ββββββββββββ ββββββββββββ ββββββββββββ ββββββββββββ β
β β Web App β βMobile Appβ β CLI β β API β β
β ββββββ¬ββββββ ββββββ¬ββββββ ββββββ¬ββββββ ββββββ¬ββββββ β
β β β β β β
β βββββββββββββββ΄βββββββ¬βββββββ΄ββββββββββββββ β
β βΌ β
β ββββββββββββββββββββ β
β β Presentation β β
β β Service β β
β ββββββββββ¬ββββββββββ β
β β β
β ββββββββββββββββββββββββββΌβββββββββββββββββββββββββ β
β β βΌ β β
β β βββββββββββ βββββββββββββββ βββββββββββ β β
β β β Cache ββββGamma Client ββββΆβ Queue β β β
β β β (Redis) β β Singleton β β (Bull) β β β
β β βββββββββββ ββββββββ¬βββββββ βββββββββββ β β
β β β β β
β ββββββββββββββββββββββββΌβββββββββββββββββββββββββββ β
β β β
βββββββββββββββββββββββββββΌβββββββββββββββββββββββββββββββββββββββββ
βΌ
βββββββββββββββββββ
β Gamma API β
βββββββββββββββββββ
```
**Use Case:** Multi-platform products, medium-scale applications.
### Pattern 3: Event-Driven Architecture
```
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Your Platform β
β β
β βββββββββββββββ βββββββββββββββ βββββββββββββββ β
β β Producer β β Producer β β Consumer β β
β β Service β β Service β β Service β β
β ββββββββ¬βββββββ ββββββββ¬βββββββ ββββββββ²βββββββ β
β β β β β
β ββββββββββββββββββββ΄βββββββββββββββββββ β
β β β
β ββββββββββΌβββββββββ β
β β Message Queue β β
β β (RabbitMQ) β β
β ββββββββββ¬ββββββββββ β
β β β
β ββββββββββββββββββββΌβββββββββββββββββββ β
β β βΌ β β
β β βββββββββββββββββββββββββββββββββ β β
β β β Gamma Integration Worker β β β
β β β βββββββββββ βββββββββββββββ β β β
β β β β Handler β βGamma Client β β β β
β β β βββββββββββ ββββββββ¬βββββββ β β β
β β ββββββββββββββββββββββββΌβββββββββ β β
β β β β β
β βββββββββββββββββββββββββββΌββββββββββββ β
β β β
βββββββββββββββββββββββββββββββββββββΌβββββββββββββββββββββββββββββββββββ
βΌ
βββββββββββββββββββ
β Gamma API β
β ββββββ Webhooks
βββββββββββββββββββ
```
**Use Case:** High-volume systems, async processing, microservices.
## Implementation
### Service Layer Example
```typescript
// services/presentation-service.ts
import { GammaClient } from '@gamma/sdk';
import { Cache } from './cache';
import { Queue } from './queue';
export class PresentationService {
private gamma: GammaClient;
private cache: Cache;
private queue: Queue;
constructor() {
this.gamma = new GammaClient({
apiKey: process.env.GAMMA_API_KEY,
});
this.cache = new Cache({ ttl: 300 });
this.queue = new Queue('presentations');
}
async create(userId: string, options: CreateOptions) {
// Add to queue for async processing
const job = await this.queue.add({
type: 'create',
userId,
options,
});
return { jobId: job.id, status: 'queued' };
}
async get(id: string) {
return this.cache.getOrFetch(
`presentation:${id}`,
() => this.gamma.presentations.get(id)
);
}
async list(userId: string, options: ListOptions) {
return this.gamma.presentations.list({
filter: { userId },
...options,
});
}
}
```
### Event Handler Example
```typescript
// workers/gamma-worker.ts
import { Worker } from 'bullmq';
import { GammaClient } from '@gamma/sdk';
const gamma = new GammaClient({ apiKey: process.env.GAMMA_API_KEY });
const worker = new Worker('presentations', async (job) => {
switch (job.data.type) {
case 'create':
const presentation = await gamma.presentations.create(job.data.options);
await notifyUser(job.data.userId, 'created', presentation);
return presentation;
case 'export':
const exportResult = await gamma.exports.create(
job.data.presentationId,
job.data.format
);
await notifyUser(job.data.userId, 'exported', exportResult);
return exportResult;
default:
throw new Error(`Unknown job type: ${job.data.type}`);
}
});
```
## Component Responsibilities
| Component | Responsibility |
|-----------|----------------|
| API Gateway | Auth, rate limiting, routing |
| Service Layer | Business logic, orchestration |
| Gamma Client | API communication, retries |
| Cache Layer | Response caching, deduplication |
| Queue | Async processing, load leveling |
| Workers | Background job execution |
| Webhooks | Real-time event handling |
## Resources
- [Gamma Architecture Guide](https://gamma.app/docs/architecture)
- [12-Factor App](https://12factor.net/)
- [Microservices Patterns](https://microservices.io/)
## Next Steps
Proceed to `gamma-multi-env-setup` for environment configuration.