The Problem

Most chat tools route through a provider you don't control. This repo solves that with a self-hosted chat system—server you run yourself, client that works from a browser tab—where even the hosting admin can't read messages unless they belong to them. The README positions it as a Teamspeak/Mumble-style tool with end-to-end encryption layered on top of TLS.

What This Does

A lightweight C server in server-source-code/ plus a single-file HTML client, client/client.html, that runs by double-clicking or embeds into a website. WebSocket carries text and images; WebRTC data channels carry audio, client→server only, so clients don't leak IP addresses. A small Android client lives in client/android/ with Java activity classes (MainActivity.java, BackgroundService.java) wrapping the same HTML in a WebView.

The repo is 4,347 files but almost all of that is vendored dependencies—libdatachannel, mbedtls-3.5.1, libtom, nlohmann/json—not application code. The actual product logic is a small fraction of the tree.

How It Is Wired

The measured import graph resolved only 25 internal modules with 4 edges, all of them mbedtls test scripts. The actual server's call graph has not been mapped by this analysis—the listed entry points are all nlohmann/json test mains, which are irrelevant to the product. The wiring description comes from the README, not traced code: the client opens a WebSocket to IP:port for text/images, WebRTC data channels for audio, with the server's own encryption applied on top of TLS. Until the C server code is traced, the control flow between client.html and the server handlers remains unmapped.

How To Use It

git clone https://github.com/moses-y/lemon-chat
# build the server:
#   Windows: run windows_build_script.bat
#   Linux:   run linux_build_script.sh
# or use a prebuilt release
# then open client.html in a browser and enter the server IP and port

All server dependencies are vendored; no extra C/C++ libraries to download. The README documents embedding via stunnel + apache2 + certbot with a concrete /etc/stunnel.conf example. A 71.5MB walkthrough video, how-to-build-and-use-video.mkv, is committed in the repo root.

Real-World Use

A small VPS (1 CPU, 500MB RAM) acts as a public relay: run the server locally, expose it via SSH port forwarding, or front it with stunnel for WSS. The README's scenario is a team chat on a domain like justsometestchat.com where users reach client.html over HTTPS and the server is reachable from both desktop and website.

Code Health & Issues

Static analysis found 404 findings (183 high, 220 medium), one kind: deep nesting, with max indentation depth 10 in files like server-source-code/mbedtls-3.5.1/library/ssl_tls13_invasive.h and server-source-code/libtom/libtommath/bn_mp_shrink.c. Most of that lands in vendored code, not the app itself.

  • Critical – Committed private key: server-source-code/libdatachannel/test/uwp/benchmark/Windows_TemporaryKey.pfx. Rotate and purge from history; deletion in a later commit is not enough.
  • High – No LICENSE at repo root; redistribution rights are undefined.
  • High – No build gate for the Docker artifacts in server-source-code/mbedtls-3.5.1/tests/docker/bionic/Dockerfile.
  • Medium – No Dependabot/Renovate despite 8 manifests.
  • Medium – No pre-commit secret gate; the key leak is the symptom.
  • Medium – Large binaries committed: how-to-build-and-use-video.mkv (71.5MB), dbip-country-lite-2025-06.mmdb (7.1MB). Use LFS or object storage.
  • Low – Missing .editorconfig, .gitattributes, formatter config.

The Bottom Line

The product itself is a functional, genuinely self-hosted E2E-encrypted chat with a clever single-file client. The repo hygiene is the problem: a committed private key that must be rotated, no license, and a tree dominated by vendored dependencies that makes review and maintenance heavy. Fine for personal use as-is; needs a cleanup pass before it's suitable for client work.