Skip to content

ADA-quart/ITDC

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

6 Commits
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿ“… Smart Calendar Planner

ๆ™บ่ƒฝๆ—ฅๅކไธŽๅพ…ๅŠž่ง„ๅˆ’ โ€” Integrated Calendar, Todo & AI-Powered Scheduling

License: MIT Node.js >=18">https://img.shields.io/badge/node-%3E%3D18-green.svg"> React 18 Express Vite 6


A full-stack calendar and task management application built on the Eisenhower Priority Matrix. It offers both algorithm-based and LLM-powered intelligent scheduling to help you plan your time efficiently.

ไธญๆ–‡ๆ–‡ๆกฃ


โœจ Features

๐Ÿ“† Multi-Calendar Management

  • Create, delete, and toggle multiple calendars with custom names & colors
  • Import iCal (.ics) files โ€” auto-creates a dedicated calendar and batch-imports events
  • Full RRULE (RFC 5545) support for recurring events

โœ… Todo Management (Eisenhower Matrix)

  • Automatic priority classification by urgency & importance (1โ€“4 scale):
    • P1 Urgent & Important โ€” Red
    • P2 Important โ€” Orange
    • P3 Urgent โ€” Blue
    • P4 Normal โ€” Green
  • Status flow: Todo โ†’ Scheduled โ†’ Done
  • Deadline countdown with overdue highlighting
  • Estimated duration, description, and full metadata

๐Ÿง  Intelligent Scheduling

  • Algorithm Scheduler โ€” Greedy strategy ordered by priority & deadline; avoids existing events; respects work hours (7:00โ€“23:00); inserts 15-min breaks every 2 hours; 30-day planning horizon
  • LLM Scheduler โ€” Supports OpenAI / DeepSeek / Ollama / LM Studio / custom providers; generates context-aware schedules via natural language
  • Smart Splitting โ€” Tasks > 90 min are auto-split with breaks; labeled (1/N), (2/N), etc.; produces independent todo records when applied
  • Pre-schedule validation: time conflicts, late-night shifts, deadline violations
  • One-click apply โ€” auto-marks todos as scheduled and displays on calendar
  • Customizable LLM prompt templates for fine-tuning scheduling strategy

๐ŸŒ™ Dark Mode

  • Light / Dark / System theme options
  • Full component-level dark mode support

๐ŸŒ Internationalization

  • Chinese / English switch
  • Calendar locale auto-adjusts with language

๐Ÿ–ฑ๏ธ Calendar Interactions

  • Drag to move events; drag edges to resize
  • Click empty area to quick-create an event
  • Scheduled todos shown with [Todo] prefix and custom color
  • Export weekly calendar to Excel (week view + event detail sheets)

๐Ÿ”’ Security

  • LLM API keys stored with AES-256-GCM encryption
  • API never returns key plaintext

๐Ÿ› ๏ธ Tech Stack

Layer Technology
Frontend React 18 ยท TypeScript ยท Ant Design 5 ยท FullCalendar 6
Backend Express ยท TypeScript ยท sql.js (SQLite WASM)
Build Vite 6
LLM OpenAI / DeepSeek / Ollama

๐Ÿ“‹ Prerequisites

  • Node.js โ‰ฅ 18 (LTS recommended) โ€” Download
  • OS: Windows (batch scripts provided); macOS / Linux work via CLI

๐Ÿš€ Quick Start

Option 1: One-Click Scripts (Windows)

  1. Double-click install.bat to install dependencies
  2. Double-click start.bat to launch the app

start.bat auto-installs dependencies if node_modules is missing, starts backend & frontend, and opens the browser when ready.

Option 2: Command Line

# Clone the repository
git clone https://github.com/ADA-quart/Intelligent-To-Do-Calendar.git
cd Intelligent-To-Do-Calendar

# Install dependencies
npm install

# (Optional) Configure environment
cp .env.example .env

# Start dev servers
npm run dev:all

Open http://localhost:5173 in your browser.


๐Ÿ“ Project Structure

โ”œโ”€โ”€ .env.example               # Environment variable template
โ”œโ”€โ”€ index.html                 # Vite HTML entry
โ”œโ”€โ”€ install.bat                # One-click install (Windows)
โ”œโ”€โ”€ start.bat                  # One-click start (Windows)
โ”œโ”€โ”€ uninstall.bat              # One-click uninstall (Windows)
โ”œโ”€โ”€ package.json
โ”œโ”€โ”€ vite.config.ts
โ”œโ”€โ”€ tsconfig.json
โ”œโ”€โ”€ server/
โ”‚   โ”œโ”€โ”€ index.ts               # Express server entry
โ”‚   โ”œโ”€โ”€ db/
โ”‚   โ”‚   โ”œโ”€โ”€ index.ts           # sql.js database wrapper
โ”‚   โ”‚   โ””โ”€โ”€ schema.sql         # Database schema
โ”‚   โ”œโ”€โ”€ llm/
โ”‚   โ”‚   โ”œโ”€โ”€ provider.ts        # LLM interface definition
โ”‚   โ”‚   โ”œโ”€โ”€ openai-compatible.ts # OpenAI / DeepSeek implementation
โ”‚   โ”‚   โ””โ”€โ”€ ollama.ts          # Ollama / LM Studio implementation
โ”‚   โ”œโ”€โ”€ routes/
โ”‚   โ”‚   โ”œโ”€โ”€ calendar.ts        # Calendar & event API + iCal import + Excel export
โ”‚   โ”‚   โ”œโ”€โ”€ todo.ts            # Todo API (auto priority)
โ”‚   โ”‚   โ”œโ”€โ”€ schedule.ts        # Schedule API + LLM config
โ”‚   โ”‚   โ””โ”€โ”€ settings.ts        # App settings API
โ”‚   โ”œโ”€โ”€ services/
โ”‚   โ”‚   โ”œโ”€โ”€ scheduler.ts       # Algorithm scheduling engine
โ”‚   โ”‚   โ”œโ”€โ”€ llm-scheduler.ts   # LLM scheduling engine
โ”‚   โ”‚   โ””โ”€โ”€ ical-parser.ts     # iCal file parser
โ”‚   โ””โ”€โ”€ utils/
โ”‚       โ”œโ”€โ”€ crypto.ts          # AES-256-GCM encryption utility
โ”‚       โ””โ”€โ”€ debug.ts           # Debug logger
โ”œโ”€โ”€ src/
โ”‚   โ”œโ”€โ”€ main.tsx               # React entry
โ”‚   โ”œโ”€โ”€ App.tsx                # Root component (sidebar navigation)
โ”‚   โ”œโ”€โ”€ api/
โ”‚   โ”‚   โ””โ”€โ”€ client.ts          # Axios API client
โ”‚   โ”œโ”€โ”€ types/
โ”‚   โ”‚   โ””โ”€โ”€ index.ts           # TypeScript type definitions
โ”‚   โ”œโ”€โ”€ utils/
โ”‚   โ”‚   โ””โ”€โ”€ priority.ts        # Priority calculation
โ”‚   โ”œโ”€โ”€ contexts/
โ”‚   โ”‚   โ””โ”€โ”€ ThemeContext.tsx    # Theme management (light/dark/system)
โ”‚   โ”œโ”€โ”€ i18n/
โ”‚   โ”‚   โ”œโ”€โ”€ index.tsx          # i18n init
โ”‚   โ”‚   โ”œโ”€โ”€ zh.ts              # Chinese translations
โ”‚   โ”‚   โ””โ”€โ”€ en.ts              # English translations
โ”‚   โ””โ”€โ”€ components/
โ”‚       โ”œโ”€โ”€ CalendarView.tsx    # Calendar view
โ”‚       โ”œโ”€โ”€ TodoList.tsx        # Todo list
โ”‚       โ”œโ”€โ”€ TodoForm.tsx        # Todo form
โ”‚       โ”œโ”€โ”€ TodoSplitModal.tsx  # Todo split modal
โ”‚       โ”œโ”€โ”€ SchedulePanel.tsx   # Smart scheduling panel
โ”‚       โ”œโ”€โ”€ ImportModal.tsx     # iCal import modal
โ”‚       โ””โ”€โ”€ SettingsModal.tsx   # Settings (LLM/prompts/theme/language)

๐Ÿ“ก API Reference

Health Check

Method Endpoint Description
GET /api/health Service health check

Calendar & Events /api/calendar

Method Endpoint Description
GET /calendars List all calendars
POST /calendars Create a calendar
DELETE /calendars/:id Delete a calendar and its events
GET /events List events (supports start/end range)
POST /events Create an event
PUT /events/:id Update an event
DELETE /events/:id Delete an event
POST /import Import iCal file
GET /export-week Export weekly calendar as Excel (.xlsx)

Todos /api/todos

Method Endpoint Description
GET / List todos (filter by status/priority)
POST / Create a todo (auto-calculates priority)
POST /:id/split Split a todo into time segments
PUT /:id Update a todo
DELETE /:id Delete a todo

Scheduling /api/schedule

Method Endpoint Description
POST /generate Generate a schedule (algorithm / llm)
POST /apply Apply a generated schedule
GET /llm-config Get LLM config (no API key)
POST /llm-config/test Test LLM connectivity
POST /llm-config Create LLM config
PUT /llm-config/:id/activate Activate a config
DELETE /llm-config/:id Delete a config
GET /prompt-template Get prompt template
PUT /prompt-template Update prompt template
POST /prompt-template/reset Reset to default template

โš™๏ธ Configuration

Environment Variables

Copy .env.example to .env and customize:

cp .env.example .env
Variable Description Default
PORT Backend server port 3000
CRYPTO_SECRET API key encryption secret smart-calendar-default-secret-key

โš ๏ธ Production: Always set a strong CRYPTO_SECRET. Never use the default value.

Ports

Service Port
Frontend (Vite dev server) 5173
Backend (Express API) 3000 (configurable via PORT)

Database

  • Engine: sql.js (SQLite WASM โ€” no native compilation or system SQLite required)
  • File: data/calendar.db (auto-created on first run)
  • Auto-save: every 5 seconds + on shutdown
  • Write strategy: atomic (temp file + rename)

LLM Providers

Provider Default Model API Key Required
OpenAI gpt-4o-mini Yes
DeepSeek deepseek-chat Yes
Ollama llama3 No (local)
LM Studio โ€” No (local)
Custom โ€” Depends

๐Ÿญ Production Deployment

npm run build   # Build frontend to dist/
npm start       # Start server (serves both API and static files)

In production, Express automatically serves the dist/ directory โ€” a single process on port 3000 provides the complete application.


๐Ÿ“œ NPM Scripts

Command Description
npm run dev Start frontend dev server (Vite)
npm run dev:server Start backend dev server (tsx watch)
npm run dev:all Start both frontend & backend concurrently
npm run build Build frontend for production
npm start Start production server

๐Ÿค Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

๐Ÿ“„ License

This project is licensed under the MIT License โ€” see the LICENSE file for details.


ไธญๆ–‡่ฏดๆ˜Ž

ไธ€ๆฌพ้›†ๆˆๆ—ฅๅކ็ฎก็†ใ€ๅพ…ๅŠž่ง„ๅˆ’ไธŽๆ™บ่ƒฝ่ฐƒๅบฆ็š„ๅ…จๆ ˆๅบ”็”จใ€‚ๅŸบไบŽ Eisenhower ๅ››่ฑก้™ไผ˜ๅ…ˆ็บง็Ÿฉ้˜ต๏ผŒๆไพ›็ฎ—ๆณ•่‡ชๅŠจๆŽ’็จ‹ไธŽ LLM ๆ™บ่ƒฝๆŽ’็จ‹ไธค็งๆจกๅผ๏ผŒๅธฎๅŠฉไฝ ้ซ˜ๆ•ˆ่ง„ๅˆ’ๆ—ถ้—ดใ€‚

ไธป่ฆๅŠŸ่ƒฝ

  • ๅคšๆ—ฅๅކ็ฎก็† โ€” ่‡ชๅฎšไน‰ๅ็งฐไธŽ้ขœ่‰ฒ๏ผŒๆ”ฏๆŒ iCal ๅฏผๅ…ฅ๏ผŒๅฎŒๆ•ด RRULE ้‡ๅคไบ‹ไปถๆ”ฏๆŒ
  • ๅ››่ฑก้™ๅพ…ๅŠž โ€” ๆŒ‰็ดงๆ€ฅๅบฆไธŽ้‡่ฆๅบฆ่‡ชๅŠจๅฝ’็ฑป P1โ€“P4 ไผ˜ๅ…ˆ็บง๏ผŒๆˆชๆญขๆ—ฅๆœŸๅ€’่ฎกๆ—ถ
  • ๆ™บ่ƒฝ่ฐƒๅบฆ โ€” ็ฎ—ๆณ•่ฐƒๅบฆ๏ผˆ่ดชๅฟƒ็ญ–็•ฅ๏ผ‰ไธŽ LLM ่ฐƒๅบฆ๏ผˆOpenAI / DeepSeek / Ollama / LM Studio๏ผ‰
  • ๆ™บ่ƒฝๆ‹†ๅˆ† โ€” ่ถ…่ฟ‡ 90 ๅˆ†้’Ÿ็š„้•ฟไปปๅŠก่‡ชๅŠจๆ‹†ๅˆ†๏ผŒๅบ”็”จๅŽ็”Ÿๆˆ็‹ฌ็ซ‹ๅพ…ๅŠž่ฎฐๅฝ•
  • ๆทฑ่‰ฒๆจกๅผ โ€” ๆต…่‰ฒ / ๆทฑ่‰ฒ / ่ทŸ้š็ณป็ปŸ
  • ๅ›ฝ้™…ๅŒ– โ€” ไธญ่‹ฑๆ–‡ๅˆ‡ๆข
  • ๆ—ฅๅކไบคไบ’ โ€” ๆ‹–ๆ‹ฝ็งปๅŠจ/่ฐƒๆ•ดๆ—ถ้•ฟ๏ผŒๅฟซ้€Ÿๅˆ›ๅปบ๏ผŒExcel ๅ‘จๅކๅฏผๅ‡บ
  • ๅฎ‰ๅ…จ โ€” API ๅฏ†้’ฅ AES-256-GCM ๅŠ ๅฏ†ๅญ˜ๅ‚จ

ๅฟซ้€Ÿๅผ€ๅง‹

git clone https://github.com/ADA-quart/Intelligent-To-Do-Calendar.git
cd Intelligent-To-Do-Calendar
npm install
npm run dev:all

Windows ็”จๆˆทๅฏ็›ดๆŽฅๅŒๅ‡ป install.bat โ†’ start.bat ไธ€้”ฎๅฏๅŠจใ€‚

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors