Skip to content

cresterienvogel/node-termchat

Repository files navigation

TermChat


📌 Overview

TermChat is a TCP terminal chat server with accounts, roles, rooms, moderation, and private messages.
Built with TypeScript + Prisma, designed for simple local or Docker-first deployment.

Preview


✨ Features

Feature Description
Account system User registration and login with role-based access (USER / MOD / ADMIN)
Roles & permissions Fine-grained RBAC for moderation and administration
Rooms Joinable chat rooms with live presence and online user lists
Moderation tools Slow mode, mute, ban, and role management commands
Private messages Direct messages with persistent inbox and live delivery
ANSI preferences Per-user ANSI color support (on/off), persisted in database
Rate limiting Message rate limits configurable via environment variables
Message limits Maximum message length enforced (env-configurable)
Message timestamps Timestamps included in chat and inbox messages
Terminal UX ANSI-colored output with safe control character handling
Persistence layer PostgreSQL with Prisma ORM and schema migrations
Docker-first Fully containerized setup with Docker Compose

🧰 Tech Stack

Component Tech
Runtime Node.js 20
Language TypeScript
Database PostgreSQL 16
ORM Prisma
Deployment Docker & Docker Compose

⚙️ Commands

Commands are grouped by category and discoverable via /help inside the chat.


🗒️ Notes

  • If ANSI looks broken in some terminals, use /ansi off.
  • For Windows clients, prefer a UTF-8 capable terminal client.

🔐 Security Notes

This project uses raw TCP and does not provide transport-level encryption. For real-world usage, it should be deployed behind:

  • an SSH tunnel
  • a TLS proxy (e.g. Caddy / Nginx stream)
  • or a private network/VPN

🚀 Quick Start

1. Clone repository

git clone https://github.com/cresterienvogel/node-termchat.git
cd node-termchat

2. Create .env

cp .env.example .env

3. Run with Docker

docker compose up --build

🔌 Connection

To verify the mapped port:

docker compose port termchat 5000

To connect:

nc 127.0.0.1 55000

About

TCP terminal chat server with rooms, roles, and moderation

Topics

Resources

License

Stars

Watchers

Forks

Contributors