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.
| 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 |
| Component | Tech |
|---|---|
| Runtime | Node.js 20 |
| Language | TypeScript |
| Database | PostgreSQL 16 |
| ORM | Prisma |
| Deployment | Docker & Docker Compose |
Commands are grouped by category and discoverable via /help inside the chat.
- If ANSI looks broken in some terminals, use
/ansi off. - For Windows clients, prefer a UTF-8 capable terminal client.
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
git clone https://github.com/cresterienvogel/node-termchat.git
cd node-termchatcp .env.example .envdocker compose up --buildTo verify the mapped port:
docker compose port termchat 5000To connect:
nc 127.0.0.1 55000