A comprehensive task prioritization system combining ICE scoring, time blocking, and the 4D decision framework (DO, DELEGATE, DELAY, DELETE) with 8 AI recommendation algorithms.
- 8 AI Recommendation Methods: Simple ICE, Weighted, ROI-based, Eisenhower Enhanced, Skill Match, Energy-Aware, Strategic Alignment, and Hybrid Smart
- Time Blocking: Deep Work, Collaborative, Quick Wins, and Systematic categorization
- 4D Decision Framework: DO, DELEGATE, DELAY, DELETE
- Real-time Stats: Overview of tasks by decision, time block, and type
- Cloudflare Zero Trust Auth: Secure authentication without custom auth code
- Global Edge Deployment: Runs on Cloudflare Workers for fast global access
- Frontend: React 18 + Vite + Tailwind CSS + Lucide React
- Backend: Hono (lightweight web framework) on Cloudflare Workers
- Database: Cloudflare D1 (SQLite-based) with Drizzle ORM
- Authentication: Cloudflare Access (Zero Trust)
- Deployment: Cloudflare Workers + Pages
cd task-priority-app
npm install# Generate migration files
npm run db:generate
# Apply migrations to local D1 database
npm run db:migrate# Start both frontend and backend
npm run dev
# Or run separately:
npm run dev:client # Frontend on http://localhost:5173
npm run dev:server # Backend on http://localhost:8787- Frontend: http://localhost:5173
- Backend API: http://localhost:8787/api
- Health Check: http://localhost:8787/api/health
Click the deploy button above to automatically deploy to Cloudflare Workers. You'll need to:
- Authenticate with Cloudflare - Log in to your Cloudflare account
- Set up Zero Trust - Follow the Zero Trust setup instructions below
- Configure Environment Variables - Add your AUD tag after deployment
-
Clone and Setup
git clone https://github.com/bnqtoan/task-priority-app cd task-priority-app npm install -
Configure Cloudflare
wrangler login wrangler d1 create task-priority-db
-
Update Configuration
- Copy the database ID from the output
- Update
wrangler.tomlwith your account ID and database ID - Set up Zero Trust (see instructions below)
-
Deploy
npm run deploy
This application uses Cloudflare Zero Trust for secure authentication. Follow these steps to configure it:
- Go to Cloudflare Dashboard
- Select your account
- Navigate to Zero Trust in the left sidebar
- If this is your first time, set up a team name (e.g.,
your-company-team)
-
In Zero Trust dashboard, go to Access → Applications
-
Click Add an application
-
Choose Self-hosted
-
Configure the application:
Application Configuration:
- Application name:
Task Priority App - Session Duration:
24 hours(or your preference) - Application domain:
your-app-name.your-subdomain.workers.dev
Authentication Policy:
- Policy name:
Task Priority Access - Action:
Allow - Session duration:
24 hours
Access Rules (Choose one):
Option A - Email-based access:
- Include:
Emails - Add authorized email addresses (e.g.,
your-email@example.com)
Option B - Domain-based access:
- Include:
Email domains - Add your organization's domain (e.g.,
@yourcompany.com)
Option C - Everyone with login:
- Include:
Everyone - Note: This allows anyone with a valid login provider
- Application name:
- After creating the application, click on it in the Applications list
- Copy the Application Audience (AUD) Tag
- The AUD tag looks like:
abc123def456ghi789jkl012mno345pqr678stu901vwx234yz
For One-Click Deploy:
- After deployment, go to your Cloudflare Workers dashboard
- Click on your deployed worker
- Go to Settings → Variables
- Edit the
ACCESS_AUDvariable and paste your AUD tag
For Manual Deploy:
- Update
wrangler.toml:[vars] ACCESS_AUD = "your-actual-aud-tag-here"
- Redeploy:
npm run deploy
- Visit your deployed application URL
- You should be redirected to Cloudflare Access login
- Log in with an authorized account
- You'll be redirected back to your application with full access
"Unauthorized" Error:
- Verify the AUD tag is correctly set in your environment variables
- Check that your email/domain is included in the Access policy
- Ensure the application domain matches your deployed URL
Login Loop:
- Check that the Access application domain exactly matches your deployed URL
- Verify the session duration is set appropriately
Still Having Issues?
- Check Cloudflare Zero Trust logs in the dashboard
- Verify your authentication policy rules
- Ensure you're using the correct login provider
The application uses these environment variables:
ACCESS_AUD: Your Cloudflare Zero Trust Application Audience tagNODE_ENV: Set todevelopmentfor local development,productionfor deployment
# Apply migrations to production database
npm run db:migrate:prod
# Open Drizzle Studio to view/edit database
npm run db:studioGET /api/auth/me- Get current user info
GET /api/tasks- List user tasks (with optional filters)POST /api/tasks- Create new taskGET /api/tasks/:id- Get single taskPUT /api/tasks/:id- Update taskDELETE /api/tasks/:id- Delete taskPATCH /api/tasks/:id/complete- Mark task as completed
GET /api/preferences- Get user preferencesPUT /api/preferences- Update user preferences
GET /api/stats/overview- Get overview statisticsGET /api/stats/recommendations?method=hybrid- Get AI recommendations
- Simple ICE: Basic ICE scoring with impact threshold
- Weighted Score: Impact (50%) + Confidence (30%) + Ease (20%)
- ROI-Based: Return on Investment with time efficiency
- Eisenhower Enhanced: Important/Urgent matrix with time blocks
- Skill Match: Matches skills (ease) with value potential
- Energy-Aware: Optimizes for energy efficiency and burnout prevention
- Strategic Alignment: Prioritizes based on task type weights
- Hybrid Smart: Combines ROI (40%) + Value (30%) + Strategy (30%)
# Generate new migration
npm run db:generate
# Apply migrations locally
npm run db:migrate
# Apply migrations to production
npm run db:migrate:prod
# Open Drizzle Studio
npm run db:studioFor local development, the app uses mock Cloudflare Access headers:
- Email:
dev@example.com - Name:
Dev User
In production, real Cloudflare Access headers are used for authentication.
Create .env for local development:
# Local D1
DATABASE_URL=file:./dev.db
# Cloudflare (for migrations)
CLOUDFLARE_ACCOUNT_ID=your-account-id
CLOUDFLARE_DATABASE_ID=your-database-id
CLOUDFLARE_D1_TOKEN=your-api-tokenFrontend (React)
↓ fetch('/api/tasks')
Cloudflare Worker (Hono)
↓ Validate Access JWT
↓ CRUD Operations (Drizzle ORM)
Cloudflare D1 (SQLite)
✅ No custom auth code - Cloudflare handles login, sessions, MFA ✅ No password security liability ✅ Built-in DDOS protection ✅ Free tier available (up to 50 users) ✅ Enterprise-grade security ✅ Multiple IdP support ✅ Serverless, globally distributed ✅ Auto-scaling
MIT License