# d3byn/nexmind architecture

> Architecture diagram of the GitHub repository d3byn/nexmind, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-30). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/d3byn/nexmind
- Repository: https://github.com/d3byn/nexmind

## Overview

NexMind is a Next.js productivity workspace for notes, task boards, calendar items, whiteboards, and longer documents, with Gemini helpers and shared-board collaboration. The main user flow is to open a feature workspace, work with its domain objects, and persist changes through server actions to Postgres. AI proposals require confirmation before execution. The graph preserves the documented feature branches; source excerpts and the index support only some implementation links, so uncertain connections are omitted or marked unverified.

Main entry points: [`db/index.ts`](https://github.com/d3byn/nexmind/blob/main/db/index.ts) (Neon Postgres), [`app/ai-template-builder/actions.ts`](https://github.com/d3byn/nexmind/blob/main/app/ai-template-builder/actions.ts) (Template Actions), [`lib/liveblocks.ts`](https://github.com/d3byn/nexmind/blob/main/lib/liveblocks.ts) (Liveblocks Helpers), [`app/kanban/actions.ts`](https://github.com/d3byn/nexmind/blob/main/app/kanban/actions.ts) (Board Actions)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_workspaces["Product Workspaces"]
  node_dashboard["Dashboard<br/>[actions.ts]"]
  node_notes["Notes Editor"]
  node_note_actions["Notes Actions<br/>[actions.ts]"]
  node_kanban["Kanban Board"]
  node_kanban_actions["Board Actions<br/>[actions.ts]"]
  node_calendar["Calendar Board<br/>[calendar-board.tsx]"]
  node_calendar_actions["Calendar Actions<br/>[actions.ts]"]
  node_whiteboard["Whiteboard Canvas"]
  node_whiteboard_actions["Whiteboard Actions<br/>[actions.ts]"]
  node_spaces["Spaces &amp; Pages"]
  node_spaces_actions["Space Actions<br/>[actions.ts]"]
end

subgraph group_ai["AI Features"]
  node_assistant["AI Assistant"]
  node_assistant_actions["Assistant Actions<br/>[actions.ts]"]
  node_template_builder["Template Builder"]
  node_template_actions["Template Actions<br/>[actions.ts]"]
  node_generated_preview["Generated App Preview"]
end

subgraph group_collab["Sharing &amp; Collaboration"]
  node_liveblocks_api["Liveblocks Auth &amp; Users<br/>[route.ts]"]
  node_liveblocks_service["Liveblocks Helpers<br/>[liveblocks.ts]"]
end

subgraph group_platform["Identity &amp; Preferences"]
  node_app_shell["App Navigation<br/>[app-shell.tsx]"]
  node_settings["Settings"]
  node_preferences["User &amp; Preferences"]
end

subgraph group_data["Persistence"]
  node_database[("Neon Postgres<br/>[index.ts]")]
end

node_user(("Workspace User"))
node_gemini{{"Google Gemini"}}

node_user -->|"opens workspace"| node_app_shell
node_app_shell -->|"navigates to"| node_dashboard
node_user -->|"edits notes"| node_notes
node_notes -->|"saves through"| node_note_actions
node_note_actions -->|"reads and writes"| node_database
node_user -->|"manages tasks"| node_kanban
node_kanban -->|"dispatches changes"| node_kanban_actions
node_kanban_actions -->|"reads and writes"| node_database
node_user -->|"schedules items"| node_calendar
node_calendar -->|"uses actions"| node_calendar_actions
node_user -->|"draws diagrams"| node_whiteboard
node_whiteboard -->|"uses actions"| node_whiteboard_actions
node_user -->|"organizes pages"| node_spaces
node_spaces -->|"uses actions"| node_spaces_actions
node_user -->|"requests suggestions"| node_assistant
node_assistant -->|"submits prompts"| node_assistant_actions
node_assistant_actions -->|"requests proposals"| node_gemini
node_assistant_actions -.->|"executes confirmed changes"| node_database
node_user -->|"describes a tool"| node_template_builder
node_template_builder -->|"requests generation"| node_template_actions
node_template_actions -->|"generates definition"| node_gemini
node_template_actions -->|"stores generated apps"| node_database
node_generated_preview -->|"saves app state"| node_template_actions
node_user -->|"changes preferences"| node_settings
node_settings -->|"loads and updates"| node_preferences
node_preferences -->|"reads and writes"| node_database
node_liveblocks_api -->|"uses helpers"| node_liveblocks_service
node_liveblocks_service -.->|"supports presence"| node_kanban
node_kanban_actions -->|"uses collaboration"| node_liveblocks_service
node_spaces_actions -->|"uses collaboration"| node_liveblocks_service

click node_app_shell "https://github.com/d3byn/nexmind/blob/main/components/app-shell.tsx"
click node_dashboard "https://github.com/d3byn/nexmind/blob/main/app/dashboard/actions.ts"
click node_notes "https://github.com/d3byn/nexmind/blob/main/app/notes/notes-workspace.tsx"
click node_note_actions "https://github.com/d3byn/nexmind/blob/main/app/notes/actions.ts"
click node_kanban "https://github.com/d3byn/nexmind/blob/main/app/kanban/kanban-workspace.tsx"
click node_kanban_actions "https://github.com/d3byn/nexmind/blob/main/app/kanban/actions.ts"
click node_calendar "https://github.com/d3byn/nexmind/blob/main/app/calendar/calendar-board.tsx"
click node_calendar_actions "https://github.com/d3byn/nexmind/blob/main/app/calendar/actions.ts"
click node_whiteboard "https://github.com/d3byn/nexmind/blob/main/app/whiteboard/whiteboard-workspace.tsx"
click node_whiteboard_actions "https://github.com/d3byn/nexmind/blob/main/app/whiteboard/actions.ts"
click node_spaces "https://github.com/d3byn/nexmind/blob/main/app/spaces/spaces-workspace.tsx"
click node_spaces_actions "https://github.com/d3byn/nexmind/blob/main/app/spaces/actions.ts"
click node_assistant "https://github.com/d3byn/nexmind/blob/main/app/ai-assistant/ai-assitant-workspace.tsx"
click node_assistant_actions "https://github.com/d3byn/nexmind/blob/main/app/ai-assistant/actions.ts"
click node_template_builder "https://github.com/d3byn/nexmind/blob/main/app/ai-template-builder/ai-template-builder-workspace.tsx"
click node_template_actions "https://github.com/d3byn/nexmind/blob/main/app/ai-template-builder/actions.ts"
click node_generated_preview "https://github.com/d3byn/nexmind/blob/main/app/ai-template-builder/generated-app-preview.tsx"
click node_settings "https://github.com/d3byn/nexmind/blob/main/app/settings/settings-workspace.tsx"
click node_preferences "https://github.com/d3byn/nexmind/blob/main/lib/user-preferences.ts"
click node_liveblocks_api "https://github.com/d3byn/nexmind/blob/main/app/api/liveblocks-auth/route.ts"
click node_liveblocks_service "https://github.com/d3byn/nexmind/blob/main/lib/liveblocks.ts"
click node_database "https://github.com/d3byn/nexmind/blob/main/db/index.ts"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_dashboard,node_notes,node_note_actions,node_kanban,node_kanban_actions,node_calendar,node_calendar_actions,node_whiteboard,node_whiteboard_actions,node_spaces,node_spaces_actions,node_user toneBlue
class node_assistant,node_assistant_actions,node_template_builder,node_template_actions,node_generated_preview toneAmber
class node_liveblocks_api,node_liveblocks_service toneMint
class node_app_shell,node_settings,node_preferences toneRose
class node_database,node_gemini toneIndigo
```

## Components

### Product Workspaces

- [Dashboard](https://github.com/d3byn/nexmind/blob/main/app/dashboard/actions.ts): `app/dashboard/actions.ts`
- [Notes Editor](https://github.com/d3byn/nexmind/blob/main/app/notes/notes-workspace.tsx): `app/notes/notes-workspace.tsx`
- [Notes Actions](https://github.com/d3byn/nexmind/blob/main/app/notes/actions.ts): `app/notes/actions.ts`
- [Kanban Board](https://github.com/d3byn/nexmind/blob/main/app/kanban/kanban-workspace.tsx): `app/kanban/kanban-workspace.tsx`
- [Board Actions](https://github.com/d3byn/nexmind/blob/main/app/kanban/actions.ts): `app/kanban/actions.ts`
- [Calendar Board](https://github.com/d3byn/nexmind/blob/main/app/calendar/calendar-board.tsx): `app/calendar/calendar-board.tsx`
- [Calendar Actions](https://github.com/d3byn/nexmind/blob/main/app/calendar/actions.ts): `app/calendar/actions.ts`
- [Whiteboard Canvas](https://github.com/d3byn/nexmind/blob/main/app/whiteboard/whiteboard-workspace.tsx): `app/whiteboard/whiteboard-workspace.tsx`
- [Whiteboard Actions](https://github.com/d3byn/nexmind/blob/main/app/whiteboard/actions.ts): `app/whiteboard/actions.ts`
- [Spaces & Pages](https://github.com/d3byn/nexmind/blob/main/app/spaces/spaces-workspace.tsx): `app/spaces/spaces-workspace.tsx`
- [Space Actions](https://github.com/d3byn/nexmind/blob/main/app/spaces/actions.ts): `app/spaces/actions.ts`

### AI Features

- [AI Assistant](https://github.com/d3byn/nexmind/blob/main/app/ai-assistant/ai-assitant-workspace.tsx): `app/ai-assistant/ai-assitant-workspace.tsx`
- [Assistant Actions](https://github.com/d3byn/nexmind/blob/main/app/ai-assistant/actions.ts): `app/ai-assistant/actions.ts`
- [Template Builder](https://github.com/d3byn/nexmind/blob/main/app/ai-template-builder/ai-template-builder-workspace.tsx): `app/ai-template-builder/ai-template-builder-workspace.tsx`
- [Template Actions](https://github.com/d3byn/nexmind/blob/main/app/ai-template-builder/actions.ts): `app/ai-template-builder/actions.ts`
- [Generated App Preview](https://github.com/d3byn/nexmind/blob/main/app/ai-template-builder/generated-app-preview.tsx): `app/ai-template-builder/generated-app-preview.tsx`

### Sharing & Collaboration

- [Liveblocks Auth & Users](https://github.com/d3byn/nexmind/blob/main/app/api/liveblocks-auth/route.ts): `app/api/liveblocks-auth/route.ts`
- [Liveblocks Helpers](https://github.com/d3byn/nexmind/blob/main/lib/liveblocks.ts): `lib/liveblocks.ts`

### Identity & Preferences

- [App Navigation](https://github.com/d3byn/nexmind/blob/main/components/app-shell.tsx): `components/app-shell.tsx`
- [Settings](https://github.com/d3byn/nexmind/blob/main/app/settings/settings-workspace.tsx): `app/settings/settings-workspace.tsx`
- [User & Preferences](https://github.com/d3byn/nexmind/blob/main/lib/user-preferences.ts): `lib/user-preferences.ts`

### Persistence

- [Neon Postgres](https://github.com/d3byn/nexmind/blob/main/db/index.ts): `db/index.ts`

### Other components

- **Workspace User**
- **Google Gemini**

## Connections

- Workspace User → App Navigation: opens workspace
- App Navigation → Dashboard: navigates to (evidence: `components/app-shell.tsx`)
- Workspace User → Notes Editor: edits notes
- Notes Editor → Notes Actions: saves through (evidence: `app/notes/notes-workspace.tsx`)
- Notes Actions → Neon Postgres: reads and writes (evidence: `app/notes/actions.ts`)
- Workspace User → Kanban Board: manages tasks
- Kanban Board → Board Actions: dispatches changes (evidence: `app/kanban/kanban-workspace.tsx`)
- Board Actions → Neon Postgres: reads and writes (evidence: `app/kanban/actions.ts`)
- Workspace User → Calendar Board: schedules items
- Calendar Board → Calendar Actions: uses actions (evidence: `app/calendar/page.tsx`)
- Workspace User → Whiteboard Canvas: draws diagrams
- Whiteboard Canvas → Whiteboard Actions: uses actions (evidence: `app/whiteboard/page.tsx`)
- Workspace User → Spaces & Pages: organizes pages
- Spaces & Pages → Space Actions: uses actions (evidence: `app/spaces/page.tsx`)
- Workspace User → AI Assistant: requests suggestions
- AI Assistant → Assistant Actions: submits prompts (evidence: `app/ai-assistant/page.tsx`)
- Assistant Actions → Google Gemini: requests proposals
- Assistant Actions → Neon Postgres: executes confirmed changes
- Workspace User → Template Builder: describes a tool
- Template Builder → Template Actions: requests generation (evidence: `app/ai-template-builder/page.tsx`)
- Template Actions → Google Gemini: generates definition
- Template Actions → Neon Postgres: stores generated apps (evidence: `app/ai-template-builder/actions.ts`)
- Generated App Preview → Template Actions: saves app state (evidence: `app/ai-template-builder/generated-app-preview.tsx`)
- Workspace User → Settings: changes preferences
- Settings → User & Preferences: loads and updates (evidence: `app/settings/settings-workspace.tsx`)
- User & Preferences → Neon Postgres: reads and writes (evidence: `lib/user-preferences.ts`)
- Liveblocks Auth & Users → Liveblocks Helpers: uses helpers (evidence: `app/api/liveblocks-auth/route.ts`)
- Liveblocks Helpers → Kanban Board: supports presence
- Board Actions → Liveblocks Helpers: uses collaboration (evidence: `app/kanban/actions.ts`)
- Space Actions → Liveblocks Helpers: uses collaboration (evidence: `app/spaces/actions.ts`)
