Skip to main content

Factory Core

Factory Core is a collection of 19 TypeScript packages that provide battle-tested, reusable infrastructure for Cloudflare Workers applications. Every Factory app installs only what it needs.

Stack

LayerTechnology
RuntimeCloudflare Workers
RouterHono
DatabaseNeon Postgres via Hyperdrive
AuthJWT / Web Crypto API
LLMAnthropic → Grok → Groq failover
TelephonyTelnyx + Deepgram + ElevenLabs
EmailResend
ErrorsSentry
AnalyticsPostHog + factory_events

Packages

StagePackagePurpose
1@adrper79-dot/errorsTyped error hierarchy, FactoryError, toErrorResponse
1@adrper79-dot/monitoringSentry integration for Cloudflare Workers
1@adrper79-dot/loggerStructured JSON logger with levels and context
1@adrper79-dot/authJWT issue/verify/refresh, jwtMiddleware, requireRole
1@adrper79-dot/neonNeon Postgres client via Hyperdrive, withDbRetry
1@adrper79-dot/stripeStripe webhook handling, subscription lifecycle
2@adrper79-dot/llmAnthropic → Grok → Groq failover, streaming, withSystem
2@adrper79-dot/telephonyDeepgram STT, ElevenLabs TTS, Telnyx webhooks, VoiceSession
3@adrper79-dot/analyticsPostHog + factory_events DB table, event tracking
3@adrper79-dot/deployDeployment scripts and CI helpers
3@adrper79-dot/testingZero-dep mock factories for all packages
4@adrper79-dot/emailResend integration, typed email templates
4@adrper79-dot/copyLLM-powered copywriting with structured output
4@adrper79-dot/contentContent management backed by Neon
4@adrper79-dot/socialSocial post scheduling and publishing
4@adrper79-dot/seoMeta tag generation, OpenGraph, structured data
5@adrper79-dot/crmLead tracking, conversion events, customer view
5@adrper79-dot/complianceTCPA/FDCPA consent and suppression management
5@adrper79-dot/adminAdmin Hono router: users, events, health, suspend

Design Principles

  • No process.env — every package uses Cloudflare Worker bindings (env.VAR / c.env.VAR)
  • No Node.js built-ins — no fs, path, crypto, Buffer
  • ESM only — no CommonJS require()
  • Zero any in public APIs — TypeScript strict throughout
  • Explicit error handling — no raw fetch without error checking