SvelteMUD - A Modern MUD Client
SvelteMUD is a feature-rich MUD (Multi-User Dungeon) client built with Svelte and SvelteKit, designed to provide a modern, accessible, and customizable interface for connecting to MUD servers.
Features
Core Functionality
- WebSocket to Telnet proxy for connecting to MUD servers
- Multiple simultaneous MUD connections via an MDI (Multiple Document Interface)
- ANSI color support
- Command history
- Configurable profiles for different MUD servers
- Auto-login functionality
- Progressive Web App (PWA) support for offline use and installation
GMCP Support
- Generic MUD Communication Protocol (GMCP) handling
- Support for common packages:
- Client.Media for sound playback
- Client.Keystroke for key capturing
- Easily extendable with custom GMCP packages
Triggers System
- Pattern matching with plain text or regular expressions
- Actions:
- Sound playback on triggers
- Highlight matched text
- Send commands to the server
- Execute custom JavaScript code
Accessibility Features
- Text-to-speech for incoming MUD text
- High contrast mode
- Configurable font size and family
- Keyboard navigation
- ARIA attributes for screen readers
Installation
# Clone the repository
git clone https://your-repo-url/svelte-mud.git
cd svelte-mud
# Install dependencies
npm install
# Start the development server
npm run dev
# Build for production
npm run build
Usage
-
Creating a Profile: Click "New Profile" to set up a connection to your MUD server. Configure host, port, and optional auto-login.
-
Connecting: After creating a profile, click the connect button in the tab to establish a connection.
-
Setting Up Triggers: Navigate to the Triggers tab and click "New Trigger" to create pattern matching triggers with various actions.
-
Customizing Settings: Adjust appearance and accessibility options in the Settings tab.
Project Structure
src/lib/connection/- MUD connection handling codesrc/lib/gmcp/- GMCP protocol handlingsrc/lib/triggers/- Trigger system implementationsrc/lib/accessibility/- Accessibility featuressrc/lib/profiles/- Profile managementsrc/lib/components/- Svelte componentssrc/lib/stores/- Svelte stores for state managementsrc/routes/api/- Server endpoints for WebSocket proxyingstatic/sounds/- Trigger sound filesstatic/icons/- PWA icons in various sizesstatic/manifest.json- PWA manifest filestatic/service-worker.js- Service worker for offline capabilities
Configuration
The client can be configured through the UI, with settings stored in local browser storage:
- MUD server profiles
- Trigger patterns and actions
- UI preferences (dark mode, font size, etc.)
- Accessibility settings
WebSocket to Telnet Proxy
For security reasons, browser WebSockets cannot connect directly to telnet ports. SvelteMUD uses a server-side proxy to facilitate this connection. The proxy is implemented in the src/routes/api/mud-connect and src/routes/api/mud-ws endpoints.
Progressive Web App (PWA) Support
SvelteMUD is configured as a Progressive Web App, allowing users to install it on their devices and use it offline:
Features
- Installable: Add to home screen on mobile or desktop
- Offline Support: Basic functionality works without an internet connection
- Automatic Updates: Notifies users when a new version is available
- Responsive Design: Works on all screen sizes
Installation
Mobile (iOS/Android)
- Open SvelteMUD in your browser
- Tap the Share button (iOS) or menu (Android)
- Select "Add to Home Screen" or "Install App"
Desktop (Chrome, Edge, etc.)
- Open SvelteMUD in your browser
- Look for the install icon in the address bar
- Click "Install" when prompted
Customizing Icons
To replace the default PWA icons:
- Replace the SVG template in
/static/icons/icon-512x512.svg - Run the icon generator:
npm run generate-icons
License
This project is licensed under the MIT License.
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.