Unlimited task hierarchy for monday.com boards. Built as a monday.com marketplace Board View app.
- Next.js 14 (App Router)
- React 18 + TypeScript
- TailwindCSS
- dnd-kit (drag-and-drop)
- Supabase (Postgres – tree persistence)
- monday.com Apps SDK + GraphQL API
/app
/api/monday
/tree GET (fetch nodes) · POST (sync items) · PATCH (update node)
/items GET (proxy to monday GraphQL)
/rename PATCH (rename monday item)
/board-view Main embedded board view page
layout.tsx
globals.css
/components
/Tree
Tree.tsx DndContext wrapper, optimistic updates
TreeNode.tsx Sortable node with inline rename
DragLayer.tsx Custom drag overlay
/ui
Spinner.tsx
ErrorBoundary.tsx
/lib
monday.ts getBoardItems (paginated), renameItem
supabase.ts Supabase client
tree-utils.ts buildTree, flattenTree, calculateDepth, reorderNodes
/types
index.ts All TypeScript interfaces
/supabase/migrations
001_initial.sql Postgres schema
npm installcp .env.local.example .env.localFill in:
| Variable | Description |
|---|---|
NEXT_PUBLIC_SUPABASE_URL |
Your Supabase project URL |
NEXT_PUBLIC_SUPABASE_ANON_KEY |
Supabase anon/public key |
NEXT_PUBLIC_DEV_BOARD_ID |
(local dev only) A monday.com board ID |
NEXT_PUBLIC_DEV_TOKEN |
(local dev only) A monday.com personal API token |
In the Supabase dashboard → SQL Editor, run:
-- contents of supabase/migrations/001_initial.sqlOr with the Supabase CLI:
supabase db pushnpm run devOpen http://localhost:3000/board-view.
vercel --prodSet the same environment variables in the Vercel dashboard.
After deploying, update monday-app-manifest.json and the monday Developer Center with your production URL.
- Go to monday.com Developer Center
- Create a new app → Board View feature
- Set the iframe URL to
https://your-domain.vercel.app/board-view - Request permissions:
boards:read,items:read,items:write - Install the app on a board
- Mount: The board view page initialises the monday SDK and reads
boardId+sessionTokenfrom the SDK context. - Fetch: Board items are fetched via
/api/monday/items(server-side proxy to avoid CORS). - Sync: Items are upserted into Supabase via
/api/monday/treePOST. Existing nodes are untouched (hierarchy preserved). - Render: Flat nodes are assembled into a
TreeNode[]tree and rendered with dnd-kit. - Drag: On drop, positions and parent IDs are recalculated client-side (optimistic), then PATCHed to Supabase.
- Rename: Double-click a node name to edit inline; saved via
/api/monday/rename.
- The monday session token is never persisted — it is forwarded per-request from the SDK via the
x-monday-tokenheader. - The Supabase schema uses a self-referential
nodestable with aparent_node_idFK. positionintegers are contiguous per parent group; gaps are closed on each drag-end.- Row Level Security is enabled on the
nodestable. Tighten the policy before production.