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
-**Database Settings**: SQLite file path and connection parameters
204
+
-**Database Settings**: `MARCHAT_DB_PATH` selects backend and connection details (SQLite path or Postgres/MySQL DSN)
205
205
-**Plugin Configuration**: Registry URL and installation directories
206
206
-**Security Settings**: Admin keys, encryption keys, and authentication
207
207
-**File Transfer**: Size limits and allowed file types
208
208
-**Logging**: Log levels and output destinations
209
209
210
210
### Diagnostics (`internal/doctor`)
211
211
212
-
Shared package invoked by **`marchat-client`** and **`marchat-server`** when passed **`-doctor`** (human-readable report) or **`-doctor-json`** (JSON on stdout). It summarizes Go/OS, resolved config directories, known `MARCHAT_*` variables with secrets masked, role-specific checks (client: profiles, clipboard, TTY; server: `.env`, validation, DB/TLS/sqlite ping), and optionally compares the embedded version to the latest GitHub release. Set **`MARCHAT_DOCTOR_NO_NETWORK=1`** to skip the release check (e.g. air-gapped environments).
212
+
Shared package invoked by **`marchat-client`** and **`marchat-server`** when passed **`-doctor`** (human-readable report) or **`-doctor-json`** (JSON on stdout). It summarizes Go/OS, resolved config directories, known `MARCHAT_*` variables with secrets masked, role-specific checks (client: profiles, clipboard, TTY; server: `.env`, validation, detected DB dialect, DB connection-string format validation, DB/TLS ping checks), and optionally compares the embedded version to the latest GitHub release. Set **`MARCHAT_DOCTOR_NO_NETWORK=1`** to skip the release check (e.g. air-gapped environments).
213
213
214
214
### Command Line Tools (`cmd/`)
215
215
@@ -235,11 +235,26 @@ Both **`marchat-client`** and **`marchat-server`** embed diagnostics via **`inte
Copy file name to clipboardExpand all lines: PROTOCOL.md
+5-4Lines changed: 5 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -158,9 +158,10 @@ Messages initiated by the server to update client state.
158
158
- On user connect/disconnect:
159
159
- Broadcasts updated user list.
160
160
- On message send:
161
-
- Persists eligible messages to SQLite.
161
+
- Persists eligible messages to the configured SQL backend selected by `MARCHAT_DB_PATH` (SQLite path, PostgreSQL DSN, or MySQL DSN).
162
162
- Delivers to all connected clients **or** only to members of a channel when `channel` is non-empty and `sender` is not `System` (see [Channels](#channels)). Direct messages use a separate path (sender and recipient only).
163
-
- Messages are saved to SQLite and capped at 1000 messages.
163
+
- Reactions, read receipts, and last channel per user may be persisted server-side and replayed to reconnecting clients.
164
+
- Message history is capped at 1000 messages.
164
165
165
166
---
166
167
@@ -186,7 +187,7 @@ Exceeded messages are dropped silently from the client’s perspective (the serv
186
187
187
188
## Message Retention
188
189
189
-
- Messages are stored in SQLite.
190
+
- Messages are stored in the backend configured by `MARCHAT_DB_PATH` (SQLite/PostgreSQL/MySQL).
190
191
- The most recent 1000 messages are retained.
191
192
- Older messages are deleted automatically.
192
193
@@ -206,7 +207,7 @@ If `admin` is not requested, `admin_key` is not required.
206
207
207
208
## Configuration
208
209
209
-
Client settings are usually stored in **`config.json`** under the **client configuration directory** (per-user application data, or `MARCHAT_CONFIG_DIR`). That directory is separate from the **server** directory (`.env`, SQLite DB). Use **`marchat-client -doctor`** / **`marchat-server -doctor`** to print resolved paths.
210
+
Client settings are usually stored in **`config.json`** under the **client configuration directory** (per-user application data, or `MARCHAT_CONFIG_DIR`). That directory is separate from the **server** directory (`.env` plus local DB file when SQLite is used). Use **`marchat-client -doctor`** / **`marchat-server -doctor`** to print resolved paths.
Copy file name to clipboardExpand all lines: README.md
+29-4Lines changed: 29 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -54,7 +54,7 @@ Full changelog on [GitHub releases](https://github.com/Cod-e-Codes/marchat/relea
54
54
## Features
55
55
56
56
-**Terminal UI** - Beautiful TUI built with Bubble Tea
57
-
-**Real-time Chat** - Fast WebSocket messaging with SQLite backend (PostgreSQL/MySQL planned)
57
+
-**Real-time Chat** - Fast WebSocket messaging with SQLite, PostgreSQL, or MySQL backends
58
58
-**Message Management** - Edit, delete, pin, react to, and search messages
59
59
-**Direct Messages** - Private DM conversations between users
60
60
-**Channels** - Multiple chat rooms with join/leave and per-channel messaging
@@ -75,7 +75,7 @@ Full changelog on [GitHub releases](https://github.com/Cod-e-Codes/marchat/relea
75
75
76
76
## Overview
77
77
78
-
marchat started as a fun weekend project for father-son coding sessions and has evolved into a lightweight, self-hosted terminal chat application designed specifically for developers who love the command line. Currently runs with SQLite, with PostgreSQL and MySQL support planned for greater scalability.
78
+
marchat started as a fun weekend project for father-son coding sessions and has evolved into a lightweight, self-hosted terminal chat application designed specifically for developers who love the command line. It supports SQLite by default and can also run against PostgreSQL or MySQL for larger deployments.
79
79
80
80
**Key Benefits:**
81
81
-**Self-hosted**: No external services required
@@ -205,7 +205,7 @@ go build -o marchat-client ./client
- PostgreSQL requires a reachable database and credentials with schema/table create permissions.
235
+
- MySQL DSNs should include `parseTime=true` so timestamp fields decode correctly.
236
+
- **MariaDB** generally works with the same `mysql:` DSN shape and `parseTime=true` as MySQL.
237
+
- The server creates **dialect-specific DDL** (for example, MySQL/MariaDB use fixed-width strings where indexes, primary keys, or unique constraints apply, because full `TEXT` keys are rejected). Long message bodies still use a large text type.
238
+
- SQLite remains the easiest local development option.
239
+
218
240
**Doctor / diagnostics:** Set `MARCHAT_DOCTOR_NO_NETWORK` to `1` to skip the GitHub latest-release check in `-doctor` / `-doctor-json`.
219
241
220
242
**File Size Configuration:** Use either `MARCHAT_MAX_FILE_BYTES` (exact bytes) or `MARCHAT_MAX_FILE_MB` (megabytes). If both are set, `MARCHAT_MAX_FILE_BYTES` takes priority.
@@ -248,7 +270,7 @@ The repository’s `config/` directory holds **server** runtime files and the **
248
270
249
271
### Diagnostics (`-doctor`)
250
272
251
-
Run **`./marchat-client -doctor`** or **`./marchat-server -doctor`** for a text report (paths, masked `MARCHAT_*` env, sanity checks). Use **`-doctor-json`** for machine-readable output. If both flags were passed, `-doctor-json` wins. Exits without starting the TUI or listening on a port. See [ARCHITECTURE.md](ARCHITECTURE.md) for details.
273
+
Run **`./marchat-client -doctor`** or **`./marchat-server -doctor`** for a text report (paths, masked `MARCHAT_*` env, sanity checks). Server doctor also reports the detected DB dialect, validates the configured DB connection string format, and attempts a DB ping. Use **`-doctor-json`** for machine-readable output. If both flags were passed, `-doctor-json` wins. Exits without starting the TUI or listening on a port. See [ARCHITECTURE.md](ARCHITECTURE.md) for details.
252
274
253
275
## Admin Commands
254
276
@@ -681,6 +703,9 @@ Profiles stored in platform-appropriate locations:
0 commit comments