This commit is contained in:
2026-03-06 22:38:23 -05:00

115
README.md
View File

@@ -7,77 +7,70 @@ A modern, self-hosted team messaging Progressive Web App (PWA) built for small t
## Features ## Features
### Messaging - 🔐 **Authentication** — Login, remember me, forced password change on first login
- **Real-time messaging** — WebSocket-powered (Socket.io); messages appear instantly across all clients - 💬 **Real-time messaging** — WebSocket (Socket.io) powered chat
- **Image attachments** — Attach and send images; auto-compressed client-side before upload - 👥 **Public channels** — Admin-created, all users auto-joined
- **Message replies** — Quote and reply to any message with an inline preview - 🔒 **Private groups**User-created, owner-managed
- **Emoji reactions** — Quick-react with common emojis or open the full emoji picker; one reaction per user, replaceable - 📷 **Image uploads**Attach images to messages
- **@Mentions** — Type `@` to search and tag users with autocomplete; mentioned users receive a notification - 💬 **Message quoting**Reply to any message with preview
- **Link previews** — URLs are automatically expanded with Open Graph metadata (title, image, site name) - 😎 **Emoji reactions**Quick reactions + full emoji picker
- **Typing indicators** — See when others are composing a message - @**Mentions** — @mention users with autocomplete, they get notified
- **Image lightbox** — Tap any image to open it full-screen with pinch-to-zoom support - 🔗 **Link previews**Auto-fetches OG metadata for URLs
- 📱 **PWA** — Install to home screen, works offline
### Channels & Groups - 👤 **Profiles** — Custom avatars, display names, about me
- **Public channels** — Admin-created; all users are automatically added - ⚙️ **Admin settings** — Custom logo, app name
- **Private groups / DMs** — Any user can create; membership is invite-only by the owner - 👨‍💼 **User management**Create, suspend, delete, bulk CSV import
- **Read-only channels** — Admin-configurable announcement-style channels; only admins can post - 📢 **Read-only channels** — Announcement-style public channels
- **Support group** — A private admin-only group that receives submissions from the login page contact form
### Users & Profiles
- **Authentication** — Email/password login with optional Remember Me (30-day session)
- **Forced password change** — New users must change their password on first login
- **User profiles** — Custom display name, avatar upload, About Me text
- **Profile popup** — Click any user's avatar in chat to view their profile card
- **Admin badge** — Admins display a role badge; can be hidden per-user in Profile settings
### Notifications
- **In-app notifications** — Mention alerts with toast notifications
- **Unread indicators** — Private groups with new unread messages are highlighted and bolded in the sidebar
- **Web Push notifications** — Badge and push notifications for mentions and new private messages when the app is backgrounded or closed (requires HTTPS)
### Admin & Settings
- **User Manager** — Create, suspend, activate, delete users; reset passwords; change roles
- **Bulk CSV import** — Import multiple users at once from a CSV file
- **App branding** — Customize app name, logo, New Chat icon, and Group Info icon via the Settings panel
- **Reset to defaults** — One-click reset of all branding customizations
- **Version display** — Current app version shown in the Settings panel
### PWA
- **Installable** — Install to home screen on mobile and desktop via the browser install prompt
- **Dynamic app icon** — Uploaded logo is automatically resized to 192×192 and 512×512 and used as the PWA shortcut icon
- **Dynamic manifest** — App name and icons in the PWA manifest update live when changed in Settings
- **Offline fallback** — Basic offline support via service worker caching
### Contact Form
- **Login page contact form** — A "Contact Support" button on the login page opens a form (name, email, message, math captcha) that posts directly into the admin Support group
--- ---
## Tech Stack ## Quick Start
| Layer | Technology | ### Prerequisites
|---|---| - Docker & Docker Compose
| Backend | Node.js, Express, Socket.io |
| Database | SQLite (better-sqlite3) | ### 1. Build a versioned image
| Frontend | React 18, Vite |
| Image processing | sharp | ```bash
| Push notifications | web-push (VAPID) | # Build and tag as v1.0.0 (also tags :latest)
| Containerization | Docker, Docker Compose | ./build.sh 1.0.0
| Reverse proxy / SSL | Caddy (recommended) |
# Build latest only
./build.sh
```
### 2. Deploy with Docker Compose
```bash
cp .env.example .env
# Edit .env — set TEAMCHAT_VERSION, admin credentials, JWT_SECRET
nano .env
docker compose up -d
# View logs
docker compose logs -f
```
App will be available at **http://localhost:3000**
--- ---
## Requirements ## Release Workflow
- **Docker** and **Docker Compose v2** TeamChat uses a **build-then-run** pattern. You build the image once on your build machine (or CI), then the compose file just runs the pre-built image — no build step at deploy time.
- A domain name with DNS pointed at your server (required for HTTPS and Web Push notifications)
- Ports **80** and **443** open on your server firewall (if using Caddy for SSL)
--- ```
┌─────────────────────┐ ┌──────────────────────────┐
│ Build machine / CI │ │ Server / Portainer │
│ │ │ │
│ ./build.sh 1.2.0 │─────▶│ TEAMCHAT_VERSION=1.2.0 │
│ (or push to │ │ docker compose up -d │
│ registry first) │ │ │
└─────────────────────┘ └──────────────────────────┘
```
## Building the Image ### Build script usage
All builds use `build.sh`. No host Node.js installation is required — `npm install` and the Vite build run inside Docker.
```bash ```bash
# Build and tag as :latest only # Build and tag as :latest only