# unamic0/miro-clone architecture

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

- Interactive diagram: https://gitdiagram.com/unamic0/miro-clone
- Repository: https://github.com/unamic0/miro-clone

## Overview

Boardy is a collaborative whiteboard: users sign in, find or create a board, then draw and manipulate shapes on its canvas while sharing the board with collaborators. The dashboard supports board listing and management; the workspace combines canvas tools and selection with Liveblocks presence. Convex provides the application backend, while Clerk supplies authentication. The sampled source shows the canvas composition and Liveblocks authorization route; dashboard-to-backend behavior and persistence details are only partly visible, so those links are documented or marked unverified rather than inferred as source calls.

Main entry points: [`app/board/[boardId]/canvas/index.tsx`](https://github.com/unamic0/miro-clone/blob/main/app/board/%5BboardId%5D/canvas/index.tsx) (Interactive canvas), [`app/api/liveblocks-auth/route.ts`](https://github.com/unamic0/miro-clone/blob/main/app/api/liveblocks-auth/route.ts) (Room authorization), [`app/board/[boardId]/CanvasContext.tsx`](https://github.com/unamic0/miro-clone/blob/main/app/board/%5BboardId%5D/CanvasContext.tsx) (Canvas state), [`app/(dashboard)/_components/BoardList.tsx`](https://github.com/unamic0/miro-clone/blob/main/app/(dashboard)/_components/BoardList.tsx) (Board list)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_identity["Identity and access"]
  node_clerk{{"Clerk"}}
  node_auth_pages["Sign-in pages<br/>[page.tsx]"]
  node_convex_provider["Authenticated client"]
end

subgraph group_boards["Board discovery"]
  node_dashboard["Dashboard<br/>[page.tsx]"]
  node_board_list["Board list<br/>[BoardList.tsx]"]
  node_board_actions["Board actions<br/>[index.tsx]"]
  node_rename["Rename board<br/>[RenameModal.tsx]"]
end

subgraph group_workspace["Canvas workspace"]
  node_board_page["Board workspace page<br/>[page.tsx]"]
  node_canvas["Interactive canvas<br/>[index.tsx]"]
  node_canvas_state["Canvas state<br/>[CanvasContext.tsx]"]
  node_toolbar["Drawing toolbar<br/>[index.tsx]"]
  node_canvas_layer["Shape layers<br/>[CanvasLayer.tsx]"]
  node_selection["Shape selection<br/>[index.tsx]"]
  node_canvas_types["Canvas model<br/>[canvas.ts]"]
end

subgraph group_collaboration["Live collaboration"]
  node_liveblocks{{"Liveblocks"}}
  node_presence["Cursors and presence"]
  node_live_auth["Room authorization<br/>[route.ts]"]
end

subgraph group_backend["Backend and state"]
  node_convex["Convex functions<br/>[board.ts]"]
  node_boards_api["Board functions<br/>[boards.ts]"]
  node_schema["Data schema<br/>[schema.ts]"]
  node_database[("Convex database")]
  node_mutation_hook["Mutation hook<br/>[useApiMutation.ts]"]
end

node_visitor(("Board user"))

node_visitor -->|"signs in"| node_auth_pages
node_auth_pages -->|"authenticates with"| node_clerk
node_visitor -->|"opens boards"| node_dashboard
node_dashboard -->|"renders"| node_board_list
node_board_list -.->|"loads boards"| node_boards_api
node_board_list -.->|"offers actions"| node_board_actions
node_board_actions -->|"deletes board"| node_mutation_hook
node_board_actions -->|"opens rename"| node_rename
node_rename -->|"submits rename"| node_mutation_hook
node_mutation_hook -.->|"calls mutations"| node_convex
node_visitor -->|"opens board"| node_board_page
node_board_page -.->|"shows canvas"| node_canvas
node_canvas -->|"renders layers"| node_canvas_layer
node_canvas -->|"renders cursors"| node_presence
node_canvas -->|"reads state"| node_canvas_state
node_canvas -->|"renders selection"| node_selection
node_canvas -.->|"uses tools"| node_toolbar
node_toolbar -->|"updates state"| node_canvas_state
node_canvas_layer -->|"uses layer model"| node_canvas_types
node_canvas_state -->|"uses canvas state"| node_canvas_types
node_selection -->|"reads state"| node_canvas_state
node_selection -->|"uses layer model"| node_canvas_types
node_presence -.->|"syncs presence"| node_liveblocks
node_visitor -.->|"requests room access"| node_live_auth
node_live_auth -->|"checks identity"| node_clerk
node_live_auth -->|"checks board access"| node_convex
node_live_auth -->|"authorizes room"| node_liveblocks
node_convex -.->|"reads and writes"| node_database
node_boards_api -.->|"reads and writes"| node_database
node_schema -.->|"defines data"| node_database
node_convex_provider -->|"uses authentication"| node_clerk

click node_auth_pages "https://github.com/unamic0/miro-clone/blob/main/app/sign-in/page.tsx"
click node_convex_provider "https://github.com/unamic0/miro-clone/blob/main/providers/convex-client-provider.tsx"
click node_dashboard "https://github.com/unamic0/miro-clone/blob/main/app/(dashboard)/page.tsx"
click node_board_list "https://github.com/unamic0/miro-clone/blob/main/app/(dashboard)/_components/BoardList.tsx"
click node_board_actions "https://github.com/unamic0/miro-clone/blob/main/components/Actions/index.tsx"
click node_rename "https://github.com/unamic0/miro-clone/blob/main/components/Actions/RenameModal.tsx"
click node_board_page "https://github.com/unamic0/miro-clone/blob/main/app/board/%5BboardId%5D/page.tsx"
click node_canvas "https://github.com/unamic0/miro-clone/blob/main/app/board/%5BboardId%5D/canvas/index.tsx"
click node_canvas_state "https://github.com/unamic0/miro-clone/blob/main/app/board/%5BboardId%5D/CanvasContext.tsx"
click node_toolbar "https://github.com/unamic0/miro-clone/blob/main/app/board/%5BboardId%5D/_components/Toolbar/index.tsx"
click node_canvas_layer "https://github.com/unamic0/miro-clone/blob/main/app/board/%5BboardId%5D/_components/CanvasLayer.tsx"
click node_selection "https://github.com/unamic0/miro-clone/blob/main/app/board/%5BboardId%5D/_components/OwnSelected/index.tsx"
click node_canvas_types "https://github.com/unamic0/miro-clone/blob/main/types/canvas.ts"
click node_presence "https://github.com/unamic0/miro-clone/blob/main/app/board/%5BboardId%5D/_components/CursorsPresence.tsx"
click node_live_auth "https://github.com/unamic0/miro-clone/blob/main/app/api/liveblocks-auth/route.ts"
click node_convex "https://github.com/unamic0/miro-clone/blob/main/convex/board.ts"
click node_boards_api "https://github.com/unamic0/miro-clone/blob/main/convex/boards.ts"
click node_schema "https://github.com/unamic0/miro-clone/blob/main/convex/schema.ts"
click node_mutation_hook "https://github.com/unamic0/miro-clone/blob/main/hooks/useApiMutation.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_clerk,node_auth_pages,node_convex_provider,node_visitor toneBlue
class node_dashboard,node_board_list,node_board_actions,node_rename toneAmber
class node_board_page,node_canvas,node_canvas_state,node_toolbar,node_canvas_layer,node_selection,node_canvas_types toneMint
class node_liveblocks,node_presence,node_live_auth toneRose
class node_convex,node_boards_api,node_schema,node_database,node_mutation_hook toneIndigo
```

## Components

### Identity and access

- **Clerk**
- [Sign-in pages](https://github.com/unamic0/miro-clone/blob/main/app/sign-in/page.tsx): `app/sign-in/page.tsx`
- [Authenticated client](https://github.com/unamic0/miro-clone/blob/main/providers/convex-client-provider.tsx): `providers/convex-client-provider.tsx`

### Board discovery

- [Dashboard](https://github.com/unamic0/miro-clone/blob/main/app/(dashboard)/page.tsx): `app/(dashboard)/page.tsx`
- [Board list](https://github.com/unamic0/miro-clone/blob/main/app/(dashboard)/_components/BoardList.tsx): `app/(dashboard)/_components/BoardList.tsx`
- [Board actions](https://github.com/unamic0/miro-clone/blob/main/components/Actions/index.tsx): `components/Actions/index.tsx`
- [Rename board](https://github.com/unamic0/miro-clone/blob/main/components/Actions/RenameModal.tsx): `components/Actions/RenameModal.tsx`

### Canvas workspace

- [Board workspace page](https://github.com/unamic0/miro-clone/blob/main/app/board/%5BboardId%5D/page.tsx): `app/board/[boardId]/page.tsx`
- [Interactive canvas](https://github.com/unamic0/miro-clone/blob/main/app/board/%5BboardId%5D/canvas/index.tsx): `app/board/[boardId]/canvas/index.tsx`
- [Canvas state](https://github.com/unamic0/miro-clone/blob/main/app/board/%5BboardId%5D/CanvasContext.tsx): `app/board/[boardId]/CanvasContext.tsx`
- [Drawing toolbar](https://github.com/unamic0/miro-clone/blob/main/app/board/%5BboardId%5D/_components/Toolbar/index.tsx): `app/board/[boardId]/_components/Toolbar/index.tsx`
- [Shape layers](https://github.com/unamic0/miro-clone/blob/main/app/board/%5BboardId%5D/_components/CanvasLayer.tsx): `app/board/[boardId]/_components/CanvasLayer.tsx`
- [Shape selection](https://github.com/unamic0/miro-clone/blob/main/app/board/%5BboardId%5D/_components/OwnSelected/index.tsx): `app/board/[boardId]/_components/OwnSelected/index.tsx`
- [Canvas model](https://github.com/unamic0/miro-clone/blob/main/types/canvas.ts): `types/canvas.ts`

### Live collaboration

- **Liveblocks**
- [Cursors and presence](https://github.com/unamic0/miro-clone/blob/main/app/board/%5BboardId%5D/_components/CursorsPresence.tsx): `app/board/[boardId]/_components/CursorsPresence.tsx`
- [Room authorization](https://github.com/unamic0/miro-clone/blob/main/app/api/liveblocks-auth/route.ts): `app/api/liveblocks-auth/route.ts`

### Backend and state

- [Convex functions](https://github.com/unamic0/miro-clone/blob/main/convex/board.ts): `convex/board.ts`
- [Board functions](https://github.com/unamic0/miro-clone/blob/main/convex/boards.ts): `convex/boards.ts`
- [Data schema](https://github.com/unamic0/miro-clone/blob/main/convex/schema.ts): `convex/schema.ts`
- **Convex database**
- [Mutation hook](https://github.com/unamic0/miro-clone/blob/main/hooks/useApiMutation.ts): `hooks/useApiMutation.ts`

### Other components

- **Board user**

## Connections

- Board user → Sign-in pages: signs in
- Sign-in pages → Clerk: authenticates with
- Board user → Dashboard: opens boards
- Dashboard → Board list: renders (evidence: `app/(dashboard)/page.tsx`)
- Board list → Board functions: loads boards
- Board list → Board actions: offers actions
- Board actions → Mutation hook: deletes board (evidence: `components/Actions/index.tsx`)
- Board actions → Rename board: opens rename (evidence: `components/Actions/index.tsx`)
- Rename board → Mutation hook: submits rename (evidence: `components/Actions/RenameModal.tsx`)
- Mutation hook → Convex functions: calls mutations
- Board user → Board workspace page: opens board
- Board workspace page → Interactive canvas: shows canvas
- Interactive canvas → Shape layers: renders layers (evidence: `app/board/[boardId]/canvas/index.tsx`)
- Interactive canvas → Cursors and presence: renders cursors (evidence: `app/board/[boardId]/canvas/index.tsx`)
- Interactive canvas → Canvas state: reads state (evidence: `app/board/[boardId]/canvas/index.tsx`)
- Interactive canvas → Shape selection: renders selection (evidence: `app/board/[boardId]/canvas/index.tsx`)
- Interactive canvas → Drawing toolbar: uses tools
- Drawing toolbar → Canvas state: updates state (evidence: `app/board/[boardId]/_components/Toolbar/index.tsx`)
- Shape layers → Canvas model: uses layer model (evidence: `app/board/[boardId]/_components/CanvasLayer.tsx`)
- Canvas state → Canvas model: uses canvas state (evidence: `app/board/[boardId]/CanvasContext.tsx`)
- Shape selection → Canvas state: reads state (evidence: `app/board/[boardId]/_components/OwnSelected/index.tsx`)
- Shape selection → Canvas model: uses layer model (evidence: `app/board/[boardId]/_components/OwnSelected/index.tsx`)
- Cursors and presence → Liveblocks: syncs presence
- Board user → Room authorization: requests room access
- Room authorization → Clerk: checks identity (evidence: `app/api/liveblocks-auth/route.ts`)
- Room authorization → Convex functions: checks board access (evidence: `app/api/liveblocks-auth/route.ts`)
- Room authorization → Liveblocks: authorizes room (evidence: `app/api/liveblocks-auth/route.ts`)
- Convex functions → Convex database: reads and writes
- Board functions → Convex database: reads and writes
- Data schema → Convex database: defines data
- Authenticated client → Clerk: uses authentication (evidence: `providers/convex-client-provider.tsx`)
