Skip to content

Repository files navigation

Next.jsTypeScriptOpenAITailwind

PlanGPT - AI Weekly Scheduler

An AI-powered weekly planner that generates optimized schedules around your fixed commitments.

Tell it your prayers, classes, tasks, and goals - GPT builds a realistic week that respects every constraint.


The Problem

Manually scheduling a productive week is painful. You have fixed commitments (classes, prayers, meetings) scattered across the day, a pile of tasks with different frequencies, and limited energy windows. Most planners make you do the puzzle yourself.

The Solution

PlanGPT sends your full context - fixed blocks, task pool, frequencies, energy patterns - to GPT-4o, which returns an optimized 7-day schedule. You review, drag-and-drop to adjust, lock what you like, and regenerate the rest.


Features

FeatureDescription
AI Schedule GenerationGPT-4o builds a full week in one shot, respecting all constraints
Smart ConstraintsFixed prayer times, class blocks, wake/sleep windows, transition buffers
Frequency DistributionTasks spread across the week (e.g., "5x/week" gets placed on 5 different days)
Drag & DropReorder blocks within any day - times auto-recalculate
Day LockingLock completed days so mid-week regeneration only touches unlocked ones
Completion TrackingCheck off blocks as you go, with daily progress bars
In-Place EditingClick any block title to rename it
Weekly HistoryArchives up to 8 previous weeks with completion data
Sunday = RestEnforced rest day - only prayers, Quran, and relaxation
Local PersistenceEverything stored in localStorage - no account needed

How It Works

Setup Mode --> GPT-4o API --> Week View
Define tasks 200-line prompt 7-column calendar
Set frequencies with constraints Drag & drop
Fixed blocks Returns JSON Track completion
  1. Setup - Add your tasks with duration, frequency, and category
  2. Generate - One click sends everything to GPT-4o with detailed scheduling rules
  3. Review - See your full week laid out with color-coded categories
  4. Adjust - Drag blocks, edit titles, lock days you're happy with
  5. Track - Check off completed blocks throughout the week

Task Categories

CategoryColorExamples
PrayerLimeFajr, Dhuhr, Asr, Maghrib, Isha
ClassBlueUniversity lectures (Mon-Fri)
GrowthPurpleQuran journal, English practice, reading
OutreachCyanLinkedIn, cold outreach, content creation
WorkOrangeClient projects, freelance tasks
BreakGrayMeals, rest, transition buffers

Quick Start

Prerequisites

  • Node.js 18+
  • OpenAI API key

Setup

git clone https://github.com/CodeWithArhum/TimeTable-AI.git
cd TimeTable-AI
npm install

Create .env.local:

OPENAI_API_KEY=your_openai_api_key
npm run dev

Open http://localhost:3000


Tech Stack

LayerTechnology
FrameworkNext.js 14 (App Router)
LanguageTypeScript 5
StylingTailwind CSS 3.4
AIOpenAI SDK (GPT-4o, GPT-4 Turbo, GPT-3.5)
Drag & Dropdnd-kit
IconsLucide React
StoragelocalStorage (no backend DB)
Rate LimitingLRU Cache (3 req/min per IP)

Project Structure

TimeTable-AI/
├── src/app/
│ ├── page.tsx # Main app (setup + week view, 930 lines)
│ ├── layout.tsx # Root layout with metadata
│ ├── globals.css # Tailwind + custom animations
│ ├── api/generate/
│ │ └── route.ts # OpenAI API handler + prompt engineering
│ └── fonts/ # Geist font files
├── tailwind.config.ts # Extended color palette
├── next.config.mjs # Security headers (CSP, X-Frame-Options)
└── package.json

Security

  • Rate limited to 3 generations per minute per IP
  • CSP headers configured in next.config.mjs
  • API key stays server-side (never exposed to client)
  • Input validation on task count and model selection

Built by @CodeWithArhum

About

AI-powered weekly scheduler — GPT-4o generates optimized timetables around prayers, classes, and goals with drag-and-drop editing.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages