Skip to content

Commit e485eb7

Browse files
committed
feat: v0.10.0-beta.1 — message management, reactions, DMs, channels, typing indicators, plugin system wiring, client refactor, and documentation overhaul
1 parent 3f716fc commit e485eb7

46 files changed

Lines changed: 3868 additions & 1842 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/go.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ jobs:
1414
runs-on: ubuntu-latest
1515
steps:
1616
- name: Checkout code
17-
uses: actions/checkout@v4
17+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
1818

1919
- name: Set up Go
20-
uses: actions/setup-go@v5
20+
uses: actions/setup-go@7a3fe6cf4cb3a834922a1244abfce67bcef6a0c5 # v6.2.0
2121
with:
2222
go-version: '1.25.x'
2323

.github/workflows/release.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ on:
66
workflow_dispatch:
77
inputs:
88
version:
9-
description: 'Version to build (e.g., v0.9.0-beta.6)'
9+
description: 'Version to build (e.g., v0.10.0-beta.1)'
1010
required: true
11-
default: 'v0.9.0-beta.6'
11+
default: 'v0.10.0-beta.1'
1212

1313
permissions:
1414
contents: read
@@ -155,7 +155,7 @@ jobs:
155155
docker:
156156
name: Build and Push Docker Image
157157
runs-on: ubuntu-latest
158-
needs: [build, upload-assets]
158+
needs: [build]
159159
permissions:
160160
contents: write
161161
steps:

ARCHITECTURE.md

Lines changed: 43 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,16 @@ Marchat is a self-hosted, terminal-based chat application built in Go with a cli
2828

2929
## Component Architecture
3030

31-
### Client Application (`client/main.go`)
31+
### Client Application (`client/`)
3232

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
3441

3542
#### Core Models
3643

@@ -45,21 +52,31 @@ The client is a standalone terminal user interface built with the Bubble Tea fra
4552
#### Key Features
4653

4754
- 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
4962
- Theme system supporting built-in and custom themes
5063
- 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)
5265
- Code snippet rendering with syntax highlighting
5366
- Clipboard integration for text operations
5467
- 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
5572

5673
### Server Application (`cmd/server/main.go`)
5774

5875
The server is a standalone HTTP/WebSocket server application that provides real-time communication with plugin support and administrative interfaces.
5976

6077
#### Core Structures
6178

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
6380
- **`Client`**: Individual WebSocket connection handler with read/write pumps and command processing
6481
- **`AdminPanel`**: Terminal-based administrative interface for server management
6582
- **`WebAdminServer`**: Web-based administrative interface with session authentication
@@ -68,13 +85,19 @@ The server is a standalone HTTP/WebSocket server application that provides real-
6885

6986
#### Key Features
7087

71-
- Real-time message broadcasting to connected clients
88+
- Real-time message broadcasting to connected clients (channel-aware)
89+
- Channel management: clients join/leave channels, messages routed per-channel
90+
- Direct message routing between specific users
91+
- Message editing, deletion, pinning, and search
92+
- Typing indicator and read receipt broadcasting
93+
- Reaction broadcasting
7294
- User management including ban, kick, and allow operations
7395
- Plugin command execution and management
7496
- Database backup and maintenance operations
7597
- System metrics collection and health monitoring
7698
- Web-based admin panel with CSRF protection
7799
- Health check endpoints for monitoring systems
100+
- WebSocket message rate limiting
78101

79102
### Server Library (`server/`)
80103

@@ -94,7 +117,9 @@ Common types and utilities used across client and server components.
94117

95118
#### Core Types
96119

97-
- **`Message`**: Standard chat message structure with encryption support
120+
- **`Message`**: Standard chat message structure with encryption support, message IDs, recipient, channel, edited flag, and reaction metadata
121+
- **`MessageType`**: Type discriminator — `text`, `file`, `admin_command`, `edit`, `delete`, `typing`, `reaction`, `dm`, `search`, `pin`, `read_receipt`, `join_channel`, `leave_channel`, `list_channels`
122+
- **`ReactionMeta`**: Emoji, target message ID, and removal flag
98123
- **`EncryptedMessage`**: End-to-end encrypted message format
99124
- **`Handshake`**: WebSocket connection authentication structure
100125
- **`KeyPair`**: X25519 cryptographic identity for key exchange
@@ -109,6 +134,7 @@ The encryption system provides end-to-end security using modern cryptographic pr
109134
- **ChaCha20-Poly1305**: Authenticated encryption for message confidentiality and integrity
110135
- **Global E2E**: Server-wide encryption key for simplified key management
111136
- **Session Keys**: Derived keys for efficient message encryption
137+
- **File Transfer Encryption**: Raw byte encryption/decryption via `EncryptRaw`/`DecryptRaw` in the keystore
112138

113139
### Plugin System (`plugin/`)
114140

@@ -203,10 +229,13 @@ Client: WebSocket Receive → Decrypt → Display
203229
The WebSocket communication uses JSON messages with the following structure:
204230

205231
- **Handshake**: Initial authentication with username and admin credentials
206-
- **Messages**: Chat messages with optional encryption
232+
- **Messages**: Chat messages with optional encryption, message IDs, and channel/recipient metadata
233+
- **Extended Types**: Edit, delete, typing, reaction, DM, search, pin, read receipt, join/leave/list channels
207234
- **Commands**: Administrative and plugin commands
208235
- **System Messages**: Connection status and user list updates
209236

237+
See [PROTOCOL.md](PROTOCOL.md) for the full message format specification.
238+
210239
### Encryption Flow
211240

212241
1. **Key Generation**: Client generates X25519 keypair during initialization
@@ -230,7 +259,10 @@ CREATE TABLE messages (
230259
is_encrypted BOOLEAN DEFAULT 0,
231260
encrypted_data BLOB,
232261
nonce BLOB,
233-
recipient TEXT
262+
recipient TEXT,
263+
edited BOOLEAN DEFAULT 0,
264+
deleted BOOLEAN DEFAULT 0,
265+
pinned BOOLEAN DEFAULT 0
234266
);
235267
```
236268

@@ -315,7 +347,8 @@ The web-based interface provides the same functionality through a browser:
315347
### Concurrency
316348

317349
- **Goroutine-based**: Concurrent handling of WebSocket connections
318-
- **Channel Communication**: Non-blocking message passing between components
350+
- **Go Channel Communication**: Non-blocking message passing between components
351+
- **Chat Channels**: Server-side channel management with per-channel broadcast routing
319352
- **Connection Pooling**: Efficient database connection management
320353
- **Plugin Isolation**: Separate processes prevent plugin crashes from affecting server
321354

NOTIFICATIONS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ The marchat client now features a comprehensive notification system that goes be
1818
Messages are classified by priority:
1919
- **Info**: Regular chat messages
2020
- **Mention**: When someone @mentions you
21-
- **DM**: Direct messages (future support)
21+
- **DM**: Direct messages (use `:dm <user> <message>` or `:dm <user>` to toggle DM mode)
2222
- **Urgent**: System alerts and critical messages
2323

2424
### 3. Desktop Notifications

0 commit comments

Comments
 (0)