A modular, WebSocket-based chat interface built with React, designed for deployment both on the web and within an Electron desktop environment.
- 🧠 AI-style chat interface with real-time WebSocket support
- 🧹 Modular design using Nanostores and EventBus
- 💬 Chat history saved with persistent local storage
- ⚙️ Dynamic WebSocket URL configuration via settings
- ♻️ Support for session resets and new chats
- 📝 Markdown rendering and HTML-to-Markdown conversion
- 💻 Deployable as a web app or desktop Electron app
- React (Functional Components + Hooks)
- PrimeReact (UI Components)
- Nanostores (State Management)
- Electron (Desktop runtime)
- Markdown-it + TurndownService (Markdown conversion)
- Custom event bus and utility modules from
knighttower
src/
├── components/
│ ├── ChatHistory.jsx
│ ├── InputBar.jsx
│ ├── Message.jsx
│ ├── Settings.jsx
│ └── Sidebar.jsx
├── modules/
│ └── chat.jsx
├── plugins/
│ └── HtmlToMarkdownPlugin.js
├── services/
│ └── busService.js
├── stores/
│ ├── AppSettings.js
│ └── ChatStore.js
├── app.jsx
├── main.cjs # Electron main process
└── preload.cjs # Electron preload script
# Clone the repository
git clone https://github.com/knighttower/FuseMixChatUI--React
cd chatui-react
# Install dependencies
npm install# Run development server
npm run dev
# Build production assets
npm run build-
Ensure Web build exists
npm run build
-
Launch Electron
npm run electron
This uses the contents of the
public/folder includingindex.htmland assets.
The app requires a valid WebSocket endpoint. Go to Settings (via sidebar) and enter a full ws:// or wss:// URL, e.g.:
wss://example.com/socket
This will persist across sessions via localStorage.
- Chat History is stored per
socketIdusing@nanostores/persistent - Usage Data (if needed) is similarly persisted
- All local data is cleared when starting a new session or manually resetting history
- Messages are converted from HTML to Markdown before being sent
- The component
<x-chat>and<x-sidebar>are auto-mounted at runtime viaapp.jsx - Copy buttons are auto-appended to assistant messages
Make sure to set a proper Content-Security-Policy in production builds and avoid using "unsafe-inline" or "unsafe-eval" where possible. Electron warns if the policy is insecure.
MIT License
Folder: cd /e/DEVELOPMENT/FuseMix/FuseMix.ChatUI/HTML