This is an Edge-first AI Chat app similar to ChatGPT but using Cloudflare Development Platform.
To setup create a new D1, KV and R2, all named ai-chat
then in wrangler.toml
update the id for D1 and KV.
Then run your DB migrations with bun run db:migrate:locaal ai-chat
.
Finally on GitHub create the secrets
CLOUDFLARE_API_TOKEN
with your Cloudflare API tokenCLOUDFLARE_ACCOUNT_ID
with your Cloudflare account IDCLOUDFLARE_DATABASE_NAME
with the nameai-chat
And in .dev.vars
add:
APP_ENV="development"
CLOUDFLARE_ACCOUNT_ID=""
CLOUDFLARE_DATABASE_ID=""
CLOUDFLARE_API_TOKEN=""
GRAVATAR_API_TOKEN=""
VERIFIER_API_KEY=""