logo

Overview

OPCStack template documentation index and reading guide

OPCStack is a Cloudflare-native product skeleton for one-person or small teams to ship SaaS and AI products fast. Auth, payments, credits, R2, D1 sharding, KV, Queues, Cron, deployment automation, and testing are wired end to end. You delete what you do not need; you do not rebuild the base loop from scratch.

Module Map

Module What it gives you Doc
Web + API SvelteKit SSR, Hono API, prerendered static pages Frontend, API contracts
Database D1, Drizzle, user data sharding, read replicas, auto migration Database
Storage R2 public/private/tmp paths, browser direct upload, image variants Storage
Async Queues, Cron, Durable Objects Queues and Cron
Auth Better Auth, email, Google, GitHub, LinuxDO, Turnstile, beta code Authentication
Credits Wallet, ledger, signup grant, daily checkin, invite reward, redeem code, expiry Credits
Payments Dodo, Creem, one-time packs, subscriptions, webhooks, refund clawback Payments
AI Chat, image, TTS, realtime, video providers, async tasks with R2 output AI
Operations User feedback, system notifications, global and targeted announcements Operations
Testing Vitest, BDD helper, mock D1 and R2, E2E, coverage Testing
Deployment prepare-cloudflare automation, DNS, CN domain, secrets, deploy commands Deployment

Reading Guide

Just cloned the template?

Start with Getting Started. The fastest path is to let an AI agent guide you: open your AI coding tool, reference @BOOTSTRAP.md @AGENTS.md, and it will walk you through local setup step by step.

Going to production?

  1. Deployment for the deploy path and resource provisioning.
  2. Authentication to lock down signup and OAuth.
  3. Payments and Credits to wire billing.
  4. Testing before you ship.

Working on the template itself?

  1. Architecture for design principles and system overview.
  2. Database for the sharding model and saga rules.
  3. Deployment for the prepare-cloudflare automation.
  4. API contracts in src/api-contract/ for the contract conventions.