Skip to content

Introduction

Product Factory is a full-stack SaaS starter built on Astro 5, React, Hono, and Cloudflare Workers. It provides authentication, billing, AI integration, content management, and customer support out of the box.

What’s Included

  • Authentication — Email/password login with Better Auth, session management, and role-based access control.
  • Billing — Credits system, subscription plans, checkout flow, and order management via Cloudflare Workers.
  • AI Service — Unified AI gateway supporting multiple providers (OpenAI, Anthropic, Google) with usage tracking and credit deduction.
  • Content Management — Blog posts, banners, and friend links with a full admin interface.
  • Support — Ticket system with priority levels, status tracking, and admin reply workflow.
  • Dashboard — User-facing dashboard with profile, API keys, credits, orders, subscriptions, and tickets.
  • Admin Console — Full administrative interface for managing users, content, billing, AI providers, and support tickets.

Architecture Overview

Product Factory uses a microservices architecture deployed on Cloudflare:

LayerTechnology
Frontend AppsAstro 5 + React Islands
API GatewayHono on Cloudflare Workers
Backend Services7 Cloudflare Workers (gateway, auth, admin, billing, ai, content, support)
DatabaseCloudflare D1 (SQLite) with Drizzle ORM
StorageCloudflare R2
AuthBetter Auth with Drizzle adapter

All API requests flow through the gateway worker, which handles session verification and proxies requests to the appropriate service worker.

Who Is This For

Product Factory is designed for developers who want to launch a SaaS product quickly without building common infrastructure from scratch. It’s particularly suited for:

  • Solo developers building AI-powered tools
  • Small teams launching subscription-based services
  • Developers who prefer Cloudflare’s edge-first infrastructure over traditional cloud providers