Supermemory Deployment Guide
1. System Architecture
2. Prerequisites
- pnpm:
corepack enable pnpm
- Cloudflare Workers: Paid plan ($5/month + usage)
- Cloudflare R2: Must be enabled in Dashboard
- Google OAuth credentials: Required for authentication
3. Deployment Flow
4. Web Application Deployment
4.1 Environment Variables
# apps/web/.dev.vars
GOOGLE_CLIENT_ID="" # Google OAuth credentials
GOOGLE_CLIENT_SECRET="" # Google OAuth credentials
NEXTAUTH_SECRET="" # Generate: openssl rand -base64 32
DATABASE_URL='database.sqlite'
NEXTAUTH_URL='http://localhost:3000'
BACKEND_SECURITY_KEY="" # Generate: openssl rand -base64 32
BACKEND_BASE_URL="http://localhost:8686"
4.2 KV Namespace Setup
# Create KV namespaces
pnpx wrangler kv namespace create canvas-snaps
pnpx wrangler kv namespace create recommendations
4.3 R2 Storage Setup
# Create R2 bucket
pnpx wrangler r2 bucket create supermemory-r2
4.4 D1 Database Setup
# Create production and preview databases
pnpx wrangler d1 create supermemory-db-prod
pnpx wrangler d1 create supermemory-db-preview
# Apply database migrations
pnpx wrangler d1 migrations apply supermemory-db-preview
5. AI Backend Deployment
5.1 Environment Variables
# apps/cf-ai-backend/.dev.vars
SECURITY_KEY="" # Same as web's BACKEND_SECURITY_KEY
OPENAI_API_KEY="sk-" # OpenAI API key
5.2 Vectorize Setup
# Create vector database
pnpx wrangler vectorize create --dimensions=1536 supermemory --metric=cosine
5.3 KV Setup
# Create production and preview KV namespaces
pnpx wrangler kv namespace create prod
pnpx wrangler kv namespace create preview
6. Local Development
7. Deployment Checklist
- All environment variables configured
- KV namespaces created and configured
- R2 bucket created and configured
- D1 databases created and migrated
- Vectorize database configured
- Google OAuth credentials set up
- SECURITY_KEY consistency verified
8. Production Deployment
# Deploy Web Application
cd apps/web
pnpm run deploy
# Deploy AI Backend
cd apps/cf-ai-backend
wrangler publish
9. Extension Development
# Build browser extension
cd apps/extension
pnpm build
Troubleshooting
Important Notes:
pnpm dev
might require multiple attempts to run successfully- Ensure all Cloudflare services are properly configured
- Maintain consistency across all security keys
- Regularly check service status and logs
Signing up for a free account with https://tiptap.dev/,
creating a project/app and then going to collaboration - settings - and getting the API Secret.

Clone code
git clone https://github.com/supermemoryai/supermemory
cd supermemory
vim .npmrc
replaced ${TIPTAP_TOKEN} with the API Secret
Leave a Reply