| name | apollo-reference-architecture |
| description | Implement Apollo.io reference architecture.
Use when designing Apollo integrations, establishing patterns,
or building production-grade sales intelligence systems.
Trigger with phrases like "apollo architecture", "apollo system design",
"apollo integration patterns", "apollo best practices architecture".
|
| allowed-tools | Read, Write, Edit, Bash(gh:*), Bash(curl:*) |
| version | 1.13.0 |
| license | MIT |
| author | Jeremy Longshore <jeremy@intentsolutions.io> |
| tags | ["saas","apollo","apollo-reference"] |
| compatibility | Designed for Claude Code, also compatible with Codex and OpenClaw |
Apollo Reference Architecture
Overview
Production-ready reference architecture for Apollo.io integrations. Layered design with API client, service layer, background jobs, database models, CRM sync, and deals pipeline โ all built around Apollo's REST API with correct endpoints and x-api-key authentication.
Prerequisites
- Apollo master API key
- Node.js 18+ with TypeScript
- PostgreSQL for data layer
- Redis for job queues
Instructions
Step 1: Architecture Diagram
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ API Layer โ Express routes
โ POST /api/leads/search GET /api/org/:d โ POST /api/deals
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ Service Layer โ Business logic
โ LeadService EnrichService DealService โ SequenceService
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ Client Layer โ Apollo API wrapper
โ ApolloClient RateLimiter Cache โ CreditTracker
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ Background Jobs โ BullMQ queues
โ EnrichJob SyncJob StageChangeJob โ TaskCreatorJob
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ Data Layer โ Prisma/TypeORM
โ Contact Organization Deal AuditLog โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Step 2: Service Layer
import { getApolloClient } from '../apollo/client';
import { withRetry } from '../apollo/retry';
import { cachedRequest } from '../apollo/cache';
export class LeadService {
private client = getApolloClient();
async searchPeople(params: { domains: string[]; titles?: string[]; seniorities?: string[]; page?: }) {
(,
( ..(, {
: params.,
: params.,
: params.,
: params. ?? , : ,
})),
params,
);
}
() {
( ..(, { email }));
}
() {
(,
( ..(, { : { domain } })),
{ domain },
);
}
}