You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: ARCHITECTURE.md
+43-10Lines changed: 43 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -28,9 +28,16 @@ Marchat is a self-hosted, terminal-based chat application built in Go with a cli
28
28
29
29
## Component Architecture
30
30
31
-
### Client Application (`client/main.go`)
31
+
### Client Application (`client/`)
32
32
33
-
The client is a standalone terminal user interface built with the Bubble Tea framework. It's a complete application that can be built and run independently.
33
+
The client is a standalone terminal user interface built with the Bubble Tea framework. It's a complete application that can be built and run independently. The code is split across several files:
34
+
35
+
-**`main.go`**: Core model, state, Update loop, and command handlers
36
+
-**`hotkeys.go`**: Key binding definitions and methods
37
+
-**`render.go`**: Message rendering and UI display logic
38
+
-**`websocket.go`**: WebSocket connection management, send/receive, and E2E encryption helpers
39
+
-**`commands.go`**: Help text generation and command-related utilities
40
+
-**`notification_manager.go`**: Desktop/bell notification system
34
41
35
42
#### Core Models
36
43
@@ -45,21 +52,31 @@ The client is a standalone terminal user interface built with the Bubble Tea fra
45
52
#### Key Features
46
53
47
54
- Real-time chat with message history and user list
48
-
- File sharing with configurable size limits (default 1MB)
55
+
- Message editing, deletion, pinning, and reactions
56
+
- Direct messages between users
57
+
- Channel-based messaging (join/leave channels)
58
+
- Typing indicators (throttled, with timeout)
59
+
- Message search (server-side)
60
+
- Chat history export to file
61
+
- File sharing with configurable size limits (default 1MB), with optional E2E encryption
49
62
- Theme system supporting built-in and custom themes
50
63
- Administrative commands for user management
51
-
- End-to-end encryption with global key support
64
+
- End-to-end encryption with global key support (text and file transfers)
52
65
- Code snippet rendering with syntax highlighting
53
66
- Clipboard integration for text operations
54
67
- URL detection and external opening
68
+
- Tab completion for @mentions
69
+
- Connection status indicator
70
+
- Unread message count
71
+
- Multi-line input via Alt+Enter / Ctrl+J
55
72
56
73
### Server Application (`cmd/server/main.go`)
57
74
58
75
The server is a standalone HTTP/WebSocket server application that provides real-time communication with plugin support and administrative interfaces.
59
76
60
77
#### Core Structures
61
78
62
-
-**`Hub`**: Central message routing system managing client connections, message broadcasting, and user state
79
+
-**`Hub`**: Central message routing system managing client connections, message broadcasting, channel management, and user state
63
80
-**`Client`**: Individual WebSocket connection handler with read/write pumps and command processing
64
81
-**`AdminPanel`**: Terminal-based administrative interface for server management
65
82
-**`WebAdminServer`**: Web-based administrative interface with session authentication
@@ -68,13 +85,19 @@ The server is a standalone HTTP/WebSocket server application that provides real-
68
85
69
86
#### Key Features
70
87
71
-
- Real-time message broadcasting to connected clients
88
+
- Real-time message broadcasting to connected clients (channel-aware)
0 commit comments