AI Coloring Page — Project Docs
AI Coloring Page — Project Docs
This repository powers aicolor.page (Cloudflare Workers via OpenNext). It’s an AI coloring book studio: generate consistent line‑art pages and export print‑ready PDFs.
What you can do
- Generate coloring pages from a prompt + optional reference image
- Export PDFs (and image bundles) for printing and sharing
- Manage credits, authentication, admin settings, and payments (Creem)
Tech stack (for developers)
- Next.js 15 + React 19 (App Router)
- OpenNext on Cloudflare Workers (
pnpm cf:deploy) - Postgres + Drizzle ORM (Neon recommended; Hyperdrive in production)
- Payments via Creem (MoR) + webhook handler
Local development
1) Prerequisites
- Node.js
>= 20 - pnpm
>= 9
2) Install dependencies
pnpm install3) Configure environment variables
Create .env.local (or .env.development) and set at least:
NEXT_PUBLIC_APP_URL=http://localhost:3000
AUTH_SECRET=... # openssl rand -base64 32
DATABASE_URL=postgresql://...4) Run database migrations
pnpm db:migrate5) Start the dev server
pnpm dev
open http://localhost:3000Cloudflare deploy
pnpm cf:deployAfter deployment, verify the core paths:
/(landing)/pricing/sign-in/api/payment/callback/api/payment/notify/creem(webhook)
Smoke test (recommended)
SMOKE_BASE_URL=https://aicolor.page pnpm cf:smokeCommon issues
pnpm db:migrateshowsurl: '': yourDATABASE_URLis not loaded. Put it in.env.localand rerun.- Logs mention
env.IMAGES binding is not defined: your Cloudflare R2 binding is missing. Static assets still load, but enable the binding for upload/storage flows. - Checkout shows “no payment provider configured”: set the provider in the admin console and confirm your Creem product ID mapping.
Need help? Email support@aicolor.page.