# jasonkenwayfj/luma architecture

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

- Interactive diagram: https://gitdiagram.com/jasonkenwayfj/luma
- Repository: https://github.com/jasonkenwayfj/luma

## Overview

Luma is a desktop messaging client with a Rust server. The main workflow is account login, chat selection or direct-contact discovery, then sending and viewing messages with attachments and history. The desktop UI invokes Tauri commands and listens for events; the server is the backend endpoint. The server and Tauri Rust sources are listed as read, but their excerpts and internal relationships are unavailable, so those links are left unverified rather than inferred.

Main entry points: [`luma-desktop/src/App.tsx`](https://github.com/jasonkenwayfj/luma/blob/master/luma-desktop/src/App.tsx) (App orchestration), [`luma-desktop/src-tauri/src/lib.rs`](https://github.com/jasonkenwayfj/luma/blob/master/luma-desktop/src-tauri/src/lib.rs) (Tauri command layer), [`luma-desktop/src/components/ChatView.tsx`](https://github.com/jasonkenwayfj/luma/blob/master/luma-desktop/src/components/ChatView.tsx) (Conversation view), [`luma-desktop/src/hooks/useChat.ts`](https://github.com/jasonkenwayfj/luma/blob/master/luma-desktop/src/hooks/useChat.ts) (Chat state and transport)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["Desktop experience"]
  node_app["App orchestration<br/>[App.tsx]"]
  node_chatlist["Chat discovery<br/>[ChatList.tsx]"]
  node_chatview["Conversation view<br/>[ChatView.tsx]"]
  node_connection["Connection indicator"]
end

subgraph group_identity["Identity and contacts"]
  node_authscreen["Login and registration<br/>[AuthScreen.tsx]"]
  node_profile[("Profile storage<br/>[auth.ts]")]
  node_contacts[("Direct contacts<br/>[contacts.ts]")]
end

subgraph group_messaging["Messaging runtime"]
  node_composer["Message composer<br/>[Composer.tsx]"]
  node_message["Message renderer<br/>[Message.tsx]"]
  node_chatstate["Chat state and transport<br/>[useChat.ts]"]
  node_chatdata["Chat definitions<br/>[chats.ts]"]
end

subgraph group_platform["Native and server"]
  node_tauri["Tauri command layer<br/>[lib.rs]"]
  node_server["Messaging server<br/>[main.rs]"]
  node_notification["Push notifications<br/>[App.tsx]"]
end

node_user(("User"))

node_user -->|"signs in"| node_authscreen
node_authscreen -->|"invokes auth"| node_tauri
node_authscreen -->|"returns profile"| node_app
node_app -->|"loads and saves"| node_profile
node_app -->|"uses chat state"| node_chatstate
node_app -->|"combines chats"| node_chatdata
node_app -->|"loads contacts"| node_contacts
node_app -->|"renders list"| node_chatlist
node_app -->|"renders conversation"| node_chatview
node_chatlist -->|"searches users"| node_tauri
node_chatlist -->|"renders status"| node_connection
node_chatview -->|"renders messages"| node_message
node_chatview -->|"renders composer"| node_composer
node_chatview -->|"renders status"| node_connection
node_composer -->|"submits message"| node_chatstate
node_app -->|"joins rooms"| node_chatstate
node_chatstate -->|"invokes commands"| node_tauri
node_app -->|"registers push token"| node_tauri
node_tauri -.->|"exchanges messages"| node_server
node_app -->|"handles push events"| node_notification

click node_app "https://github.com/jasonkenwayfj/luma/blob/master/luma-desktop/src/App.tsx"
click node_authscreen "https://github.com/jasonkenwayfj/luma/blob/master/luma-desktop/src/components/AuthScreen.tsx"
click node_profile "https://github.com/jasonkenwayfj/luma/blob/master/luma-desktop/src/auth.ts"
click node_contacts "https://github.com/jasonkenwayfj/luma/blob/master/luma-desktop/src/contacts.ts"
click node_chatlist "https://github.com/jasonkenwayfj/luma/blob/master/luma-desktop/src/components/ChatList.tsx"
click node_chatview "https://github.com/jasonkenwayfj/luma/blob/master/luma-desktop/src/components/ChatView.tsx"
click node_composer "https://github.com/jasonkenwayfj/luma/blob/master/luma-desktop/src/components/Composer.tsx"
click node_message "https://github.com/jasonkenwayfj/luma/blob/master/luma-desktop/src/components/Message.tsx"
click node_connection "https://github.com/jasonkenwayfj/luma/blob/master/luma-desktop/src/components/ConnectionStatus.tsx"
click node_chatstate "https://github.com/jasonkenwayfj/luma/blob/master/luma-desktop/src/hooks/useChat.ts"
click node_chatdata "https://github.com/jasonkenwayfj/luma/blob/master/luma-desktop/src/chats.ts"
click node_tauri "https://github.com/jasonkenwayfj/luma/blob/master/luma-desktop/src-tauri/src/lib.rs"
click node_server "https://github.com/jasonkenwayfj/luma/blob/master/luma-server/src/main.rs"
click node_notification "https://github.com/jasonkenwayfj/luma/blob/master/luma-desktop/src/App.tsx"

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_app,node_chatlist,node_chatview,node_connection,node_user toneBlue
class node_authscreen,node_profile,node_contacts toneAmber
class node_composer,node_message,node_chatstate,node_chatdata toneMint
class node_tauri,node_server,node_notification toneRose
```

## Components

### Desktop experience

- [App orchestration](https://github.com/jasonkenwayfj/luma/blob/master/luma-desktop/src/App.tsx): `luma-desktop/src/App.tsx`
- [Chat discovery](https://github.com/jasonkenwayfj/luma/blob/master/luma-desktop/src/components/ChatList.tsx): `luma-desktop/src/components/ChatList.tsx`
- [Conversation view](https://github.com/jasonkenwayfj/luma/blob/master/luma-desktop/src/components/ChatView.tsx): `luma-desktop/src/components/ChatView.tsx`
- [Connection indicator](https://github.com/jasonkenwayfj/luma/blob/master/luma-desktop/src/components/ConnectionStatus.tsx): `luma-desktop/src/components/ConnectionStatus.tsx`

### Identity and contacts

- [Login and registration](https://github.com/jasonkenwayfj/luma/blob/master/luma-desktop/src/components/AuthScreen.tsx): `luma-desktop/src/components/AuthScreen.tsx`
- [Profile storage](https://github.com/jasonkenwayfj/luma/blob/master/luma-desktop/src/auth.ts): `luma-desktop/src/auth.ts`
- [Direct contacts](https://github.com/jasonkenwayfj/luma/blob/master/luma-desktop/src/contacts.ts): `luma-desktop/src/contacts.ts`

### Messaging runtime

- [Message composer](https://github.com/jasonkenwayfj/luma/blob/master/luma-desktop/src/components/Composer.tsx): `luma-desktop/src/components/Composer.tsx`
- [Message renderer](https://github.com/jasonkenwayfj/luma/blob/master/luma-desktop/src/components/Message.tsx): `luma-desktop/src/components/Message.tsx`
- [Chat state and transport](https://github.com/jasonkenwayfj/luma/blob/master/luma-desktop/src/hooks/useChat.ts): `luma-desktop/src/hooks/useChat.ts`
- [Chat definitions](https://github.com/jasonkenwayfj/luma/blob/master/luma-desktop/src/chats.ts): `luma-desktop/src/chats.ts`

### Native and server

- [Tauri command layer](https://github.com/jasonkenwayfj/luma/blob/master/luma-desktop/src-tauri/src/lib.rs): `luma-desktop/src-tauri/src/lib.rs`
- [Messaging server](https://github.com/jasonkenwayfj/luma/blob/master/luma-server/src/main.rs): `luma-server/src/main.rs`
- [Push notifications](https://github.com/jasonkenwayfj/luma/blob/master/luma-desktop/src/App.tsx): `luma-desktop/src/App.tsx`

### Other components

- **User**

## Connections

- User → Login and registration: signs in (evidence: `luma-desktop/src/components/AuthScreen.tsx`)
- Login and registration → Tauri command layer: invokes auth (evidence: `luma-desktop/src/components/AuthScreen.tsx`)
- Login and registration → App orchestration: returns profile (evidence: `luma-desktop/src/App.tsx`)
- App orchestration → Profile storage: loads and saves (evidence: `luma-desktop/src/App.tsx`)
- App orchestration → Chat state and transport: uses chat state (evidence: `luma-desktop/src/App.tsx`)
- App orchestration → Chat definitions: combines chats (evidence: `luma-desktop/src/App.tsx`)
- App orchestration → Direct contacts: loads contacts (evidence: `luma-desktop/src/App.tsx`)
- App orchestration → Chat discovery: renders list (evidence: `luma-desktop/src/App.tsx`)
- App orchestration → Conversation view: renders conversation (evidence: `luma-desktop/src/App.tsx`)
- Chat discovery → Tauri command layer: searches users (evidence: `luma-desktop/src/components/ChatList.tsx`)
- Chat discovery → Connection indicator: renders status (evidence: `luma-desktop/src/components/ChatList.tsx`)
- Conversation view → Message renderer: renders messages (evidence: `luma-desktop/src/components/ChatView.tsx`)
- Conversation view → Message composer: renders composer (evidence: `luma-desktop/src/components/ChatView.tsx`)
- Conversation view → Connection indicator: renders status (evidence: `luma-desktop/src/components/ChatView.tsx`)
- Message composer → Chat state and transport: submits message
- App orchestration → Chat state and transport: joins rooms (evidence: `luma-desktop/src/App.tsx`)
- Chat state and transport → Tauri command layer: invokes commands (evidence: `luma-desktop/src/hooks/useChat.ts`)
- App orchestration → Tauri command layer: registers push token (evidence: `luma-desktop/src/App.tsx`)
- Tauri command layer → Messaging server: exchanges messages
- App orchestration → Push notifications: handles push events (evidence: `luma-desktop/src/App.tsx`)
