Todo Reminder System
Cloudflare Workers - Todo Reminder System
Section titled “Cloudflare Workers - Todo Reminder System”This is a Todo management system based on Cloudflare Workers. It supports adding, editing, deleting, and notifying todo items, and sends reminder messages via a Telegram Bot.
✨ Features
Section titled “✨ Features”- Login authentication (password + optional reCAPTCHA)
- Add/Edit/Delete todos
- List display with pagination and sorting
- Test notification button
- Scheduled daily reminder at 14:00 Beijing Time
- Telegram Bot reminder support (with MarkdownV2 escaping)
🌐 Deployment Instructions
Section titled “🌐 Deployment Instructions”-
Create a Worker in the Cloudflare Dashboard
-
Set environment variables (in
Vars
):PASS
: Login password (required)TGID
: Telegram chat_id (required)TGTOKEN
: Telegram Bot Token (required)RECAPTCHA_SITE_KEY
: Google reCAPTCHA site key (optional)RECAPTCHA_SECRET
: Google reCAPTCHA secret (optional)
-
Create and bind the KV namespace
TODO_KV
to store the todos list -
Upload
worker.js
and save deployment
⬇️ Code Download
Section titled “⬇️ Code Download”Github
🔒 Login
Section titled “🔒 Login”Visit the home page /
and log in with your password. The login status is managed via a loggedIn=true
cookie.
If reCAPTCHA is enabled, verification is also required.
📑 API Endpoints
Section titled “📑 API Endpoints”All API paths start with /api/todos
and require login:
GET /api/todos
: Get all todosGET /api/todos/:id
: Get a specific todoPOST /api/todos
: Create a new todoPUT /api/todos/:id
: Update a todoDELETE /api/todos/:id
: Delete a todoPOST /api/todos/:id/test-notification
: Test Telegram notification
🕒 Cron Job (Cron Trigger)
Section titled “🕒 Cron Job (Cron Trigger)”Set the Worker’s Cron trigger to 0 6 * * *
(UTC), which corresponds to 14:00 Beijing Time. The system will iterate through all todos and send notifications based on advanceDays
and continuousDays
.
🔔 Message Format (Telegram)
Section titled “🔔 Message Format (Telegram)”Example:
🔔 Dear Boss, this is a reminder from Xiaobao:
Todo: Submit the quarterly reportDue Date: 2025/05/20You have 3 days left to take action.
📝 Local Debugging Tips
Section titled “📝 Local Debugging Tips”- Use
wrangler dev
to test page rendering - Use the KV simulator (
wrangler kv:namespace
) to store data - Or split logic into functions for easier testing
🧩 Use Cases
Section titled “🧩 Use Cases”This project is suitable for:
- Individuals or small teams who need recurring, structured reminders;
- People who prefer Telegram Bot as the primary notification channel instead of SMS or email;
- Developers looking for a serverless solution using Cloudflare Workers + KV storage;
- Users who want automated scheduled reminders (without using heavyweight platforms like DingTalk or Slack);
- Anyone needing a lightweight, clientless, cross-platform todo reminder system;
- Telegram users who want daily reminder messages (e.g., business renewals, study plans);
- Projects running in resource-constrained environments or aiming to use Cloudflare’s free tier.
📄 License
Section titled “📄 License”MIT License