oscar-web/README.md
2026-12-02 22:56:42 -05:00

90 lines
2.7 KiB
Markdown

# Web OSCAR Chat
A small browser chat client for [Open OSCAR Server](https://github.com/mk6i/open-oscar-server). It provides a simple web UI for signing in with an existing OSCAR screen name and chatting through a Node.js backend.
## Features
- Sign in with an existing OSCAR screen name and password
- One-to-one instant messages
- Buddy list and presence updates (when available from the server)
- Group chat join/send/leave
- Chat invites with Join/Ignore (via TOC)
- Real-time updates over Server-Sent Events (SSE)
## How it works
The browser talks only to this Node/Express app. The app maintains server-side sessions and connects to Open OSCAR Server using:
- **Web API** for login/session/buddy/presence where available
- **TOC (Talk to OSCAR)** for IM and group chat/invites, especially on servers where Web API chat endpoints are not available
## Requirements
- Node.js 20.19+
- A running Open OSCAR Server instance
- Access to the server's Web API and/or TOC listener
## Setup
1. Install dependencies:
```bash
npm install
```
2. Create your environment file:
```bash
cp .env.example .env
```
3. Edit `.env` with your server settings.
4. Start the app:
```bash
npm run dev
```
Or for a normal run:
```bash
npm start
```
5. Open `http://localhost:3000` (or your configured `PORT`).
## Configuration
See `.env.example` for all options.
| Variable | Description | Default |
|---|---|---|
| `WEBAPI_HOST` | Web API host | `127.0.0.1` |
| `WEBAPI_PORT` | Web API port | `8081` |
| `TOC_HOST` | TOC host for IM/chat/invites | unset |
| `TOC_PORT` | TOC port | `9898` |
| `MANAGEMENT_HOST` | Management API host (used for user search when available) | `127.0.0.1` |
| `MANAGEMENT_PORT` | Management API port | `8080` |
| `PORT` | Port this web app listens on | `3000` |
| `LISTEN_HOST` | Host/interface this web app binds to | `127.0.0.1` |
| `DEV_ID` | Optional Web API devId/key if your server requires it | unset |
| `SESSION_SECRET` | Long random string for cookie signing | required |
## Notes and limitations
- This is an early/small project and may need adjustments for different Open OSCAR Server versions/configurations.
- Group chat/invites require a working TOC connection. The UI shows a TOC status indicator.
- Server-wide user search depends on Management API access. If unavailable, you can still open a direct IM by entering a screen name.
- Sessions are stored in memory; restarting the app logs users out.
- Use HTTPS and proper deployment hardening before exposing it publicly.
## Development
- Backend: Node.js, Express, ES modules
- Frontend: plain HTML/CSS/JavaScript (no build step)
- Real-time events: SSE (`/api/events`)
## License
Add a license file if you plan to distribute this publicly.