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.
- 🎛️ Flexible Views & Workflow: Manage notes via archiving, favoriting, and pinning. Customize your display with list, waterfall, and date-grouped views.
- 🗂️ 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 individual memo or file within your notes, with optional expiration times.
- 🤖 Telegram Integration: Record text, images, videos, and files on the go via a Telegram Bot, with a proxy option to save storage space.
- 📚 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 fine-grained layout and feature visibility adjustments.
- 🚀 High Performance & Low Cost: Blazing fast responses powered by the Cloudflare global network, running at virtually zero cost on the free tier.
You have two ways to create your own code repository. Please choose one based on your needs.
- Pros: Your repository remains linked to the original. When new features or bug fixes are released, you can easily sync these updates from GitHub.
- Cons: Your code repository must be public.
- Action: Click the "Fork" button at the top-right of this page.
- Pros: You can create a new, completely independent, and private code repository.
- Cons: Your repository will be detached from the original project, making it difficult to get future updates automatically. You will need to manually sync changes using Git commands, which can be complex.
- Action: Click "Use this template" -> "Create a new repository" at the top-right of this page.
You need to manually create the necessary D1, R2, and KV resources in your Cloudflare Dashboard.
| Resource Type | Recommended Name | Binding Variable Name |
|---|---|---|
| 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.sqlfile. - Important: Note down the
database_idanddatabase_name. Open your localwrangler.tomlfile 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 yourwrangler.tomlfile.
-
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 yourwrangler.tomlfile.
-
Commit and Push: Save the changes to your
wrangler.tomlfile 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
Encryptfor sensitive values.Variable Name Description USERNAMEYour login username PASSWORDYour 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.
If you configured the Telegram variables, you need to activate the webhook once.
- Get your Worker's URL (e.g.,
https://your-project.pages.dev). - Construct the following webhook activation URL in your browser's address bar:
https://api.telegram.org/bot<TELEGRAM_BOT_TOKEN>/setWebhook?url=https://your-project.pages.dev/api/telegram_webhook/<TELEGRAM_WEBHOOK_SECRET>&secret_token=<TELEGRAM_WEBHOOK_SECRET> - Replace
<TELEGRAM_BOT_TOKEN>and<TELEGRAM_WEBHOOK_SECRET>with your actual secret values. - Press Enter. If you see
{"ok":true,"result":true,"description":"Webhook was set"}, it's successful! You can now send messages to your bot.
Alternatively, you can deploy directly from the command line using Wrangler. (This guide is based on
wrangler@^4.33.0).
- Clone the repository locally and fill in the
wrangler.tomlfile with your configurations for KV, D1, and R2.- Run the command:
npx wrangler deploy
- Preview Raw Files: In the main interface or on a public share page, you can right-click on any text-based file attachment (like
.txt,.md,.json,.js) to open its raw content directly in a new tab. - Understanding "Telegram Proxy": This setting (found in the Settings panel) controls how videos and files from Telegram are handled.
- Proxy ON: Saves R2 storage space. Your Worker creates a link that proxies to Telegram's file. Risk: If the original file is deleted from Telegram, your link will break.
- Proxy OFF: Uses R2 storage. Your Worker downloads the file from Telegram and re-uploads it to your R2 bucket, ensuring you have a permanent copy.
- Understanding "Keep Time": When editing a note, you'll see a "Keep Time" checkbox.
- Checked (Default): When you save the edit, the note's original timestamp will be preserved. It will not jump to the top of your timeline.
- Unchecked: When you save, the note's timestamp will be updated to the current time, making it the most recent note.
Initialize local database:
npx wrangler d1 execute YOUR_D1_NAME --local --file=./src/schema.sqlStart the dev server:
npx wrangler devThis 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.varsfile: 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



