# arsenehuot/openhive architecture

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

- Interactive diagram: https://gitdiagram.com/arsenehuot/openhive
- Repository: https://github.com/arsenehuot/openhive

## Overview

OpenHive is a self-hosted team messaging app. Users enter through authentication and a workspace, then browse channels or direct messages, compose and organize conversations, and receive activity and presence updates. Distinct capabilities include channel/workspace administration, invitations, file sharing, scheduled messages, search, and LiveKit calls; webhook and bot configuration extend the workspace. The app store coordinates client state, while Supabase provides auth, database, realtime, and storage services. README-described features whose implementation was not sampled are represented at their documented directory paths; edges show only documented or sampled wiring.

Main entry points: [`src/lib/supabase/client.ts`](https://github.com/arsenehuot/openhive/blob/main/src/lib/supabase/client.ts) (Supabase client), [`src/components/chat/channel-view.tsx`](https://github.com/arsenehuot/openhive/blob/main/src/components/chat/channel-view.tsx) (Channel conversations), [`src/components/chat/message-input.tsx`](https://github.com/arsenehuot/openhive/blob/main/src/components/chat/message-input.tsx) (Compose messages), [`src/app/workspace/page.tsx`](https://github.com/arsenehuot/openhive/blob/main/src/app/workspace/page.tsx) (Workspace app)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_messaging["Messaging"]
  node_channel_view["Channel conversations<br/>[channel-view.tsx]"]
  node_message_input["Compose messages<br/>[message-input.tsx]"]
  node_threads["Threaded replies<br/>[thread-panel.tsx]"]
  node_saved_items["Saved messages"]
  node_activity["Activity feed<br/>[activity-panel.tsx]"]
  node_search["Search<br/>[search-dialog.tsx]"]
  node_scheduled["Scheduled messages"]
  node_upload["File uploads<br/>[route.ts]"]
end

subgraph group_workspace["Workspace"]
  node_auth["Authentication<br/>[page.tsx]"]
  node_workspace_app["Workspace app<br/>[page.tsx]"]
  node_sidebar["Navigation<br/>[sidebar.tsx]"]
  node_workspace_setup["Workspace setup"]
  node_workspace_settings["Workspace settings"]
  node_invite["Invitations<br/>[route.ts]"]
  node_invite_complete["Join workspace<br/>[route.ts]"]
  node_email["Email delivery"]
end

subgraph group_calls["Calls"]
  node_calls_ui["Call controls<br/>[call-panel.tsx]"]
  node_call_token["Call token API<br/>[route.ts]"]
  node_livekit["LiveKit"]
end

subgraph group_services["Platform services"]
  node_webhooks_ui["Webhook settings"]
  node_incoming_webhook["Incoming webhook<br/>[route.ts]"]
  node_app_store["Client state<br/>[app-store.ts]"]
  node_supabase_client["Supabase client<br/>[client.ts]"]
  node_supabase[("Supabase services")]
end

node_user(("Team member"))

node_user -->|"signs in"| node_auth
node_user -->|"opens workspace"| node_workspace_app
node_auth -->|"authenticates"| node_supabase_client
node_workspace_app -->|"renders navigation"| node_sidebar
node_workspace_app -->|"reads state"| node_app_store
node_sidebar -->|"opens conversation"| node_channel_view
node_channel_view -->|"composes in"| node_message_input
node_channel_view -->|"opens replies"| node_threads
node_message_input -->|"sends messages"| node_supabase_client
node_channel_view -->|"loads conversations"| node_supabase_client
node_threads -->|"loads replies"| node_supabase_client
node_saved_items -->|"loads saved items"| node_supabase_client
node_activity -->|"loads activity"| node_supabase_client
node_search -->|"searches messages"| node_supabase_client
node_scheduled -->|"manages schedules"| node_supabase_client
node_message_input -->|"uploads attachments"| node_upload
node_upload -->|"stores files"| node_supabase
node_workspace_setup -->|"creates workspace"| node_supabase_client
node_workspace_settings -->|"updates settings"| node_supabase_client
node_workspace_settings -->|"configures webhooks"| node_webhooks_ui
node_webhooks_ui -->|"manages webhooks"| node_supabase_client
node_user -->|"posts payload"| node_incoming_webhook
node_incoming_webhook -->|"reads webhook and writes message"| node_supabase
node_user -->|"invites member"| node_invite
node_invite -->|"verifies and adds member"| node_supabase
node_invite -->|"sends invitation"| node_email
node_user -->|"completes invitation"| node_invite_complete
node_invite_complete -->|"updates account and membership"| node_supabase
node_calls_ui -->|"requests token"| node_call_token
node_call_token -->|"verifies and reads settings"| node_supabase
node_call_token -->|"issues room token"| node_livekit
node_calls_ui -->|"joins call"| node_livekit
node_supabase_client -->|"uses auth, data, realtime"| node_supabase

click node_auth "https://github.com/arsenehuot/openhive/blob/main/src/app/auth/page.tsx"
click node_workspace_app "https://github.com/arsenehuot/openhive/blob/main/src/app/workspace/page.tsx"
click node_sidebar "https://github.com/arsenehuot/openhive/blob/main/src/components/sidebar/sidebar.tsx"
click node_workspace_setup "https://github.com/arsenehuot/openhive/blob/main/src/components/workspace/workspace-setup.tsx"
click node_workspace_settings "https://github.com/arsenehuot/openhive/blob/main/src/components/workspace/workspace-settings-dialog.tsx"
click node_invite "https://github.com/arsenehuot/openhive/blob/main/src/app/api/invite/route.ts"
click node_invite_complete "https://github.com/arsenehuot/openhive/blob/main/src/app/api/invite/complete/route.ts"
click node_channel_view "https://github.com/arsenehuot/openhive/blob/main/src/components/chat/channel-view.tsx"
click node_message_input "https://github.com/arsenehuot/openhive/blob/main/src/components/chat/message-input.tsx"
click node_threads "https://github.com/arsenehuot/openhive/blob/main/src/components/chat/thread-panel.tsx"
click node_saved_items "https://github.com/arsenehuot/openhive/blob/main/src/components/bookmarks/saved-items-panel.tsx"
click node_activity "https://github.com/arsenehuot/openhive/blob/main/src/components/activity/activity-panel.tsx"
click node_search "https://github.com/arsenehuot/openhive/blob/main/src/components/search/search-dialog.tsx"
click node_scheduled "https://github.com/arsenehuot/openhive/blob/main/src/hooks/use-scheduled-messages.ts"
click node_upload "https://github.com/arsenehuot/openhive/blob/main/src/app/api/upload/route.ts"
click node_calls_ui "https://github.com/arsenehuot/openhive/blob/main/src/components/calls/call-panel.tsx"
click node_call_token "https://github.com/arsenehuot/openhive/blob/main/src/app/api/livekit/token/route.ts"
click node_webhooks_ui "https://github.com/arsenehuot/openhive/blob/main/src/components/workspace/webhook-settings.tsx"
click node_incoming_webhook "https://github.com/arsenehuot/openhive/blob/main/src/app/api/webhook/%5Bid%5D/route.ts"
click node_app_store "https://github.com/arsenehuot/openhive/blob/main/src/lib/store/app-store.ts"
click node_supabase_client "https://github.com/arsenehuot/openhive/blob/main/src/lib/supabase/client.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_channel_view,node_message_input,node_threads,node_saved_items,node_activity,node_search,node_scheduled,node_upload toneBlue
class node_auth,node_workspace_app,node_sidebar,node_workspace_setup,node_workspace_settings,node_invite,node_invite_complete,node_email toneAmber
class node_calls_ui,node_call_token,node_livekit toneMint
class node_webhooks_ui,node_incoming_webhook,node_app_store,node_supabase_client,node_supabase toneRose
class node_user toneIndigo
```

## Components

### Messaging

- [Channel conversations](https://github.com/arsenehuot/openhive/blob/main/src/components/chat/channel-view.tsx): `src/components/chat/channel-view.tsx`
- [Compose messages](https://github.com/arsenehuot/openhive/blob/main/src/components/chat/message-input.tsx): `src/components/chat/message-input.tsx`
- [Threaded replies](https://github.com/arsenehuot/openhive/blob/main/src/components/chat/thread-panel.tsx): `src/components/chat/thread-panel.tsx`
- [Saved messages](https://github.com/arsenehuot/openhive/blob/main/src/components/bookmarks/saved-items-panel.tsx): `src/components/bookmarks/saved-items-panel.tsx`
- [Activity feed](https://github.com/arsenehuot/openhive/blob/main/src/components/activity/activity-panel.tsx): `src/components/activity/activity-panel.tsx`
- [Search](https://github.com/arsenehuot/openhive/blob/main/src/components/search/search-dialog.tsx): `src/components/search/search-dialog.tsx`
- [Scheduled messages](https://github.com/arsenehuot/openhive/blob/main/src/hooks/use-scheduled-messages.ts): `src/hooks/use-scheduled-messages.ts`
- [File uploads](https://github.com/arsenehuot/openhive/blob/main/src/app/api/upload/route.ts): `src/app/api/upload/route.ts`

### Workspace

- [Authentication](https://github.com/arsenehuot/openhive/blob/main/src/app/auth/page.tsx): `src/app/auth/page.tsx`
- [Workspace app](https://github.com/arsenehuot/openhive/blob/main/src/app/workspace/page.tsx): `src/app/workspace/page.tsx`
- [Navigation](https://github.com/arsenehuot/openhive/blob/main/src/components/sidebar/sidebar.tsx): `src/components/sidebar/sidebar.tsx`
- [Workspace setup](https://github.com/arsenehuot/openhive/blob/main/src/components/workspace/workspace-setup.tsx): `src/components/workspace/workspace-setup.tsx`
- [Workspace settings](https://github.com/arsenehuot/openhive/blob/main/src/components/workspace/workspace-settings-dialog.tsx): `src/components/workspace/workspace-settings-dialog.tsx`
- [Invitations](https://github.com/arsenehuot/openhive/blob/main/src/app/api/invite/route.ts): `src/app/api/invite/route.ts`
- [Join workspace](https://github.com/arsenehuot/openhive/blob/main/src/app/api/invite/complete/route.ts): `src/app/api/invite/complete/route.ts`
- **Email delivery**

### Calls

- [Call controls](https://github.com/arsenehuot/openhive/blob/main/src/components/calls/call-panel.tsx): `src/components/calls/call-panel.tsx`
- [Call token API](https://github.com/arsenehuot/openhive/blob/main/src/app/api/livekit/token/route.ts): `src/app/api/livekit/token/route.ts`
- **LiveKit**

### Platform services

- [Webhook settings](https://github.com/arsenehuot/openhive/blob/main/src/components/workspace/webhook-settings.tsx): `src/components/workspace/webhook-settings.tsx`
- [Incoming webhook](https://github.com/arsenehuot/openhive/blob/main/src/app/api/webhook/%5Bid%5D/route.ts): `src/app/api/webhook/[id]/route.ts`
- [Client state](https://github.com/arsenehuot/openhive/blob/main/src/lib/store/app-store.ts): `src/lib/store/app-store.ts`
- [Supabase client](https://github.com/arsenehuot/openhive/blob/main/src/lib/supabase/client.ts): `src/lib/supabase/client.ts`
- **Supabase services**

### Other components

- **Team member**

## Connections

- Team member → Authentication: signs in
- Team member → Workspace app: opens workspace
- Authentication → Supabase client: authenticates
- Workspace app → Navigation: renders navigation
- Workspace app → Client state: reads state
- Navigation → Channel conversations: opens conversation
- Channel conversations → Compose messages: composes in
- Channel conversations → Threaded replies: opens replies
- Compose messages → Supabase client: sends messages
- Channel conversations → Supabase client: loads conversations
- Threaded replies → Supabase client: loads replies
- Saved messages → Supabase client: loads saved items
- Activity feed → Supabase client: loads activity
- Search → Supabase client: searches messages
- Scheduled messages → Supabase client: manages schedules
- Compose messages → File uploads: uploads attachments
- File uploads → Supabase services: stores files
- Workspace setup → Supabase client: creates workspace
- Workspace settings → Supabase client: updates settings
- Workspace settings → Webhook settings: configures webhooks
- Webhook settings → Supabase client: manages webhooks
- Team member → Incoming webhook: posts payload
- Incoming webhook → Supabase services: reads webhook and writes message
- Team member → Invitations: invites member
- Invitations → Supabase services: verifies and adds member
- Invitations → Email delivery: sends invitation
- Team member → Join workspace: completes invitation
- Join workspace → Supabase services: updates account and membership
- Call controls → Call token API: requests token
- Call token API → Supabase services: verifies and reads settings
- Call token API → LiveKit: issues room token
- Call controls → LiveKit: joins call
- Supabase client → Supabase services: uses auth, data, realtime
