# Dikanban — AI Agent Context
> A personal kanban board with multi-board support, custom columns, and member collaboration.
> Stack: TanStack Start (React + SSR) + Drizzle ORM + Turso (SQLite) + Better Auth

## Quick Start
- **Auth**: GitHub OAuth or email/password at `/login`
- **Boards**: Authenticated users get a default board. Create more via board switcher dropdown.
- **Columns**: Customizable per board. Last column is the archive (done) column.
- **Sharing**: Owner accounts can create member accounts and share boards.

## Route Map
- `/` — Landing page with sign-in
- `/login` — Email/password sign-in and registration
- `/board` — Redirects to user's default board
- `/board/$userId/$slug` — Board view (columns, drag-drop, task detail)
- `/board/settings` — Board + column settings, member management
- `/account/settings` — Profile settings, member account management
- `/about` — About page

## API (Server Functions)
- `GET /api/auth/*` — Better Auth handler (sign-in, sign-out, session)
- Server functions (TanStack Start `createServerFn`):
  - `getBoardBySlug(ownerId, slug)` → Board
  - `getBoard(boardId)` → BoardData (tasks, columns, tags)
  - `createTask(boardId, title, priority, status, tagNames, links)` → BoardData
  - `updateTask(id, data)` → BoardData
  - `deleteTask(id)` → BoardData
  - `getBoards()` → Board[]

## Data Model
- **Board**: id, name, slug, color, columnConfig (JSON), historyHours
- **Task**: id, title, description, priority (low|medium|high|urgent), status (string), sortOrder, completedAt, tags[], links[]
- **Column**: id, name, color, sortOrder (defined in columnConfig JSON)
- **User**: id, name, email, role (owner|member), ownerId

## Key Design Decisions
- Dark theme: deep aubergine base with warm bronze/ember accents
- Single-file CSS split into chunks under `src/styles/`
- No external state library (React useState/useReducer)
- Optimistic updates with mutation-sequence guard
- Optimistic locking via updatedAt timestamps
