Memos Worker is a powerful and high-performance serverless application for notes and knowledge management. Built entirely on the Cloudflare ecosystem (Workers, Pages, D1, R2, KV), it provides a private, cost-effective notes solution that you can own forever.
- ✍️ Full-featured Markdown Support: Supports real-time preview, split-screen editing, and smart pasting from rich text to Markdown.
- 🗂️ Files & Attachments: Supports drag-and-drop or pasting to upload images (to R2 or Imgur) and various file types.
- 🔗 Public Sharing: Generate unique, publicly accessible links for any file within your notes.
- 🤖 Telegram Integration: Record text, images, videos, and files on the go via a Telegram Bot.
- 📚 Powerful Organization: Automatic tagging, full-text search, timeline, calendar, and a contribution heatmap.
- 📃 Knowledge Base (Docs): A separate, tree-structured documentation center, perfect for building organized knowledge systems.
- 🎨 Highly Customizable: Light/dark themes, custom primary colors, background images, glassmorphism effects, and layout adjustments.
- 🚀 High Performance & Low Cost: Blazing fast responses powered by the Cloudflare global network, running at virtually zero cost on the free tier.
- 🔐 Own Your Data: All your data is stored securely in your own Cloudflare account.
- Fork this project to your own GitHub account and clone it to your local machine.
- Create Cloudflare Resources: You need to manually create the necessary D1, R2, and KV resources in your Cloudflare Dashboard.
D1 Database | notes-db | DB |
KV Namespace | notes-kv | NOTES_KV |
R2 Bucket | notes-r2-bucket | NOTES_R2_BUCKET |
-
Create D1 Database (notes-db):
- Go to Workers & Pages -> D1 -> Create database.
- Important: After creation, go to the database's console, copy and execute the entire content of the schema.sql file.
- Important: Note down the database_id and database_name. Open your local wrangler.toml file and fill them into the [[d1_databases]] section.
-
Create KV Namespace (notes-kv):
- Go to Workers & Pages -> KV -> Create a namespace.
- Important: Note down the id. Fill it into the [[kv_namespaces]] section of your wrangler.toml file.
-
Create R2 Bucket (notes-r2-bucket):
- Go to R2 -> Create bucket.
- Important: Note down the bucket_name. Fill it into the [[r2_buckets]] section of your wrangler.toml file.
-
Commit and Push: Save the changes to your wrangler.toml file and push them to your GitHub repository.
- In your Cloudflare Dashboard, go to Workers & Pages -> Create application -> Select the "Workers" tab.
- Click "Connect with Git" and choose your forked repository.
- Click Save and Deploy.
After deployment, go to your new Worker's settings to add secrets.
-
Navigate to your Worker's project -> Settings -> Variables.
-
Under Environment Variables, add the following variables. Remember to click Encrypt for sensitive values.
Variable Name Description USERNAME Your login username PASSWORD Your login password TELEGRAM_BOT_TOKEN (Optional) Your Telegram bot's token TELEGRAM_WEBHOOK_SECRET (Optional) A long, random string for webhook security AUTHORIZED_TELEGRAM_IDS (Optional) Your Telegram user ID to authorize -
Trigger a new deployment from the "Deployments" tab to make the variables effective.
Initialize local database:
This mode connects your local dev server to your actual Cloudflare resources.
- Configure wrangler.toml: Ensure the resource IDs from your Cloudflare Dashboard are filled in this file.
# wrangler.toml [[d1_databases]] binding = "DB" database_name = "notes-db" database_id = "YOUR_D1_DATABASE_ID" # Replace [[kv_namespaces]] binding = "NOTES_KV" id = "YOUR_KV_NAMESPACE_ID" # Replace [[r2_buckets]] binding = "NOTES_R2_BUCKET" bucket_name = "notes-r2-bucket"
- Create .dev.vars file: Create this file in the project root for your local secrets.
# .dev.vars (This file is ignored by Git) USERNAME="dev_user" PASSWORD="dev_password"
- Start the remote-connected dev server:
npx wrangler dev --remote