Skip to content

bconti123/ai-taskplanner

Repository files navigation

AI Task Planner

Demo Website Link: https://ai-taskplanner.vercel.app/

An AI-assisted task planner built with Next.js App Router, Prisma, PostgreSQL, and the OpenAI Responses API. The app demonstrates server-side AI tool calling against real application data with validation, user scoping, audit logging, and a daily planning assistant.

Features

  • Task CRUD with status, priority, due date, estimates, tags, and completion tracking.
  • Server-side AI chat that can create, list, update, and safely delete tasks.
  • AI daily planner that turns open tasks into a concise schedule.
  • Request-scoped workspaces using an email-based demo identity.
  • Audit log for UI and AI task mutations.
  • Shared validation used by dashboard APIs and AI tool execution.
  • Unit tests for task validation.

Tech Stack

  • Frontend: Next.js, React, Tailwind CSS
  • Backend: Next.js API Routes
  • Database: PostgreSQL
  • ORM: Prisma
  • AI: OpenAI Responses API
  • Tests: Vitest

Architecture

React UI
  -> Next.js API Routes
  -> validation + user resolution + audit logging
  -> Prisma
  -> PostgreSQL

AI Chat / Daily Planner
  -> server-only OpenAI Responses calls
  -> controlled task tools
  -> same Prisma/Postgres data model

The AI never receives database credentials and never runs in the browser. It asks the server to execute explicit tools, and the server validates input before writing to the database.

Why Next API Routes Instead Of FastAPI?

For this project, a single Next.js full-stack app is the pragmatic choice. It keeps deployment simple, avoids duplicated auth/session plumbing, and lets the AI agent, dashboard, validation, and Prisma data access share one server boundary.

FastAPI would make sense later if the goal is to run a separate Python service, background jobs, or Python-specific AI pipelines. For this project, the simpler and stronger architecture is a clean TypeScript app with safe server-side AI actions.

Local Setup

  1. Install dependencies:
npm install
  1. Create an environment file:
cp .env.example .env
  1. Set DATABASE_URL and OPENAI_API_KEY in .env.

  2. Apply migrations and generate Prisma client:

npx prisma migrate deploy
npx prisma generate
  1. Run the app:
npm run dev

Scripts

npm run lint
npm run test
npm run build
npm run migrate:deploy

Example AI Prompts

  • Create a task to polish my resume, priority 8, estimate 45 minutes, tag career
  • List all blocked tasks
  • Mark the resume task as done
  • Delete the task called polish resume
  • Create a plan for my day

Design Notes

  • The AI uses tool calling instead of directly mutating data.
  • Task ownership is scoped by user/workspace.
  • Mutations are validated before Prisma writes.
  • Ambiguous deletes are handled safely.
  • Audit logs make AI actions inspectable.
  • The daily planner uses task metadata such as due dates, priority, status, estimates, and tags.

About

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages