Skip to content

1in0/Wuming-Backend

Repository files navigation

Wuming-Backend

AI journaling companion powered by Cloudflare Agents and Anthropic Claude.

Setup

npm install

Environment Variables

Create a .dev.vars file in the project root for local development:

ANTHROPIC_API_KEY=sk-ant-api03-your-key-here
CF_AIG_TOKEN=your-cloudflare-ai-gateway-token
ADMIN_API_KEY=replace-with-a-strong-admin-key
USER_API_KEYS_JSON={"alice":"replace-with-user-key"}
# Optional fallback/global key:
# API_KEY=replace-with-global-key
# Optional CORS allowlist:
# CORS_ALLOWED_ORIGINS=https://app.example.com,http://localhost:3000
# Optional Gemini gateway override:
# CF_AI_GATEWAY_BASE_URL=https://gateway.ai.cloudflare.com/v1/<account>/<gateway>/google-ai-studio/v1beta

Get your Anthropic API key from console.anthropic.com/settings/keys.

For production, use:

npx wrangler secret put ANTHROPIC_API_KEY

Development

npm run dev

Starts the local server on http://localhost:8787.

Endpoints

Endpoint Protocol Description
/agents/journal-agent/{userId} WebSocket Chat with the journal agent
/agents/journal-agent/{userId} RPC Call generateSummary() for session recap
/health HTTP GET Health check

About

No description or website provided.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors