AI-powered Kanban automation that turns natural language into actionable board updates.
Kaiban pairs a Next.js 16 App Router frontend with Gemini-driven function calls. Conversational input becomes structured task data that remains synchronized across boards, chat transcripts, and Prisma-backed storage. Users can create, update, reorganize, or remove tasks, boards, and columns either through the UI or conversational commands.
- Frontend:
app/page.tsxrenders the board, task drawer, and resizable chat sidebar. Hooks such asuse-board-manager,use-task-manager, anduse-chat-managercoordinate board state, task mutations, and chat interactions. - Backend: App Router endpoints under
app/api/**handle task, board, column, chat, and data fetch workflows. Shared persistence logic lives inlib/api/*helpers. - AI Integration:
lib/gemini.tswraps Gemini calls using the schemas defined inlib/gemini-contract.ts, guaranteeing deterministic function-call results that mirror the Prisma models. - Data Layer: Prisma models (
prisma/schema/*.prisma) store conversations, boards, columns, and notes, tying every change back to a conversation history.
pnpm install
pnpm prisma migrate dev
pnpm devVisit http://localhost:3000 once the dev server starts. UI routes belong under app/; shared utilities reside in components, hooks, and lib.
DATABASE_URL: PostgreSQL connection string used by Prisma.GEMINI_API_KEYorGOOGLE_GEMINI_API_KEY: API key for Gemini function calling.GEMINI_MODEL(optional): Overrides the defaultgemini-2.5-flashmodel.
- Board / BoardColumn: Boards own ordered columns and optional relationships to the originating conversation.
- Conversation / ConversationMessage: Track chat history and metadata for every assistant exchange.
- Note: Represents an actionable task with
caseNumber,status, andpriority; optionally scoped to a board and conversation. Runpnpm prisma migrate devto apply schema changes locally.
- Board lifecycle:
use-board-managerloads boards fromGET /api/data, creates boards viaPOST /api/boards, renames throughPATCH /api/boards/[id], deletes withDELETE /api/boards/[id], and clears tasks usingPOST /api/boards/[id]/clear. - Task lifecycle: Tasks originate from chat-created Gemini calls or manual edits. Mutations hit
POST /api/create-board,POST /api/chat,POST /api/update-task,POST /api/delete-task, andPATCH /api/tasks/[caseNumber]. - Chat automation:
POST /api/chatenriches user commands with next task numbers, calls Gemini, and executes the resulting function handlers defined inlib/api/chat-handler.ts.
POST /api/create-board- Body:
{ text: string, boardId?: string } - Success:
{ tasks: Task[], conversationId: string, boardId: string | null }
- Body:
POST /api/chat- Body:
{ command: string, conversationId: string, boardId?: string } - Success: Action payload describing created tasks, status updates, deletions, or board/column mutations.
- Body:
POST /api/update-task- Body:
{ command: string, conversationId: string } - Success:
{ caseNumber: string, newStatus: string }
- Body:
POST /api/delete-task- Body:
{ command: string, conversationId: string } - Success:
{ caseNumber: string }
- Body:
PATCH /api/tasks/[caseNumber]- Body:
{ newCaseNumber?, title?, description?, priority? } - Success:
{ caseNumber, title, description, status, priority }
- Body:
GET /api/boards- Success:
{ boards: Array<{ id, name, title, taskCount, columns[] }> }
- Success:
POST /api/boards- Body:
{ name: string, columns?: Array<{ title: string, helper?: string, order: number }> } - Success:
{ board: { id, name, title, columns[] } }
- Body:
PATCH /api/boards/[id]- Body:
{ name: string } - Success:
{ board: { id, name, title, columns[] } }
- Body:
DELETE /api/boards/[id]- Success:
{ success: true }
- Success:
POST /api/boards/[id]/clear- Success:
{ clearedCount: number }
- Success:
GET /api/data- Query:
?boardId=<id>(optional) - Success:
{ conversations, tasks, boards }
- Query:
POST /api/clear-messages- Body:
{ conversationId: string } - Success:
{ success: true }
- Body:
lib/gemini-contract.ts defines strict schemas for Gemini outputs:
create_tasks_from_text: Returns{ tasks: Array<{ caseNumber, title, description, status, priority }> }.update_task_status: Returns{ caseNumber, newStatus }mapping conversational intent to board statuses.delete_task: Returns{ caseNumber }to remove tasks.update_task_properties: Renames or edits task metadata via{ caseNumber, newCaseNumber?, newTitle?, newDescription?, newPriority? }.create_board,update_board,delete_board: Manage board lifecycle with confirmation handling.create_column,update_column,delete_column: Maintain column structure for the active board.
pnpm typecheck: Type-safety gate (required before merging changes).pnpm build: Produces a production bundle (optional for local verification).pnpm prisma studio: Opens Prisma Studio to inspect boards, notes, and conversations.